From 8a29467d941a7983d5f6eadc5c0e1624417944b6 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 6 Aug 2005 18:46:28 +0000 Subject: Enhanced setuptools infrastructure to support distutils extensions that can be plugged in at setup() time to define new setup() arguments or distutils commands. This allows modularization and reuse of distutils extensions in a way that was previously not possible. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041180 --- setuptools/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'setuptools/__init__.py') diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 05c4a73e..eeb2975b 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -1,6 +1,6 @@ """Extensions to the 'distutils' for large or complex distributions""" +from setuptools.dist import Distribution, Feature, _get_unpatched import distutils.core, setuptools.command -from setuptools.dist import Distribution, Feature from setuptools.extension import Extension from setuptools.depends import Require from distutils.core import Command as _Command @@ -39,17 +39,9 @@ def find_packages(where='.', exclude=()): out = [item for item in out if not fnmatchcase(item,pat)] return out -def setup(**attrs): - """Do package setup - - This function takes the same arguments as 'distutils.core.setup()', except - that the default distribution class is 'setuptools.dist.Distribution'. See - that class' documentation for details on the new keyword arguments that it - makes available via this function. - """ - attrs.setdefault("distclass",Distribution) - return distutils.core.setup(**attrs) +setup = distutils.core.setup +_Command = _get_unpatched(_Command) class Command(_Command): __doc__ = _Command.__doc__ @@ -68,6 +60,14 @@ class Command(_Command): setattr(cmd,k,v) # update command with keywords return cmd +import distutils.core +distutils.core.Command = Command # we can't patch distutils.cmd, alas + + + + + + -- cgit v1.2.1