diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-13 21:31:31 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-13 21:31:31 -0400 |
| commit | dfe339ec3b1c2d0f463ed39f86c34c01ff8faedc (patch) | |
| tree | 6f0695b29ceed0a78d56f457f265f51acfb0db4c | |
| parent | 8c00a37662c6f2ff3814d75d5569c02f83e411a1 (diff) | |
| download | python-setuptools-git-dfe339ec3b1c2d0f463ed39f86c34c01ff8faedc.tar.gz | |
Use better variable names and the partition method for simplicity.
| -rw-r--r-- | setuptools/dist.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 1a475ed0..5adbfd4e 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -140,19 +140,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) +def _check_extra(extra, reqs): + name, sep, marker = extra.partition(':') + if marker and pkg_resources.invalid_marker(marker): + raise DistutilsSetupError("Invalid environment marker: " + marker) - for r in pkg_resources.parse_requirements(v): + for r in pkg_resources.parse_requirements(reqs): if r.marker: tmpl = ( "'extras_require' requirements cannot include " "environment markers, in {section!r}: '{req!s}'" ) - raise DistutilsSetupError(tmpl.format(section=k, req=r)) + raise DistutilsSetupError(tmpl.format(section=name, req=r)) def assert_bool(dist, attr, value): |
