File tree 3 files changed +6
-2
lines changed
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(
175
175
)
176
176
for req_str in reqs :
177
177
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
180
182
dist = env .get_distribution (req .name )
181
183
if not dist :
182
184
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:
178
178
[
179
179
"bar==2.0; python_version < '3.0'",
180
180
"bar==3.0; python_version >= '3.0'",
181
+ "foo==4.0; extra == 'dev'",
181
182
],
182
183
)
183
184
assert r == (set(), set()), repr(r)
You can’t perform that action at this time.
0 commit comments