Skip to content

Commit

Permalink
Allow filtering constraints with markers
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Aug 7, 2020
1 parent 312d1d0 commit b277846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/8724.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
New Resolver: Correctly handle marker evaluation in constraints and exclude
them if their markers do not match the current environment.
3 changes: 2 additions & 1 deletion src/pip/_internal/resolution/resolvelib/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def resolve(self, root_reqs, check_supported_wheels):
problem = check_invalid_constraint_type(req)
if problem:
raise InstallationError(problem)

if not req.match_markers():
continue
name = canonicalize_name(req.name)
if name in constraints:
constraints[name] = constraints[name] & req.specifier
Expand Down

0 comments on commit b277846

Please sign in to comment.