mirror of https://github.com/pypa/pip
Merge pull request #11030 from uranusjr/build-env-req-check-evaluate-marker
This commit is contained in:
commit
8133d83929
|
@ -0,0 +1,2 @@
|
|||
When checking for conflicts in the build environment, correctly skip requirements
|
||||
containing markers that do not match the current environment.
|
|
@ -175,6 +175,8 @@ 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?
|
||||
dist = env.get_distribution(req.name)
|
||||
if not dist:
|
||||
missing.add(req_str)
|
||||
|
|
|
@ -165,6 +165,25 @@ def test_build_env_requirements_check(script: PipTestEnvironment) -> None:
|
|||
""",
|
||||
)
|
||||
|
||||
run_with_build_env(
|
||||
script,
|
||||
"""
|
||||
build_env.install_requirements(
|
||||
finder,
|
||||
["bar==3.0"],
|
||||
"normal",
|
||||
kind="installing bar in normal",
|
||||
)
|
||||
r = build_env.check_requirements(
|
||||
[
|
||||
"bar==2.0; python_version < '3.0'",
|
||||
"bar==3.0; python_version >= '3.0'",
|
||||
],
|
||||
)
|
||||
assert r == (set(), set()), repr(r)
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
def test_build_env_overlay_prefix_has_priority(script: PipTestEnvironment) -> None:
|
||||
create_basic_wheel_for_package(script, "pkg", "2.0")
|
||||
|
|
Loading…
Reference in New Issue