Commit 558ed858 authored by Benoit Pierre's avatar Benoit Pierre Committed by GitHub

Merge pull request #1108 from benoit-pierre/fix_requires_handling,_again

fix requires handling when using setup.cfg
parents 28e2625c 096f3287
......@@ -349,14 +349,15 @@ class Distribution(Distribution_parse_config_files, _Distribution):
"setuptools, pip, and PyPI. Please see PEP 440 for more "
"details." % self.metadata.version
)
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
self._finalize_requires()
def _finalize_requires(self):
"""
Fix environment markers in `install_requires` and `extras_require`.
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
"""
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
self._convert_extras_requirements()
self._move_install_requirements_markers()
......@@ -424,8 +425,7 @@ class Distribution(Distribution_parse_config_files, _Distribution):
_Distribution.parse_config_files(self, filenames=filenames)
parse_configuration(self, self.command_options)
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
self._finalize_requires()
def parse_command_line(self):
"""Process features after parsing command line options"""
......
......@@ -333,7 +333,7 @@ class TestOptions:
])
assert dist.install_requires == ([
'docutils>=0.3',
'pack ==1.1, ==1.3',
'pack==1.1,==1.3',
'hey'
])
assert dist.setup_requires == ([
......@@ -403,7 +403,7 @@ class TestOptions:
])
assert dist.install_requires == ([
'docutils>=0.3',
'pack ==1.1, ==1.3',
'pack==1.1,==1.3',
'hey'
])
assert dist.setup_requires == ([
......@@ -508,7 +508,7 @@ class TestOptions:
with get_dist(tmpdir) as dist:
assert dist.extras_require == {
'pdf': ['ReportLab>=1.2', 'RXP'],
'rest': ['docutils>=0.3', 'pack ==1.1, ==1.3']
'rest': ['docutils>=0.3', 'pack==1.1,==1.3']
}
def test_entry_points(self, tmpdir):
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment