diff options
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index c7f6d371..1a475ed0 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -141,17 +141,18 @@ def check_extras(dist, attr, value): def _check_extra(k, v): - if ':' in k: - k, m = k.split(':', 1) - if pkg_resources.invalid_marker(m): - raise DistutilsSetupError("Invalid environment marker: " + m) - for r in pkg_resources.parse_requirements(v): - if r.marker: - tmpl = ( - "'extras_require' requirements cannot include " - "environment markers, in {section!r}: '{req!s}'" - ) - raise DistutilsSetupError(tmpl.format(section=k, req=r)) + if ':' in k: + k, m = k.split(':', 1) + if pkg_resources.invalid_marker(m): + raise DistutilsSetupError("Invalid environment marker: " + m) + + for r in pkg_resources.parse_requirements(v): + if r.marker: + tmpl = ( + "'extras_require' requirements cannot include " + "environment markers, in {section!r}: '{req!s}'" + ) + raise DistutilsSetupError(tmpl.format(section=k, req=r)) def assert_bool(dist, attr, value): |
