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

Fix grouping of requirements to handle editables better #1132

Merged
merged 4 commits into from
May 5, 2020

Conversation

richafrank
Copy link
Contributor

@richafrank richafrank commented May 3, 2020

Fixes #1115 , or at least the test cases added there and in vphilippon#1

  • Ask repository for dependencies early for the side effect of assigning each nameless ireq a name. This means the correct ireqs will be grouped together.
  • Sort editables first within grouping, so that we start with all their attributes.
  • Update the dependency cache when we make a copy of an ireq. Otherwise, the pip resolver will tell us that the ireq has no dependencies because it was already prepared when we got its name. This was done because we hash ireqs in the cache based on identity. Alternatively, we could change that notion of identity, but that felt less safe, trying to determine the correct hash function.

Changelog-friendly one-liner: Fix grouping of editables and non-editables

Contributor checklist
  • Provided the tests for the changes.
  • Gave a clear one-line description in the PR (that the maintainers can add to CHANGELOG.md on release).
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@codecov
Copy link

codecov bot commented May 3, 2020

Codecov Report

Merging #1132 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1132   +/-   ##
=======================================
  Coverage   99.47%   99.47%           
=======================================
  Files          36       37    +1     
  Lines        2642     2678   +36     
  Branches      318      322    +4     
=======================================
+ Hits         2628     2664   +36     
  Misses          8        8           
  Partials        6        6           
Impacted Files Coverage Δ
piptools/repositories/base.py 100.00% <100.00%> (ø)
piptools/repositories/pypi.py 95.41% <100.00%> (+0.56%) ⬆️
piptools/resolver.py 99.36% <100.00%> (-0.64%) ⬇️
piptools/utils.py 100.00% <100.00%> (ø)
tests/test_cli_compile.py 100.00% <100.00%> (ø)
tests/test_data/packages/small_fake_a/setup.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 f95490a...e80c18b. Read the comment docs.

Copy link
Member

@vphilippon vphilippon left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you!

@vphilippon vphilippon added this to the 5.1.2 milestone May 4, 2020
@andersk
Copy link
Contributor

andersk commented Jun 3, 2020

This last commit introduced a regression when using the same zip file with different subdirectories (#1155).

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.

4 participants