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

Always obey --upgrade-package, and allow it together with --upgrade #831

Merged
merged 2 commits into from
Jun 6, 2019

Conversation

adamchainz
Copy link
Contributor

@adamchainz adamchainz commented May 30, 2019

Fixes #829. Closes #830.

Allow the two options together, essentially making --upgrade-package a way of passing an extra constraint. Always parse --upgrade-package, regardless of whether the output file exists.

Changelog-friendly one-liner:

--upgrade and --upgrade-package are no longer mutually exclusive.
--upgrade-package now works even if the output file doesn't exist.

Contributor checklist
  • Provided the tests for the changes.
  • Requested a review from another contributor.
  • 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).

@adamchainz
Copy link
Contributor Author

As an external contributor, I can't request a reviewer or assign to a milestone 🙊

@atugushev
Copy link
Member

atugushev commented May 30, 2019

Thanks for the contribution! I would suggest to split it to two PR, since #830 needs to be discussed.

@adamchainz
Copy link
Contributor Author

I will split if anyone finds the proposal offensive but I think it's quite an easy win

@atugushev
Copy link
Member

I will split if anyone finds the proposal offensive but I think it's quite an easy win

At least it would be much easier to review for maintainers.

Fixes jazzband#829. Fixes jazzband#830.

Allow the two options together, essentially making `--upgrade-package` a way of passing an extra constraint. Always parse `--upgrade-package`, regardless of whether the output file exists.
@codecov

This comment has been minimized.

@codecov
Copy link

codecov bot commented May 30, 2019

Codecov Report

Merging #831 into master will decrease coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #831      +/-   ##
==========================================
- Coverage    98.8%   98.69%   -0.12%     
==========================================
  Files          36       36              
  Lines        2184     2139      -45     
  Branches      280      279       -1     
==========================================
- Hits         2158     2111      -47     
- Misses         15       16       +1     
- Partials       11       12       +1
Impacted Files Coverage Δ
tests/test_cli_compile.py 100% <100%> (ø) ⬆️
piptools/scripts/compile.py 100% <100%> (ø) ⬆️
piptools/repositories/pypi.py 92.63% <0%> (-1.22%) ⬇️
piptools/repositories/local.py 90.69% <0%> (-0.8%) ⬇️
tests/conftest.py 94.44% <0%> (-0.68%) ⬇️
piptools/scripts/sync.py 100% <0%> (ø) ⬆️
piptools/resolver.py 100% <0%> (ø) ⬆️
tests/test_writer.py 100% <0%> (ø) ⬆️
piptools/cache.py 100% <0%> (ø) ⬆️
... and 12 more

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 4438d98...c1e79b6. Read the comment docs.

@adamchainz
Copy link
Contributor Author

The fix for #830 is just the removal of the constraint on line 228 of compile.py. The actual behavioural fix is done by the move of code that fixes #829. If I split it will really mean branch-on-branch for #830 which isn't better is it?

@atugushev
Copy link
Member

The fix for #830 is just the removal of the constraint on line 228 of compile.py. The actual behavioural fix is done by the move of code that fixes #829. If I split it will really mean branch-on-branch for #830 which isn't better is it?

It would be better if this two issues depended on each other. But they look like not depended and can be fixed(implemented) separately. I must emphasise it's not mandatory, just a simple recommendation :)

Have you researched why the options --upgrade and --upgrade-package are mutually exclusive by a deliberate design decision?

@atugushev
Copy link
Member

It would be better if this two issues depended on each other. But they look like not depended and can be fixed(implemented) separately. I must emphasise it's not mandatory, just a simple recommendation :)

Oh, sorry, they should be fixed by one shot of course.

@atugushev atugushev added the enhancement Improvements to functionality label May 30, 2019
@adamchainz
Copy link
Contributor Author

Have you researched why the options --upgrade and --upgrade-package are mutually exclusive by a deliberate design decision?

It doesn't seem there was too much deliberation in #409 which added --upgrade-package and added the mutual exclusivity. I think it was just easier at the time given the way the code was laid out then.

Copy link
Contributor Author

@adamchainz adamchainz 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 review! I decided to un-parameterize the tests since the branching was reducing readability :)

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!

@atugushev atugushev added this to the 3.8.0 milestone May 30, 2019
@atugushev atugushev requested a review from blueyed May 30, 2019 11:44
@atugushev atugushev merged commit 0c78c0e into jazzband:master Jun 6, 2019
@adamchainz
Copy link
Contributor Author

Thanks @atugushev ! 🎉

@adamchainz adamchainz deleted the issues_829_830 branch June 6, 2019 13:26
@atugushev
Copy link
Member

atugushev commented Jun 6, 2019

@adamchainz thanks for great work! I'll prepare a release within 24h.

@adamchainz adamchainz mentioned this pull request Jun 6, 2019
adamchainz added a commit to adamchainz/pip-tools that referenced this pull request Jun 6, 2019
* Move and duplicate note about running under multiple Python versions to the start of each command's section.
* Add note about using `--upgrade` and `--upgrade-package` together following jazzband#831.
* Document `--output-file`.
@atugushev
Copy link
Member

pip-tools v3.8.0 is released

atugushev pushed a commit that referenced this pull request Jun 7, 2019
* Move and duplicate note about running under multiple Python versions to the start of each command's section.
* Add note about using `--upgrade` and `--upgrade-package` together following #831.
* Document `--output-file`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to functionality
Projects
None yet
2 participants