mirror of https://github.com/pypa/pip
Compare commits
3 Commits
d0c89a151c
...
0a982f6444
Author | SHA1 | Date |
---|---|---|
Pradyun Gedam | 0a982f6444 | |
Pradyun Gedam | bf090d37d1 | |
Pradyun Gedam | 611e9253ff |
|
@ -0,0 +1 @@
|
|||
Properly filter out optional dependencies (i.e. extras) when checking build environment distributions.
|
|
@ -175,8 +175,10 @@ class BuildEnvironment:
|
|||
)
|
||||
for req_str in reqs:
|
||||
req = Requirement(req_str)
|
||||
if req.marker is not None and not req.marker.evaluate():
|
||||
continue # FIXME: Consider extras?
|
||||
# We're explicitly evaluating with an empty extra value, since build
|
||||
# environments are not provided any mechanism to select specific extras.
|
||||
if req.marker is not None and not req.marker.evaluate({"extra": ""}):
|
||||
continue
|
||||
dist = env.get_distribution(req.name)
|
||||
if not dist:
|
||||
missing.add(req_str)
|
||||
|
|
|
@ -178,6 +178,7 @@ def test_build_env_requirements_check(script: PipTestEnvironment) -> None:
|
|||
[
|
||||
"bar==2.0; python_version < '3.0'",
|
||||
"bar==3.0; python_version >= '3.0'",
|
||||
"foo==4.0; extra == 'dev'",
|
||||
],
|
||||
)
|
||||
assert r == (set(), set()), repr(r)
|
||||
|
|
Loading…
Reference in New Issue