diff options
Diffstat (limited to 'setuptools')
-rw-r--r-- | setuptools/command/__init__.py | 6 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 2 | ||||
-rw-r--r-- | setuptools/dist.py | 34 | ||||
-rw-r--r-- | setuptools/tests/__init__.py | 6 |
4 files changed, 26 insertions, 22 deletions
diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py index 678f4e61..0689b788 100644 --- a/setuptools/command/__init__.py +++ b/setuptools/command/__init__.py @@ -5,6 +5,10 @@ __all__ = [ 'register', ] +import sys +if sys.version>='2.5': + # In Python 2.5 and above, distutils includes its own upload command + __all__.remove('upload') from distutils.command.bdist import bdist @@ -12,4 +16,4 @@ if 'egg' not in bdist.format_commands: bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") bdist.format_commands.append('egg') -del bdist +del bdist, sys diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 0514adb1..288ca1de 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1588,6 +1588,7 @@ usage: %(script)s [options] requirement_or_url ... with_ei_usage(lambda: setup( script_args = ['-q','easy_install', '-v']+argv, + script_name = sys.argv[0] or 'easy_install', distclass=DistributionWithoutHelpCommands, **kw ) ) @@ -1596,4 +1597,3 @@ usage: %(script)s [options] requirement_or_url ... - diff --git a/setuptools/dist.py b/setuptools/dist.py index 73269574..700c57dc 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -1,4 +1,4 @@ -__all__ = ['Distribution', 'Feature'] +__all__ = ['Distribution'] from distutils.core import Distribution as _Distribution from setuptools.depends import Require @@ -207,7 +207,7 @@ class Distribution(_Distribution): have_package_data = hasattr(self, "package_data") if not have_package_data: self.package_data = {} - self.requires = [] # XXX + self.require_features = [] self.features = {} self.dist_files = [] self.patch_missing_pkg_info(attrs) @@ -676,10 +676,10 @@ class Feature: based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. - 'requires' -- a string or sequence of strings naming features that should - also be included if this feature is included. Defaults to empty list. - May also contain 'Require' objects that should be added/removed from - the distribution. + 'require_features' -- a string or sequence of strings naming features + that should also be included if this feature is included. Defaults to + empty list. May also contain 'Require' objects that should be + added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the @@ -704,34 +704,34 @@ class Feature: Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. """ - def __init__(self, description, standard=False, available=True, - optional=True, requires=(), remove=(), **extras + optional=True, require_features=(), remove=(), **extras ): self.description = description self.standard = standard self.available = available self.optional = optional - if isinstance(requires,(str,Require)): - requires = requires, + if isinstance(require_features,(str,Require)): + require_features = require_features, - self.requires = [r for r in requires if isinstance(r,str)] - er = [r for r in requires if not isinstance(r,str)] - if er: extras['requires'] = er + self.require_features = [ + r for r in require_features if isinstance(r,str) + ] + er = [r for r in require_features if not isinstance(r,str)] + if er: extras['require_features'] = er if isinstance(remove,str): remove = remove, self.remove = remove self.extras = extras - if not remove and not requires and not extras: + if not remove and not require_features and not extras: raise DistutilsSetupError( - "Feature %s: must define 'requires', 'remove', or at least one" + "Feature %s: must define 'require_features', 'remove', or at least one" " of 'packages', 'py_modules', etc." ) - def include_by_default(self): """Should this feature be included by default?""" return self.available and self.standard @@ -754,7 +754,7 @@ class Feature: dist.include(**self.extras) - for f in self.requires: + for f in self.require_features: dist.include_feature(f) diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 14942c61..c269be02 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -255,7 +255,7 @@ class FeatureTests(TestCase): self.req = Require('Distutils','1.0.3','distutils') self.dist = makeSetup( features={ - 'foo': Feature("foo",standard=True,requires=['baz',self.req]), + 'foo': Feature("foo",standard=True,require_features=['baz',self.req]), 'bar': Feature("bar", standard=True, packages=['pkg.bar'], py_modules=['bar_et'], remove=['bar.ext'], ), @@ -281,7 +281,7 @@ class FeatureTests(TestCase): self.failUnless( Feature("test",standard=True,remove='x').include_by_default() ) - # Feature must have either kwargs, removes, or requires + # Feature must have either kwargs, removes, or require_features self.assertRaises(DistutilsSetupError, Feature, "test") def testAvailability(self): @@ -320,7 +320,7 @@ class FeatureTests(TestCase): self.failUnless('scripts/baz_it' in dist.scripts) self.failUnless(('libfoo','foo/foofoo.c') in dist.libraries) self.assertEqual(dist.ext_modules,[]) - self.assertEqual(dist.requires, [self.req]) + self.assertEqual(dist.require_features, [self.req]) # If we ask for bar, it should fail because we explicitly disabled # it on the command line |