Skip to content
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

Add type hints for the resolver module #1316

Merged
merged 14 commits into from Feb 9, 2021

Conversation

atugushev
Copy link
Member

@atugushev atugushev commented Feb 7, 2021

Refs: #972

Additionally refactored lookup_table():

  • removed unused functionality
  • made function type safe
  • moved doctests to tests/test_utils.py and add more tests

@atugushev atugushev changed the title Type hints for resolver Type hints for the resolver module Feb 7, 2021
@atugushev atugushev changed the title Type hints for the resolver module Add type hints for the resolver module Feb 7, 2021
@atugushev atugushev mentioned this pull request Feb 7, 2021
16 tasks
@codecov
Copy link

codecov bot commented Feb 7, 2021

Codecov Report

Merging #1316 (49e7cfa) into master (6629a8e) will increase coverage by 0.03%.
The diff coverage is 98.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1316      +/-   ##
==========================================
+ Coverage   99.58%   99.62%   +0.03%     
==========================================
  Files          33       33              
  Lines        2908     2921      +13     
  Branches      321      318       -3     
==========================================
+ Hits         2896     2910      +14     
+ Misses          6        5       -1     
  Partials        6        6              
Impacted Files Coverage Δ
piptools/repositories/pypi.py 97.26% <ø> (ø)
tests/test_utils.py 99.21% <91.66%> (-0.79%) ⬇️
piptools/cache.py 100.00% <100.00%> (ø)
piptools/repositories/base.py 100.00% <100.00%> (ø)
piptools/resolver.py 99.38% <100.00%> (+1.26%) ⬆️
piptools/utils.py 100.00% <100.00%> (ø)
tests/test_resolver.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6629a8e...a5ac73c. Read the comment docs.

and self.specifier == other.specifier
and self.extras == other.extras
)
return NotImplemented
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: this line left uncovered, so I've added it to exclude_lines to the coverage report config in a619d0d

Copy link
Member

Choose a reason for hiding this comment

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

Why not add tests instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, let's add one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in cabb979.

piptools/resolver.py Outdated Show resolved Hide resolved
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Most of the change is good but I've added a few comments to places that are rather problematic.

piptools/utils.py Show resolved Hide resolved
piptools/utils.py Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@jdufresne jdufresne left a comment

Choose a reason for hiding this comment

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

Nice work! Glad to see the typing continue.

.coveragerc Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
piptools/repositories/base.py Show resolved Hide resolved
piptools/resolver.py Outdated Show resolved Hide resolved
piptools/resolver.py Show resolved Hide resolved
piptools/resolver.py Outdated Show resolved Hide resolved
@atugushev
Copy link
Member Author

atugushev commented Feb 8, 2021

@jdufresne @webknjaz thanks for helping me with this PR! 🙏🏼 I've addressed all suggestions and I think it's ready for the second review round.

tests/test_resolver.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
@atugushev atugushev merged commit f60fb00 into jazzband:master Feb 9, 2021
@atugushev atugushev deleted the type-hints-for-resolver branch February 9, 2021 05:41
@atugushev
Copy link
Member Author

@jdufresne @webknjaz thanks for reviewing! 🙏🏼

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.

None yet

3 participants