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

Do not search for best_match for -c constraints that are not (yet) requirements #1175

Merged
merged 2 commits into from
Jul 19, 2020
Merged

Conversation

clslgrnc
Copy link
Contributor

@clslgrnc clslgrnc commented Jul 9, 2020

Fixes #1178.

In my organization we use a mono-repository with a huge constraints file for security purposes (via the -c option).
Additionally we have a few internal libs with a lot of versions.

As a result pip-compile is extremely slow as it tries to find a match for all constraints in our constraints file, at each round.
This is not necessary until these constraints become requirements.

The debug line should probably be changed, as an example we have:

found candidate urllib3>1.25.7 (constraint was >1.25.7)

Maybe I should change it to:

unused constraint urllib3>1.25.7

or something like that.

Changelog-friendly one-liner: Do not find_best_match for constraints (as opposed to requirements)

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).

as opposed to requirements
@codecov
Copy link

codecov bot commented Jul 9, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1175   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          36       36           
  Lines        2839     2841    +2     
  Branches      333      334    +1     
=======================================
+ Hits         2825     2827    +2     
  Misses          8        8           
  Partials        6        6           
Impacted Files Coverage Δ
tests/test_resolver.py 100.00% <ø> (ø)
piptools/resolver.py 99.37% <100.00%> (+<0.01%) ⬆️

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 7503ad7...90b2599. Read the comment docs.

@clslgrnc clslgrnc changed the title Do not find_best_match for constraints Do not search for best_match for -c constraints that are not (yet) requirements Jul 9, 2020
Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement! Could you add a test which would cover that case?

@atugushev atugushev added enhancement Improvements to functionality resolver Related to dependency resolver labels Jul 9, 2020
@clslgrnc
Copy link
Contributor Author

clslgrnc commented Jul 9, 2020

Added test fails without the patch

Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks.

@atugushev atugushev added this to the 5.3.0 milestone Jul 19, 2020
@atugushev atugushev merged commit d7db32a into jazzband:master Jul 19, 2020
@clslgrnc clslgrnc deleted the patch-1 branch July 20, 2020 08:04
@atugushev
Copy link
Member

pip-tools v5.3.0 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to functionality resolver Related to dependency resolver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip-compile fails on unavailable irrelevant constraint
2 participants