-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
…ts files (#10962)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Filter available distributions using hash declarations from constraints files. |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -45,7 +45,7 @@ | |||
from pip._internal.resolution.base import InstallRequirementProvider | ||||
from pip._internal.utils.compatibility_tags import get_supported | ||||
from pip._internal.utils.hashes import Hashes | ||||
from pip._internal.utils.packaging import get_requirement | ||||
from pip._internal.utils.packaging import get_requirement, is_pinned | ||||
from pip._internal.utils.virtualenv import running_under_virtualenv | ||||
|
||||
from .base import Candidate, CandidateVersion, Constraint, Requirement | ||||
|
@@ -303,19 +303,13 @@ def iter_index_candidate_infos() -> Iterator[IndexCandidateInfo]: | |||
# solely satisfied by a yanked release. | ||||
all_yanked = all(ican.link.is_yanked for ican in icans) | ||||
|
||||
def is_pinned(specifier: SpecifierSet) -> bool: | ||||
for sp in specifier: | ||||
if sp.operator == "===": | ||||
return True | ||||
if sp.operator != "==": | ||||
continue | ||||
if sp.version.endswith(".*"): | ||||
continue | ||||
return True | ||||
return False | ||||
|
||||
pinned = is_pinned(specifier) | ||||
|
||||
if not template.is_pinned: | ||||
assert template.req, "Candidates found on index must be PEP 508" | ||||
template.req.specifier = specifier | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
atugushev
Contributor
|
template = ireqs[0] |
If you could file an issue with a reproducer, that'd be great.
@pradyunsg still can't find the reproducer. Tests on pip-tools are failing in random combinations and if you run a single failed test - it passes. Weird-weird-weird.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
pradyunsg
Apr 8, 2022
Member
No, I'm pretty sure that we shouldn't be modfying template here -- since that's an actual requirement that we're supposed to be installing later.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
atugushev
Apr 8, 2022
Contributor
Do you have any ideas on how to avoid mutating ireqs[0]
? Deepcopy works but I wonder is there another way?
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
pradyunsg
Apr 8, 2022
Member
Not really -- could you file an issue for this, so that we can avoid having an extended discussion on a commit? :)
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This particular line breaks tests for the new resolver on pip-tools. I have no simple reproducer yet though, but I'm working on it.
See also jazzband/pip-tools#1539 (comment).