From 33544f0bf806d73495b00b9f8a0e45c25742fbc1 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Fri, 1 May 2015 08:23:57 -0700 Subject: Nicer error when problem in install_requires Instead of: $ python setup.py egg_info error in adminweb setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers We now have the more helpful: $ python setup.py egg_info error in adminweb setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers. Error: Expected version spec in smsdk.authsvc>=0.0.8,2.0 at 2.0 It took me longer than it should to find the problem with the old error message. The new error message would've helped greatly. --- setuptools/dist.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index ffbc7c48..220bcf8c 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -122,11 +122,15 @@ def check_requirements(dist, attr, value): """Verify that install_requires is a valid requirements list""" try: list(pkg_resources.parse_requirements(value)) - except (TypeError,ValueError): + except (TypeError, ValueError) as e: raise DistutilsSetupError( "%r must be a string or list of strings " - "containing valid project/version requirement specifiers" % (attr,) + "containing valid project/version requirement specifiers.\n" + "Error: %s" + % (attr, ' '.join(e.args)) ) + + def check_entry_points(dist, attr, value): """Verify that entry_points map is parseable""" try: -- cgit v1.2.3