aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorBenoit Pierre <benoit.pierre@gmail.com>2017-07-14 23:56:05 +0200
committerBenoit Pierre <benoit.pierre@gmail.com>2017-07-15 06:37:00 +0200
commita3ec721ec1e70f1f7aec6c3349ad85b446410809 (patch)
tree38d46aa6466859dbe3ddf3af96f8fdc2f1c49dba /setuptools/tests
parent2328be3cc556076b91c8ec74da7b85b178dbc574 (diff)
downloadexternal_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/tests')
-rw-r--r--setuptools/tests/test_egg_info.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 0b6f06b2..5ea55d61 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -188,7 +188,7 @@ class TestEggInfo(object):
)
invalid_marker = "<=>++"
- def test_install_requires_with_markers(self, tmpdir_cwd, env):
+ def test_install_requires_with_marker(self, tmpdir_cwd, env):
tmpl = 'install_requires=["barbazquux;{marker}"],'
req = tmpl.format(marker=self.mismatch_marker)
self._setup_script_with_requires(req)
@@ -204,6 +204,37 @@ class TestEggInfo(object):
assert install_requires.lstrip() == expected_requires
assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+ def test_install_requires_with_extra(self, tmpdir_cwd, env):
+ req = 'install_requires=["barbazquux [test]"],'
+ self._setup_script_with_requires(req)
+ self._run_install_command(tmpdir_cwd, env)
+ egg_info_dir = self._find_egg_info_files(env.paths['lib']).base
+ requires_txt = os.path.join(egg_info_dir, 'requires.txt')
+ with open(requires_txt) as fp:
+ install_requires = fp.read()
+ expected_requires = DALS('''
+ [test]
+ barbazquux
+ ''')
+ assert install_requires.lstrip() == expected_requires
+ assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+
+ def test_install_requires_with_extra_and_marker(self, tmpdir_cwd, env):
+ tmpl = 'install_requires=["barbazquux [test]; {marker}"],'
+ req = tmpl.format(marker=self.mismatch_marker)
+ self._setup_script_with_requires(req)
+ self._run_install_command(tmpdir_cwd, env)
+ egg_info_dir = self._find_egg_info_files(env.paths['lib']).base
+ requires_txt = os.path.join(egg_info_dir, 'requires.txt')
+ with open(requires_txt) as fp:
+ install_requires = fp.read()
+ expected_requires = DALS('''
+ [test:{marker}]
+ barbazquux
+ ''').format(marker=self.mismatch_marker_alternate)
+ assert install_requires.lstrip() == expected_requires
+ assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+
def test_setup_requires_with_markers(self, tmpdir_cwd, env):
tmpl = 'setup_requires=["barbazquux;{marker}"],'
req = tmpl.format(marker=self.mismatch_marker)