Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ensure get() methods have correct type-hints#1681

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 2 commits intomainfromjlvillal/mypy_ensure_type_hints
Nov 16, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedNov 8, 2021
edited
Loading

Fix classes which don't have correct 'get()' methods for classes
derived from GetMixin.

Add a unit test which verifies that classes have the correct return
type in their 'get()' method.

@JohnVillalovosJohnVillalovos marked this pull request as draftNovember 8, 2021 18:29
Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

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

I like the idea so that people get a helpful message to guide them, because this can get quite complex for new contributors I think.

For me this (andtest_mro.py) are kind of almost meta tests, so I wonder if we should move them together withtest_dists.py or so (all the other modules inobjects/ really test functions on gitlab resources).

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch 3 times, most recently from3df0d8a to8fcec4bCompareNovember 9, 2021 04:35
@JohnVillalovosJohnVillalovos changed the titleWIP: Ensure get() methods have correct type-hintsEnsure get() methods have correct type-hintsNov 9, 2021
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch from8fcec4b to196c6e1CompareNovember 9, 2021 04:36
@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewNovember 9, 2021 04:36
@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedNov 9, 2021
edited
Loading

I like the idea so that people get a helpful message to guide them, because this can get quite complex for new contributors I think.

For me this (andtest_mro.py) are kind of almost meta tests, so I wonder if we should move them together withtest_dists.py or so (all the other modules inobjects/ really test functions on gitlab resources).

Moving them works for me. I had put them inobjects because those were the only part of the code-base that they checked.

If we move them, where do you think we should move them.

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch from196c6e1 to5e54d67CompareNovember 9, 2021 04:39
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch from5e54d67 toc78e9deCompareNovember 14, 2021 19:35
@nejch
Copy link
Member

I like the idea so that people get a helpful message to guide them, because this can get quite complex for new contributors I think.
For me this (andtest_mro.py) are kind of almost meta tests, so I wonder if we should move them together withtest_dists.py or so (all the other modules inobjects/ really test functions on gitlab resources).

Moving them works for me. I had put them inobjects because those were the only part of the code-base that they checked.

If we move them, where do you think we should move them.

I was thinking maybehttps://github.com/python-gitlab/python-gitlab/tree/main/tests/smoke along withtest_dists.py since these have more of a meta/linting style to me. WDYT? I think "sanity/" might be more appropriate than "smoke/" now, but that was my fault 😀

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch 2 times, most recently from42726c9 toae68668CompareNovember 15, 2021 22:12
@JohnVillalovos
Copy link
MemberAuthor

I was thinking maybehttps://github.com/python-gitlab/python-gitlab/tree/main/tests/smoke along withtest_dists.py since these have more of a meta/linting style to me. WDYT? I think "sanity/" might be more appropriate than "smoke/" now, but that was my fault 😀

I created a newtests/meta/ directory and puttest_mro.py andtest_ensure_type_hints.py in there.

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/mypy_ensure_type_hints branch 2 times, most recently fromb14212b to7910780CompareNovember 15, 2021 22:22
@codecov-commenter
Copy link

codecov-commenter commentedNov 15, 2021
edited
Loading

Codecov Report

Merging#1681 (46773a8) intomain (06184da) willdecrease coverage by0.32%.
The diff coverage is81.42%.

@@            Coverage Diff             @@##             main    #1681      +/-   ##==========================================- Coverage   91.88%   91.55%   -0.33%==========================================  Files          75       75                Lines        4435     4571     +136     ==========================================+ Hits         4075     4185     +110- Misses        360      386      +26
FlagCoverage Δ
cli_func_v480.83% <55.71%> (-0.82%)⬇️
py_func_v480.94% <73.57%> (-0.25%)⬇️
unit83.02% <65.00%> (-0.59%)⬇️

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

Impacted FilesCoverage Δ
gitlab/v4/objects/merge_requests.py84.67% <50.00%> (-0.52%)⬇️
gitlab/v4/objects/award_emojis.py89.65% <53.84%> (-10.35%)⬇️
gitlab/v4/objects/users.py95.79% <57.14%> (-2.71%)⬇️
gitlab/v4/objects/clusters.py93.93% <60.00%> (-6.07%)⬇️
gitlab/v4/objects/tags.py91.66% <60.00%> (-8.34%)⬇️
gitlab/v4/objects/container_registry.py81.48% <66.66%> (-2.52%)⬇️
gitlab/v4/objects/members.py94.33% <66.66%> (-5.67%)⬇️
gitlab/v4/objects/notes.py95.23% <76.47%> (-4.77%)⬇️
gitlab/v4/objects/events.py98.73% <93.33%> (-1.27%)⬇️
gitlab/v4/objects/audit_events.py100.00% <100.00%> (ø)
... and10 more

The 'test_mro.py' file is not really a unit test but more of a 'meta'check on the validity of the code base.
Fix classes which don't have correct 'get()' methods for classesderived from GetMixin.Add a unit test which verifies that classes have the correct returntype in their 'get()' method.
@nejchnejch merged commit0951989 intomainNov 16, 2021
@nejchnejch deleted the jlvillal/mypy_ensure_type_hints branchNovember 16, 2021 22:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchnejch approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@JohnVillalovos@nejch@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp