Skip to content

Commit

Permalink
Clarify intent of extra=None
Browse files Browse the repository at this point in the history
  • Loading branch information
astrojuanlu committed Feb 13, 2021
1 parent 040be7c commit 3a53732
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion piptools/scripts/compile.py
Expand Up @@ -429,7 +429,11 @@ def cli(
constraints = [
req
for req in constraints
if req.markers is None or req.markers.evaluate(dict(extra=None))
if req.markers is None
# We explicitly set extra=None to filter out optional requirements
# since evaluating an extra marker with no environment raises UndefinedEnvironmentName
# (see https://packaging.pypa.io/en/latest/markers.html#usage)
or req.markers.evaluate(dict(extra=None))
]

log.debug("Using indexes:")
Expand Down

0 comments on commit 3a53732

Please sign in to comment.