summaryrefslogtreecommitdiff
path: root/setuptools/dist.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-06-12 15:49:54 +0000
committerPJ Eby <distutils-sig@python.org>2005-06-12 15:49:54 +0000
commit18b9ae1e5df8c0c141970c23c9aa0589928655c6 (patch)
tree6ee6ba9440e11e64e98b42d1b9846858f30eaf7c /setuptools/dist.py
parent8f64fbe5e5a016bd88f19d108e126be7c23e757a (diff)
downloadpython-setuptools-git-18b9ae1e5df8c0c141970c23c9aa0589928655c6.tar.gz
Restructure easy_install as a distutils "Command" object, so that it can
access the distutils configuration and logging infrastructure, and can "inherit" options from a distutils setup script that wants to use it to install its own dependencies. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041052
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r--setuptools/dist.py83
1 files changed, 81 insertions, 2 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 4d297c93..a39b4a13 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -1,4 +1,5 @@
__all__ = ['Distribution', 'Feature']
+
from distutils.core import Distribution as _Distribution
from distutils.core import Extension
from setuptools.depends import Require
@@ -7,8 +8,37 @@ from setuptools.command.install import install
from setuptools.command.install_lib import install_lib
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
+
sequence = tuple, list
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
class Distribution(_Distribution):
"""Distribution with support for features, tests, and package data
@@ -54,7 +84,6 @@ class Distribution(_Distribution):
the distribution. They are used by the feature subsystem to configure the
distribution for the included and excluded features.
"""
-
def __init__ (self, attrs=None):
have_package_data = hasattr(self, "package_data")
if not have_package_data:
@@ -83,6 +112,15 @@ class Distribution(_Distribution):
"""Convert feature name to corresponding option attribute name"""
return 'with_'+name.replace('-','_')
+
+
+
+
+
+
+
+
+
def _set_global_opts_from_features(self):
"""Add --with-X/--without-X options based on optional features"""
@@ -277,17 +315,58 @@ class Distribution(_Distribution):
)
map(self.exclude_package, packages)
+
+
+
+
+
+
+
+
+
+
+
def _parse_command_opts(self, parser, args):
# Remove --with-X/--without-X options when processing command args
self.global_options = self.__class__.global_options
self.negative_opt = self.__class__.negative_opt
- return _Distribution._parse_command_opts(self, parser, args)
+
+ # Handle commands that want to consume all remaining arguments
+ command = args[0]
+ nargs = _Distribution._parse_command_opts(self, parser, args)
+
+ cmd_class = self.get_command_class(command)
+ if getattr(cmd_class,'command_consumes_arguments',None):
+ self.get_option_dict(command)['args'] = ("command line", nargs)
+ if nargs is not None:
+ return []
+
+ return nargs
+
def has_dependencies(self):
return not not self.requires
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
def get_cmdline_options(self):
"""Return a '{cmd: {opt:val}}' map of all command-line options