Repository navigation
Treat --upgrade-packages PKGSPECs as constraints (not just minimums), consistently - #1578
Merged
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
AndydeCleyre
force-pushed
the
bugfix/1550
branch
2 times, most recently
from
February 9, 2022 17:58
afe728c to
6a6b4c7
Compare
--upgrade-packages PKGSPECs as constraints, even for yet unpinned subdependencies, or when combined with --upgrade
--upgrade-packages PKGSPECs as constraints, even for yet unpinned subdependencies, or when combined with --upgrade
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Author
|
OK I think the new parametrization for |
AndydeCleyre
marked this pull request as ready for review
February 10, 2022 04:58
richafrank
reviewed
Feb 20, 2022
richafrank
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working to restore this behavior @AndydeCleyre !
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
March 15, 2022 16:14
90c1b6c to
d2a8569
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
4 times, most recently
from
April 1, 2022 15:32
cd3002a to
e248a40
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
2 times, most recently
from
April 4, 2022 20:44
583104c to
e8fd4b0
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
April 28, 2022 21:24
e8fd4b0 to
6d979d5
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
June 16, 2022 16:40
f9b3eae to
51bf60d
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
2 times, most recently
from
June 30, 2022 21:42
e187eaa to
efaf7e9
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
2 times, most recently
from
July 18, 2022 15:49
06708b0 to
51d4d41
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
August 15, 2022 13:35
51d4d41 to
e0bf1b5
Compare
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
October 1, 2022 19:48
e0bf1b5 to
316052b
Compare
Ensure temporary constraints file gets cleaned up in a way that avoids Windows file handling complications
Remove leftovers of now unused existing_pins_to_upgrade set
... to cover when the subdependency is not already pinned
... to cover when the -P pkgs are only subdependencies
AndydeCleyre
force-pushed
the
bugfix/1550
branch
from
October 3, 2022 15:19
316052b to
91a1c0e
Compare
--upgrade-packages PKGSPECs as constraints (not just minimums), consistently
atugushev
approved these changes
Dec 12, 2022
atugushev
left a comment
Contributor
There was a problem hiding this comment.
Finally got to this PR. That looks awesome, thanks!
atugushev
enabled auto-merge (squash)
December 12, 2022 23:39
2 of 4 tasks
sirosen
added a commit
to sirosen/pip-tools
that referenced
this pull request
Feb 6, 2026
When this code was originally written (pypa#481), the tempfile name itself was being added to the `constraints` list. It therefore needed to persist until processing of that list was done. That's no longer the case (the file gets parsed by `pip-tools` itself), so there's no reason not to use the context manager interface which guarantees proper cleanup. In order to test, we need to mock over NamedTemporaryFile, which is slightly fragile, but better than not having any testing at all. A similar usage -- without the file leak -- was introduced in pypa#1578, and is therefore also updated here to use the contextmanager version of NamedTemporaryFile. Because it was already mostly correct, no new test is included for that behavior.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1550
This aims to address two problems:
--upgradeand--upgrade-packages PKGSPECare used together, andPKGSPEC's package is not in the input file (but is a subdependency), then that package is upgraded beyondPKGSPEC--upgrade-packages PKGSPECis used, andPKGSPEC's package is in neither the input file nor a preexisting output file (but is a subdependency), then that package is upgraded beyondPKGSPECIn other words:
Some of the current behavior was informed by discussion at #759.
However my understanding now is that it's useful, expected, and without significant cost to additionally treat
--upgrade-packagesspecs as constraints, thereby resolving the above cases.Contributor checklist
Maintainer checklist
backwards incompatible,feature,enhancement,deprecation,bug,dependency,docsorskip-changelogas they determine changelog listing.