diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-23 15:52:38 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-23 15:58:16 -0400 |
commit | f26bf186bad984b8649a723d795f66c4f8e415f6 (patch) | |
tree | e8c5e0ca78a37ab5e5723a6318f0d00ab9cdb079 | |
parent | 77044955def37aa95310224d6b8436a8f8e0c6d3 (diff) | |
download | external_python_setuptools-f26bf186bad984b8649a723d795f66c4f8e415f6.tar.gz external_python_setuptools-f26bf186bad984b8649a723d795f66c4f8e415f6.tar.bz2 external_python_setuptools-f26bf186bad984b8649a723d795f66c4f8e415f6.zip |
Align suffix calculation for extras sections
-rw-r--r-- | setuptools/dist.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 88bdf5aa..50f5c18f 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -370,9 +370,8 @@ class Distribution(Distribution_parse_config_files, _Distribution): self._tmp_extras_require = defaultdict(list) for section, v in spec_ext_reqs.items(): for r in pkg_resources.parse_requirements(v): - if r.marker: - section += ':' + str(r.marker) - self._tmp_extras_require[section].append(r) + suffix = ':' + str(r.marker) if r.marker else '' + self._tmp_extras_require[section + suffix].append(r) def _move_install_requirements_markers(self): """ @@ -400,12 +399,8 @@ class Distribution(Distribution_parse_config_files, _Distribution): for r in complex_reqs: suffix = ':' + str(r.marker) if r.marker else '' - sections = [ - section + suffix - for section in r.extras or ('',) - ] - for section in sections: - self._tmp_extras_require[section].append(r) + for section in r.extras or ('',): + self._tmp_extras_require[section + suffix].append(r) self.extras_require = dict( (k, [str(r) for r in map(self._clean_req, v)]) for k, v in self._tmp_extras_require.items() |