diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-23 15:59:11 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-23 16:01:40 -0400 |
commit | e144d98e8b38ee3440ad4fbf28c085e057858806 (patch) | |
tree | bf433d84a5a780b6103a76963603a83acf05e2ea | |
parent | f26bf186bad984b8649a723d795f66c4f8e415f6 (diff) | |
download | external_python_setuptools-e144d98e8b38ee3440ad4fbf28c085e057858806.tar.gz external_python_setuptools-e144d98e8b38ee3440ad4fbf28c085e057858806.tar.bz2 external_python_setuptools-e144d98e8b38ee3440ad4fbf28c085e057858806.zip |
Parse the requirements just once for simplicity and clarity
-rw-r--r-- | setuptools/dist.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 50f5c18f..c4a42183 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -387,14 +387,9 @@ class Distribution(Distribution_parse_config_files, _Distribution): return not req.marker and not req.extras spec_inst_reqs = getattr(self, 'install_requires', None) or () - simple_reqs = filter( - is_simple_req, - pkg_resources.parse_requirements(spec_inst_reqs), - ) - complex_reqs = filterfalse( - is_simple_req, - pkg_resources.parse_requirements(spec_inst_reqs), - ) + inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs)) + simple_reqs = filter(is_simple_req, inst_reqs) + complex_reqs = filterfalse(is_simple_req, inst_reqs) self.install_requires = list(map(str, simple_reqs)) for r in complex_reqs: |