Skip to content

Conversation

@igorp-collabora
Copy link
Contributor

Currently because the Get mixin is not generic every subclass has to implement its own get methods to type hint get method return beoynd the basic RESTObject.

The upcoming #3083 PR will change Get mixin to use generics. This means it will be able to type hint the corresponding _obj_cls and no get method would need to be redefined.

Because removing existing get methods modifies a lot of files split it in to a separate commit.

Also remove the tests/unit/meta/test_ensure_type_hints.py file because testing subclasses for get methods is no longer relevant.

Currently because the Get mixin is not generic every subclass has
to implement its own `get` methods to type hint `get` method return
beoynd the basic RESTObject.

The upcoming PR will change Get mixin to use generics. This means
it will be able to type hint the corresponding `_obj_cls` and no
`get` method would need to be redefined.

Because removing existing `get` methods modifies a lot of files
split it in to a separate commit.

Also remove the `tests/unit/meta/test_ensure_type_hints.py` file
because testing subclasses for `get` methods is no longer relevant.

Signed-off-by: Igor Ponomarev <igor.ponomarev@collabora.com>
@igorp-collabora igorp-collabora force-pushed the rest-manager-remove-extra-get branch from 6cdbad3 to 6efad64 Compare January 29, 2025 17:39
@codecov
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.28%. Comparing base (515a8a2) to head (6efad64).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3110      +/-   ##
==========================================
+ Coverage   96.80%   97.28%   +0.47%     
==========================================
  Files          97       97              
  Lines        6358     6006     -352     
==========================================
- Hits         6155     5843     -312     
+ Misses        203      163      -40     
Flag Coverage Δ
api_func_v4 83.46% <100.00%> (+0.42%) ⬆️
cli_func_v4 84.56% <100.00%> (+1.50%) ⬆️
unit 90.12% <100.00%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/client.py 98.73% <100.00%> (ø)
gitlab/v4/objects/appearance.py 100.00% <100.00%> (ø)
gitlab/v4/objects/audit_events.py 100.00% <ø> (ø)
gitlab/v4/objects/award_emojis.py 100.00% <ø> (+10.38%) ⬆️
gitlab/v4/objects/badges.py 100.00% <ø> (ø)
gitlab/v4/objects/boards.py 100.00% <ø> (+4.65%) ⬆️
gitlab/v4/objects/branches.py 100.00% <ø> (ø)
gitlab/v4/objects/broadcast_messages.py 100.00% <ø> (ø)
gitlab/v4/objects/bulk_imports.py 100.00% <ø> (ø)
gitlab/v4/objects/ci_lint.py 100.00% <100.00%> (ø)
... and 52 more

Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW! Big PR, but relatively easy to review.

Thanks ❤️

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for splitting this out @igorp-collabora! Seeing all the removals isolated like that is super clear 👍

@nejch nejch merged commit edd01a5 into python-gitlab:main Jan 29, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants