diff options
author | Benoit Pierre <benoit.pierre@gmail.com> | 2017-07-14 23:56:05 +0200 |
---|---|---|
committer | Benoit Pierre <benoit.pierre@gmail.com> | 2017-07-15 06:37:00 +0200 |
commit | a3ec721ec1e70f1f7aec6c3349ad85b446410809 (patch) | |
tree | 38d46aa6466859dbe3ddf3af96f8fdc2f1c49dba /setuptools/dist.py | |
parent | 2328be3cc556076b91c8ec74da7b85b178dbc574 (diff) | |
download | external_python_setuptools-a3ec721ec1e70f1f7aec6c3349ad85b446410809.tar.gz external_python_setuptools-a3ec721ec1e70f1f7aec6c3349ad85b446410809.tar.bz2 external_python_setuptools-a3ec721ec1e70f1f7aec6c3349ad85b446410809.zip |
fix `install_requires` handling of extras
Internally move requirements in `install_requires` that are using
extras to `extras_require` so those extras don't get stripped when
building wheels.
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r-- | setuptools/dist.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index d77d56b1..9a034db5 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -358,7 +358,7 @@ class Distribution(Distribution_parse_config_files, _Distribution): Fix environment markers in `install_requires` and `extras_require`. - move requirements in `install_requires` that are using environment - markers to `extras_require`. + markers or extras to `extras_require`. - convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. @@ -379,11 +379,17 @@ class Distribution(Distribution_parse_config_files, _Distribution): getattr(self, 'install_requires', None) or () ): marker = r.marker - if not marker: + extras = r.extras + if not marker and not extras: install_requires.append(r) continue + r.extras = () r.marker = None - extras_require[':' + str(marker)].append(r) + for e in extras or ('',): + section = e + if marker: + section += ':' + str(marker) + extras_require[section].append(r) self.extras_require = dict( (k, [str(r) for r in v]) for k, v in extras_require.items() |