From e7d341af8987659ae1fa79701515c16238fe22f6 Mon Sep 17 00:00:00 2001 From: pje Date: Sat, 4 May 2013 16:21:50 -0400 Subject: Backport experimental environment marker support from the trunk --HG-- branch : setuptools-0.6 --- setuptools/dist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools/dist.py') diff --git a/setuptools/dist.py b/setuptools/dist.py index c1218ef2..582cc557 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -47,7 +47,6 @@ def assert_string_list(dist, attr, value): raise DistutilsSetupError( "%r must be a list of strings (got %r)" % (attr,value) ) - def check_nsp(dist, attr, value): """Verify that namespace packages are valid""" assert_string_list(dist,attr,value) @@ -69,6 +68,10 @@ def check_extras(dist, attr, value): """Verify that extras_require mapping is valid""" try: for k,v in value.items(): + if ':' in k: + k,m = k.split(':',1) + if pkg_resources.invalid_marker(m): + raise DistutilsSetupError("Invalid environment marker: "+m) list(pkg_resources.parse_requirements(v)) except (TypeError,ValueError,AttributeError): raise DistutilsSetupError( @@ -77,9 +80,6 @@ def check_extras(dist, attr, value): "requirement specifiers." ) - - - def assert_bool(dist, attr, value): """Verify that value is True, False, 0, or 1""" if bool(value) != value: -- cgit v1.2.1