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 a bug where pip-compile would keep outdated options #1029

Merged
merged 2 commits into from
Jan 24, 2020

Conversation

atugushev
Copy link
Member

Fixes #1018.

Consider a test case:

$ cat requirements.in
--find-links foo

$ cat requirements.txt
--find-links bar

The bug was that pip-compile would keep both options from requirements.in and requirements.txt:

$ pip-compile --no-header
--find-links foo
--find-links bar

It should keep the options from requirements.in file:

$ pip-compile --no-header
--find-links foo

The fix is to pass a temporary finder, session, and options instances to parse_requirements() when parsing an existing requirements.txt.

Changelog-friendly one-liner: Fix a bug where pip-compile would keep outdated options from requirements.txt.

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

Consider a test case:

$ cat requirements.in
--find-links foo

$ cat requirements.txt
--find-links bar

The bug was that pip-compile would keep both options from
requirements.in and requirements.txt:

$ pip-compile --no-header
--find-links foo
--find-links bar

It should keep the options from requirements.in file:

$ pip-compile --no-header
--find-links foo

The fix is to pass a temporary finder, session, and options instances
to parse_requirements() when parsing an existing requirements.txt file.
@atugushev atugushev added this to the 4.4.0 milestone Jan 9, 2020
@atugushev atugushev mentioned this pull request Jan 9, 2020
@codecov
Copy link

codecov bot commented Jan 9, 2020

Codecov Report

Merging #1029 into master will increase coverage by 0.38%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1029      +/-   ##
=========================================
+ Coverage   99.11%   99.5%   +0.38%     
=========================================
  Files          34      34              
  Lines        2370    2418      +48     
  Branches      302     306       +4     
=========================================
+ Hits         2349    2406      +57     
+ Misses         11       6       -5     
+ Partials       10       6       -4
Impacted Files Coverage Δ
piptools/scripts/compile.py 100% <100%> (ø) ⬆️
piptools/logging.py 100% <100%> (ø) ⬆️
tests/test_cli_compile.py 100% <100%> (ø) ⬆️
piptools/repositories/pypi.py 95.6% <100%> (+2.68%) ⬆️
piptools/exceptions.py 100% <0%> (+10.52%) ⬆️

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 7b61ad3...1fd6b18. Read the comment docs.

@atugushev atugushev removed this from the 4.4.0 milestone Jan 21, 2020
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 👍

@vphilippon vphilippon added this to the 4.4.1 milestone Jan 22, 2020
@atugushev
Copy link
Member Author

@vphilippon thanks for reviewing this!

@atugushev atugushev merged commit 7095e3b into jazzband:master Jan 24, 2020
@atugushev atugushev deleted the duplicate-options-1018 branch January 24, 2020 13:40
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.

duplicate --find-links
2 participants