diff options
Diffstat (limited to 'Lib/setuptools/command')
-rw-r--r-- | Lib/setuptools/command/__init__.py | 2 | ||||
-rwxr-xr-x | Lib/setuptools/command/alias.py | 9 | ||||
-rw-r--r-- | Lib/setuptools/command/bdist_egg.py | 10 | ||||
-rwxr-xr-x | Lib/setuptools/command/bdist_rpm.py | 31 | ||||
-rw-r--r-- | Lib/setuptools/command/build_ext.py | 2 | ||||
-rw-r--r-- | Lib/setuptools/command/build_py.py | 19 | ||||
-rwxr-xr-x | Lib/setuptools/command/develop.py | 11 | ||||
-rwxr-xr-x | Lib/setuptools/command/easy_install.py | 9 | ||||
-rwxr-xr-x | Lib/setuptools/command/egg_info.py | 4 | ||||
-rw-r--r-- | Lib/setuptools/command/install.py | 26 | ||||
-rwxr-xr-x | Lib/setuptools/command/install_egg_info.py | 7 | ||||
-rw-r--r-- | Lib/setuptools/command/install_lib.py | 6 | ||||
-rwxr-xr-x | Lib/setuptools/command/install_scripts.py | 32 | ||||
-rwxr-xr-x | Lib/setuptools/command/rotate.py | 27 | ||||
-rwxr-xr-x | Lib/setuptools/command/saveopts.py | 1 | ||||
-rwxr-xr-x | Lib/setuptools/command/sdist.py | 3 | ||||
-rwxr-xr-x | Lib/setuptools/command/setopt.py | 14 | ||||
-rw-r--r-- | Lib/setuptools/command/test.py | 6 |
18 files changed, 30 insertions, 189 deletions
diff --git a/Lib/setuptools/command/__init__.py b/Lib/setuptools/command/__init__.py index 03bb9dd5b3..bff53e744d 100644 --- a/Lib/setuptools/command/__init__.py +++ b/Lib/setuptools/command/__init__.py @@ -8,7 +8,7 @@ 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 diff --git a/Lib/setuptools/command/alias.py b/Lib/setuptools/command/alias.py index f5368b29e9..1df474a34b 100755 --- a/Lib/setuptools/command/alias.py +++ b/Lib/setuptools/command/alias.py @@ -11,17 +11,17 @@ def shquote(arg): if c in arg: return repr(arg) if arg.split()<>[arg]: return repr(arg) - return arg + return arg class alias(option_base): """Define a shortcut that invokes one or more commands""" - + description = "define a shortcut to invoke one or more commands" command_consumes_arguments = True user_options = [ - ('remove', 'r', 'remove (unset) the alias'), + ('remove', 'r', 'remove (unset) the alias'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] @@ -77,6 +77,3 @@ def format_alias(name, aliases): else: source = '--filename=%r' % source return source+name+' '+command - - - diff --git a/Lib/setuptools/command/bdist_egg.py b/Lib/setuptools/command/bdist_egg.py index 74f2d426b2..617d88d139 100644 --- a/Lib/setuptools/command/bdist_egg.py +++ b/Lib/setuptools/command/bdist_egg.py @@ -233,7 +233,7 @@ class bdist_egg(Command): if self.exclude_source_files: self.zap_pyfiles() - + # Make the archive make_zipfile(self.egg_output, archive_root, verbose=self.verbose, dry_run=self.dry_run) @@ -262,7 +262,7 @@ class bdist_egg(Command): def make_init_files(self): """Create missing package __init__ files""" - init_files = [] + init_files = [] for base,dirs,files in walk_egg(self.bdist_dir): if base==self.bdist_dir: # don't put an __init__ in the root @@ -276,7 +276,7 @@ class bdist_egg(Command): filename = os.path.join(base,'__init__.py') if not self.dry_run: f = open(filename,'w'); f.write(NS_PKG_STUB) - f.close() + f.close() init_files.append(filename) break else: @@ -329,7 +329,7 @@ NATIVE_EXTENSIONS = dict.fromkeys('.dll .so .dylib .pyd'.split()) def walk_egg(egg_dir): """Walk an unpacked egg's contents, skipping the metadata directory""" walker = os.walk(egg_dir) - base,dirs,files = walker.next() + base,dirs,files = walker.next() if 'EGG-INFO' in dirs: dirs.remove('EGG-INFO') yield base,dirs,files @@ -447,5 +447,3 @@ def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0, compress=None): os.path.walk(base_dir, visit, None) return zip_filename - - diff --git a/Lib/setuptools/command/bdist_rpm.py b/Lib/setuptools/command/bdist_rpm.py index 1a0b04843b..00e07acc37 100755 --- a/Lib/setuptools/command/bdist_rpm.py +++ b/Lib/setuptools/command/bdist_rpm.py @@ -35,34 +35,3 @@ class bdist_rpm(_bdist_rpm): ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) return spec - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lib/setuptools/command/build_ext.py b/Lib/setuptools/command/build_ext.py index a4b9047e45..f8551fb49f 100644 --- a/Lib/setuptools/command/build_ext.py +++ b/Lib/setuptools/command/build_ext.py @@ -283,5 +283,3 @@ else: self.create_static_lib( objects, basename, output_dir, debug, target_lang ) - - diff --git a/Lib/setuptools/command/build_py.py b/Lib/setuptools/command/build_py.py index d820710e11..77a9b236c2 100644 --- a/Lib/setuptools/command/build_py.py +++ b/Lib/setuptools/command/build_py.py @@ -93,7 +93,7 @@ class build_py(_build_py): ei_cmd = self.get_finalized_command('egg_info') for path in ei_cmd.filelist.files: if path.endswith('.py'): - continue + continue d,f = os.path.split(assert_relative(path)) prev = None while d and d!=prev and d not in src_dirs: @@ -142,7 +142,7 @@ class build_py(_build_py): f = open(init_py,'rU') if 'declare_namespace' not in f.read(): - from distutils.errors import DistutilsError + from distutils.errors import DistutilsError raise DistutilsError( "Namespace package problem: %s is a namespace package, but its\n" "__init__.py does not call declare_namespace()! Please fix it.\n" @@ -167,7 +167,7 @@ class build_py(_build_py): globs = (self.exclude_package_data.get('', []) + self.exclude_package_data.get(package, [])) bad = [] - for pattern in globs: + for pattern in globs: bad.extend( fnmatch.filter( files, os.path.join(src_dir, convert_path(pattern)) @@ -190,16 +190,3 @@ setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. """ % path ) - - - - - - - - - - - - - diff --git a/Lib/setuptools/command/develop.py b/Lib/setuptools/command/develop.py index f38506bbda..7ab5b23838 100755 --- a/Lib/setuptools/command/develop.py +++ b/Lib/setuptools/command/develop.py @@ -46,7 +46,7 @@ class develop(easy_install): "Please rename %r to %r before using 'develop'" % (ei.egg_info, ei.broken_egg_info) ) - self.args = [ei.egg_name] + self.args = [ei.egg_name] easy_install.finalize_options(self) self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link') self.egg_base = ei.egg_base @@ -104,7 +104,7 @@ class develop(easy_install): # create wrapper scripts in the script dir, pointing to dist.scripts # new-style... - self.install_wrapper_scripts(dist) + self.install_wrapper_scripts(dist) # ...and old-style for script_name in self.distribution.scripts or []: @@ -114,10 +114,3 @@ class develop(easy_install): script_text = f.read() f.close() self.install_script(dist, script_name, script_text, script_path) - - - - - - - diff --git a/Lib/setuptools/command/easy_install.py b/Lib/setuptools/command/easy_install.py index adb99b60a1..3ddcec441f 100755 --- a/Lib/setuptools/command/easy_install.py +++ b/Lib/setuptools/command/easy_install.py @@ -1357,7 +1357,7 @@ class PthDistributions(Environment): """Write changed .pth file back to disk""" if not self.dirty: return - + data = '\n'.join(map(self.make_relative,self.paths)) if data: log.debug("Saving %s", self.filename) @@ -1434,7 +1434,7 @@ def uncache_zipdir(path): del zdc[p] return - + def get_script_args(dist, executable=sys_executable): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) @@ -1553,8 +1553,3 @@ usage: %(script)s [options] requirement_or_url ... distclass=DistributionWithoutHelpCommands, **kw ) ) - - - - - diff --git a/Lib/setuptools/command/egg_info.py b/Lib/setuptools/command/egg_info.py index d9fcd3f09a..b68fb39e12 100755 --- a/Lib/setuptools/command/egg_info.py +++ b/Lib/setuptools/command/egg_info.py @@ -363,7 +363,3 @@ def get_pkg_info_revision(): if match: return int(match.group(1)) return 0 - - - - diff --git a/Lib/setuptools/command/install.py b/Lib/setuptools/command/install.py index 7221b17103..bfb9af5aee 100644 --- a/Lib/setuptools/command/install.py +++ b/Lib/setuptools/command/install.py @@ -60,7 +60,7 @@ class install(_install): caller = sys._getframe(2) caller_module = caller.f_globals.get('__name__','') caller_name = caller.f_code.co_name - + if caller_module != 'distutils.dist' or caller_name!='run_commands': # We weren't called from the command line or setup(), so we # should run in backward-compatibility mode to support bdist_* @@ -68,7 +68,7 @@ class install(_install): _install.run(self) else: self.do_egg_install() - + @@ -99,25 +99,3 @@ class install(_install): cmd.args = args cmd.run() setuptools.bootstrap_install_from = None - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lib/setuptools/command/install_egg_info.py b/Lib/setuptools/command/install_egg_info.py index 4c79f41bb4..193e91a0bb 100755 --- a/Lib/setuptools/command/install_egg_info.py +++ b/Lib/setuptools/command/install_egg_info.py @@ -22,7 +22,7 @@ class install_egg_info(Command): None, None, ei_cmd.egg_name, ei_cmd.egg_version ).egg_name()+'.egg-info' self.source = ei_cmd.egg_info - self.target = os.path.join(self.install_dir, basename) + self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] def run(self): @@ -43,7 +43,7 @@ class install_egg_info(Command): return self.outputs def copytree(self): - # Copy the .egg-info tree to site-packages + # Copy the .egg-info tree to site-packages def skimmer(src,dst): # filter out source-control directories; note that 'src' is always # a '/'-separated path, regardless of platform. 'dst' is a @@ -78,5 +78,4 @@ class install_egg_info(Command): "(p not in mp) and mp.append(p)\n" % locals() ) - f.close() - + f.close() diff --git a/Lib/setuptools/command/install_lib.py b/Lib/setuptools/command/install_lib.py index 82afa1421b..96c8dfeb51 100644 --- a/Lib/setuptools/command/install_lib.py +++ b/Lib/setuptools/command/install_lib.py @@ -74,9 +74,3 @@ class install_lib(_install_lib): if exclude: return [f for f in outputs if f not in exclude] return outputs - - - - - - diff --git a/Lib/setuptools/command/install_scripts.py b/Lib/setuptools/command/install_scripts.py index fc156dcea5..69558bf9a2 100755 --- a/Lib/setuptools/command/install_scripts.py +++ b/Lib/setuptools/command/install_scripts.py @@ -11,7 +11,7 @@ class install_scripts(_install_scripts): def initialize_options(self): _install_scripts.initialize_options(self) self.no_ep = False - + def run(self): self.run_command("egg_info") if self.distribution.scripts: @@ -20,9 +20,9 @@ class install_scripts(_install_scripts): self.outfiles = [] if self.no_ep: # don't install entry point scripts into .egg file! - return + return - ei_cmd = self.get_finalized_command("egg_info") + ei_cmd = self.get_finalized_command("egg_info") dist = Distribution( ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), ei_cmd.egg_name, ei_cmd.egg_version, @@ -54,29 +54,3 @@ class install_scripts(_install_scripts): os.chmod(target,0755) except (AttributeError, os.error): pass - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lib/setuptools/command/rotate.py b/Lib/setuptools/command/rotate.py index 11b6eae82b..8aab312ce1 100755 --- a/Lib/setuptools/command/rotate.py +++ b/Lib/setuptools/command/rotate.py @@ -28,7 +28,7 @@ class rotate(Command): "(e.g. '.zip' or '.egg')" ) if self.keep is None: - raise DistutilsOptionError("Must specify number of files to keep") + raise DistutilsOptionError("Must specify number of files to keep") try: self.keep = int(self.keep) except ValueError: @@ -55,28 +55,3 @@ class rotate(Command): log.info("Deleting %s", f) if not self.dry_run: os.unlink(f) - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lib/setuptools/command/saveopts.py b/Lib/setuptools/command/saveopts.py index 1180a440c9..9c58d72e44 100755 --- a/Lib/setuptools/command/saveopts.py +++ b/Lib/setuptools/command/saveopts.py @@ -22,4 +22,3 @@ class saveopts(option_base): settings.setdefault(cmd,{})[opt] = val edit_config(self.filename, settings, self.dry_run) - diff --git a/Lib/setuptools/command/sdist.py b/Lib/setuptools/command/sdist.py index 6026a7c2ed..829cd3c57e 100755 --- a/Lib/setuptools/command/sdist.py +++ b/Lib/setuptools/command/sdist.py @@ -144,7 +144,7 @@ class sdist(_sdist): self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt')) self.check_metadata() - self.make_distribution() + self.make_distribution() dist_files = getattr(self.distribution,'dist_files',[]) for file in self.archive_files: @@ -161,4 +161,3 @@ class sdist(_sdist): # dying and thus masking the real error sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() raise - diff --git a/Lib/setuptools/command/setopt.py b/Lib/setuptools/command/setopt.py index dbf3a94ec1..e0c1058f38 100755 --- a/Lib/setuptools/command/setopt.py +++ b/Lib/setuptools/command/setopt.py @@ -82,7 +82,7 @@ def edit_config(filename, settings, dry_run=False): class option_base(Command): """Abstract base class for commands that mess with config files""" - + user_options = [ ('global-config', 'g', "save options to the site-wide distutils.cfg file"), @@ -94,7 +94,7 @@ class option_base(Command): boolean_options = [ 'global-config', 'user-config', - ] + ] def initialize_options(self): self.global_config = None @@ -116,7 +116,7 @@ class option_base(Command): "Must specify only one configuration file option", filenames ) - self.filename, = filenames + self.filename, = filenames @@ -130,7 +130,7 @@ class setopt(option_base): ('command=', 'c', 'command to set an option for'), ('option=', 'o', 'option to set'), ('set-value=', 's', 'value of the option'), - ('remove', 'r', 'remove (unset) the value'), + ('remove', 'r', 'remove (unset) the value'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] @@ -156,9 +156,3 @@ class setopt(option_base): }, self.dry_run ) - - - - - - diff --git a/Lib/setuptools/command/test.py b/Lib/setuptools/command/test.py index 83589fa922..01fca35f09 100644 --- a/Lib/setuptools/command/test.py +++ b/Lib/setuptools/command/test.py @@ -88,7 +88,7 @@ class test(Command): self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') - if self.distribution.tests_require: + if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) if self.test_suite: @@ -117,7 +117,3 @@ class test(Command): None, None, [unittest.__file__]+self.test_args, testLoader = loader_class() ) - - - - |