New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup.py test not installing elements from extra_requires with markers #1093
Comments
So, the problem appears to be here: https://github.com/pypa/setuptools/blob/master/setuptools/command/test.py#L188-L196
|
If you're using setup.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git i/setup.py w/setup.py
index fec78409..c929cace 100644
--- i/setup.py
+++ w/setup.py
@@ -279,12 +279,12 @@ setup(
"idna >= 2.1",
"asn1crypto >= 0.21.0",
"six >= 1.4.1",
+ "enum34; python_version < '3'",
+ "ipaddress; python_version < '3'",
+ "cffi >= 1.7; python_implementation != 'PyPy'",
],
tests_require=test_requirements,
extras_require={
- ":python_version < '3'": ["enum34", "ipaddress"],
- ":python_implementation != 'PyPy'": ["cffi >= 1.7"],
-
"test": test_requirements,
"docstest": [
"doc8", Except generated wheels won't be correct, because markers are stripped from the metadata. |
@benoit-pierre Yeah... I would love nothing more than to do it that way, unfortunately |
setuptools/command/test.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git i/setuptools/command/test.py w/setuptools/command/test.py
index c14b1242..f13cb732 100644
--- i/setuptools/command/test.py
+++ w/setuptools/command/test.py
@@ -11,7 +11,7 @@ from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
- working_set, _namespace_packages,
+ working_set, _namespace_packages, evaluate_marker,
add_activation_listener, require, EntryPoint)
from setuptools import Command
from setuptools.py31compat import unittest_main
@@ -204,7 +204,11 @@ class test(Command):
"""
ir_d = dist.fetch_build_eggs(dist.install_requires or [])
tr_d = dist.fetch_build_eggs(dist.tests_require or [])
- return itertools.chain(ir_d, tr_d)
+ er_d = []
+ for k, v in dist.extras_require.items():
+ if k.startswith(':'):
+ er_d.extend(dist.fetch_build_eggs(v))
+ return itertools.chain(ir_d, tr_d, er_d)
def run(self):
installed_dists = self.install_dists(self.distribution) |
Is that correct? It looks like it will install all items in |
Oups! Forgot to actually call if k.startswith(':') and evaluate_marker(k[1:]): Now to add a test to the testsuite... |
Not an expert in the setuptools code, but looks plausible to me! |
@benoit-pierre Is this issue still open? It seems like a regression I'd like to correct asap. |
@jaraco I don't think this is a regression, although I'd be appreciative if it was fixed quickly :-) |
Steps to reproduce (requires using Python2):
You can see the patch that triggers this here: pyca/cryptography#3796
The text was updated successfully, but these errors were encountered: