Skip to content

chore: add type-hints to remaining gitlab/v4/objects/*.py files #1695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 23, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Nov 17, 2021

Fixed a bug in the auto-manager creation code if we added a type-hint for the manager attribute.

Add type-hints for the remainder of the code base.

Finally! 😊

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mypy_epics branch 4 times, most recently from 57cd034 to bb1a454 Compare November 17, 2021 04:31
@JohnVillalovos JohnVillalovos changed the title WIP: chore: add type-hints to gitlab/v4/objects/epics.py chore: add type-hints to gitlab/v4/objects/epics.py Nov 17, 2021
@JohnVillalovos JohnVillalovos requested a review from nejch November 17, 2021 04:33
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2021

Codecov Report

Merging #1695 (8c3879c) into main (2cd15ac) will decrease coverage by 0.07%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main    #1695      +/-   ##
==========================================
- Coverage   91.53%   91.46%   -0.08%     
==========================================
  Files          75       75              
  Lines        4574     4616      +42     
==========================================
+ Hits         4187     4222      +35     
- Misses        387      394       +7     
Flag Coverage Δ
cli_func_v4 80.63% <69.79%> (-0.20%) ⬇️
py_func_v4 80.82% <79.16%> (-0.11%) ⬇️
unit 82.92% <80.20%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
gitlab/v4/objects/geo_nodes.py 68.57% <46.15%> (-7.30%) ⬇️
gitlab/v4/objects/epics.py 74.41% <83.33%> (+0.05%) ⬆️
gitlab/v4/objects/pipelines.py 93.75% <83.33%> (-0.70%) ⬇️
gitlab/v4/objects/jobs.py 77.27% <89.47%> (+1.00%) ⬆️
gitlab/v4/objects/issues.py 89.02% <100.00%> (+1.02%) ⬆️
gitlab/v4/objects/milestones.py 100.00% <100.00%> (ø)
gitlab/v4/objects/repositories.py 82.53% <100.00%> (+1.18%) ⬆️
gitlab/v4/objects/services.py 100.00% <100.00%> (ø)
gitlab/v4/objects/sidekiq.py 100.00% <100.00%> (ø)

@JohnVillalovos JohnVillalovos changed the title chore: add type-hints to gitlab/v4/objects/epics.py chore: add type-hints to remaining gitlab/v4/objects/*.py files Nov 21, 2021
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mypy_epics branch 2 times, most recently from 1ecb0a6 to ccd93e3 Compare November 21, 2021 22:54
@JohnVillalovos JohnVillalovos marked this pull request as draft November 21, 2021 22:55
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mypy_epics branch 10 times, most recently from cf0049b to d18987f Compare November 22, 2021 03:06
@JohnVillalovos JohnVillalovos changed the title chore: add type-hints to remaining gitlab/v4/objects/*.py files WIP: chore: add type-hints to remaining gitlab/v4/objects/*.py files Nov 22, 2021
When attempting to add type-hints to the the 'manager' attribute into
a RESTObject derived class it would break things.

This was because our auto-manager creation code would automatically
add the specified annotated manager to the 'manager' attribute. This
breaks things.

Now check in our auto-manager creation if our attribute is called
'manager'. If so we ignore it.
@JohnVillalovos JohnVillalovos marked this pull request as ready for review November 22, 2021 06:42
@JohnVillalovos JohnVillalovos changed the title WIP: chore: add type-hints to remaining gitlab/v4/objects/*.py files chore: add type-hints to remaining gitlab/v4/objects/*.py files Nov 22, 2021
@nejch nejch merged commit 7ba5995 into main Nov 23, 2021
@nejch nejch deleted the jlvillal/mypy_epics branch November 23, 2021 21:59
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.

Lack of typing info RFE: Support type hints so mypy and other type checkers can work
3 participants