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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions piptools/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def get_best_match(self, ireq):
# NOTE: it's much quicker to immediately return instead of
# hitting the index server
best_match = ireq
elif ireq.constraint:
# NOTE: This is not a requirement (yet) and does not need
# to be resolved
best_match = ireq
else:
best_match = self.repository.find_best_match(
ireq, prereleases=self.prereleases
Expand Down
12 changes: 12 additions & 0 deletions tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@
"werkzeug==0.10.4 (from flask==0.10.1)",
],
),
# We shouldn't fail on invalid irrelevant pip constraints
# See: GH-1178
(
["Flask", ("missing-dependency<1.0", True), ("itsdangerous", True)],
[
"flask==0.10.1",
"itsdangerous==0.24",
"markupsafe==0.23 (from jinja2==2.7.3->flask==0.10.1)",
"jinja2==2.7.3 (from flask==0.10.1)",
"werkzeug==0.10.4 (from flask==0.10.1)",
],
),
# Unsafe dependencies should be filtered
(
["setuptools==35.0.0", "anyjson==0.3.3"],
Expand Down