diff options
| author | PJ Eby <distutils-sig@python.org> | 2004-03-20 20:52:12 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2004-03-20 20:52:12 +0000 |
| commit | 7ce55cabc53fe2c1378446ba0557e5f716c0cd31 (patch) | |
| tree | 6ae85cd0c23933ddfa883e131aabd2fe398263be /setuptools/dist.py | |
| parent | 8423e1ed14ac1691c2863c6e8cac9230cf558d7b (diff) | |
| download | python-setuptools-git-7ce55cabc53fe2c1378446ba0557e5f716c0cd31.tar.gz | |
Flesh out 'depends' command to display dependencies' status, and halt if
all requirements aren't met. (Also, check planned install location for
the dependencies, as well as checking sys.path.) Also:
* Allow 'Feature()' objects to include 'Require()' objects, so that
dependencies can be optional
* 'Require()' objects can set a homepage, whose URL will be displayed by
the 'depends' command if the dependency needs to be installed.
* Misc. fixes/refactoring of version validation to properly handle
"unknown" versions, and to decouple version fetching from version
checking.
* Updated TODO to remove various completed items.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4040876
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 2941f26e..cd3af266 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -1,7 +1,7 @@ __all__ = ['Distribution', 'Feature'] - from distutils.core import Distribution as _Distribution from distutils.core import Extension +from setuptools.depends import Require from setuptools.command.build_py import build_py from setuptools.command.build_ext import build_ext from setuptools.command.install import install @@ -11,7 +11,6 @@ from distutils.errors import DistutilsSetupError sequence = tuple, list class Distribution(_Distribution): - """Distribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that @@ -67,7 +66,6 @@ class Distribution(_Distribution): self.cmdclass.setdefault('build_ext',build_ext) self.cmdclass.setdefault('install',install) self.cmdclass.setdefault('install_lib',install_lib) - if self.features: self._set_global_opts_from_features() @@ -288,7 +286,6 @@ class Distribution(_Distribution): class Feature: - """A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: @@ -312,6 +309,8 @@ class Feature: '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. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the @@ -345,15 +344,15 @@ class Feature: self.standard = standard self.available = available self.optional = optional - - if isinstance(requires,str): + if isinstance(requires,(str,Require)): requires = requires, - self.requires = requires + 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 if isinstance(remove,str): remove = remove, - self.remove = remove self.extras = extras @@ -368,7 +367,6 @@ class Feature: """Should this feature be included by default?""" return self.available and self.standard - def include_in(self,dist): """Ensure feature and its requirements are included in distribution |
