File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ Properly filter out optional dependencies (i.e. extras) when checking build environment distributions.
Original file line number Diff line number Diff line change @@ -175,8 +175,10 @@ def check_requirements(
175175 )
176176 for req_str in reqs :
177177 req = Requirement (req_str )
178- if req .marker is not None and not req .marker .evaluate ():
179- continue # FIXME: Consider extras?
178+ # We're explicitly evaluating with an empty extra value, since build
179+ # environments are not provided any mechanism to select specific extras.
180+ if req .marker is not None and not req .marker .evaluate ({"extra" : "" }):
181+ continue
180182 dist = env .get_distribution (req .name )
181183 if not dist :
182184 missing .add (req_str )
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ def test_build_env_requirements_check(script: PipTestEnvironment) -> None:
178178 [
179179 "bar==2.0; python_version < '3.0'",
180180 "bar==3.0; python_version >= '3.0'",
181+ "foo==4.0; extra == 'dev'",
181182 ],
182183 )
183184 assert r == (set(), set()), repr(r)
You can’t perform that action at this time.
0 commit comments