[Python-checkins] r45554 - in sandbox/trunk/setuptools: _pkgutil.py easy_install.py pkg_resources.py setuptools/init.py setuptools/archive_util.py setuptools/command/init.py setuptools/command/alias.py setuptools/command/bdist_egg.py setuptools/command/bdist_rpm.py setuptools/command/build_ext.py setuptools/command/build_py.py setuptools/command/develop.py setuptools/command/easy_install.py setuptools/command/egg_info.py setuptools/command/install.py setuptools/command/install_egg_info.py setuptools/command/install_lib.py setuptools/command/install_scripts.py setuptools/command/rotate.py setuptools/command/saveopts.py setuptools/command/sdist.py setuptools/command/setopt.py setuptools/command/test.py setuptools/depends.py setuptools/dist.py setuptools/extension.py setuptools/package_index.py setuptools/sandbox.py setuptools/site-patch.py setuptools/tests/init.py setuptools/tests/test_resources.py (original) (raw)

phillip.eby python-checkins at python.org
Wed Apr 19 02:13:25 CEST 2006


Author: phillip.eby Date: Wed Apr 19 02:13:21 2006 New Revision: 45554

Modified: sandbox/trunk/setuptools/_pkgutil.py sandbox/trunk/setuptools/easy_install.py sandbox/trunk/setuptools/pkg_resources.py sandbox/trunk/setuptools/setuptools/init.py sandbox/trunk/setuptools/setuptools/archive_util.py sandbox/trunk/setuptools/setuptools/command/init.py sandbox/trunk/setuptools/setuptools/command/alias.py sandbox/trunk/setuptools/setuptools/command/bdist_egg.py sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py sandbox/trunk/setuptools/setuptools/command/build_ext.py sandbox/trunk/setuptools/setuptools/command/build_py.py sandbox/trunk/setuptools/setuptools/command/develop.py sandbox/trunk/setuptools/setuptools/command/easy_install.py sandbox/trunk/setuptools/setuptools/command/egg_info.py sandbox/trunk/setuptools/setuptools/command/install.py sandbox/trunk/setuptools/setuptools/command/install_egg_info.py sandbox/trunk/setuptools/setuptools/command/install_lib.py sandbox/trunk/setuptools/setuptools/command/install_scripts.py sandbox/trunk/setuptools/setuptools/command/rotate.py sandbox/trunk/setuptools/setuptools/command/saveopts.py sandbox/trunk/setuptools/setuptools/command/sdist.py sandbox/trunk/setuptools/setuptools/command/setopt.py sandbox/trunk/setuptools/setuptools/command/test.py sandbox/trunk/setuptools/setuptools/depends.py sandbox/trunk/setuptools/setuptools/dist.py sandbox/trunk/setuptools/setuptools/extension.py sandbox/trunk/setuptools/setuptools/package_index.py sandbox/trunk/setuptools/setuptools/sandbox.py sandbox/trunk/setuptools/setuptools/site-patch.py sandbox/trunk/setuptools/setuptools/tests/init.py sandbox/trunk/setuptools/setuptools/tests/test_resources.py Log: Backport whitespace normalization from 2.5 trunk.

Modified: sandbox/trunk/setuptools/_pkgutil.py

--- sandbox/trunk/setuptools/_pkgutil.py (original) +++ sandbox/trunk/setuptools/_pkgutil.py Wed Apr 19 02:13:21 2006 @@ -44,7 +44,7 @@ class cls(cls,object): pass mro = cls.mro[1:] except TypeError: - mro = object, # must be an ExtensionClass or some such :(
+ mro = object, # must be an ExtensionClass or some such :( for t in mro: if t in registry: return registryt @@ -64,7 +64,7 @@ wrapper.dict = func.dict wrapper.doc = func.doc wrapper.register = register - return wrapper
+ return wrapper def walk_packages(path=None, prefix='', onerror=None): @@ -160,7 +160,7 @@ modname = inspect.getmodulename(fn) if modname=='init' or modname in yielded: continue

@@ -276,7 +276,7 @@ try: import zipimport from zipimport import zipimporter

Modified: sandbox/trunk/setuptools/easy_install.py

--- sandbox/trunk/setuptools/easy_install.py (original) +++ sandbox/trunk/setuptools/easy_install.py Wed Apr 19 02:13:21 2006 @@ -3,4 +3,3 @@ if name == 'main': from setuptools.command.easy_install import main main()

Modified: sandbox/trunk/setuptools/pkg_resources.py

--- sandbox/trunk/setuptools/pkg_resources.py (original) +++ sandbox/trunk/setuptools/pkg_resources.py Wed Apr 19 02:13:21 2006 @@ -58,7 +58,7 @@ # Exceptions 'ResolutionError','VersionConflict','DistributionNotFound','UnknownExtra', 'ExtractionError',

@@ -823,7 +823,7 @@ old_exc = sys.exc_info()[1] cache_path = self.extraction_path or get_default_cache()

@@ -878,7 +878,7 @@ ensure_directory(target_path) except: self.extraction_error()

@@ -1264,11 +1264,11 @@ try: rename(tmpnam, real_path)

@@ -2375,4 +2375,3 @@ # calling require()) will get activated as well. add_activation_listener(lambda dist: dist.activate()) working_set.entries=[]; map(working_set.add_entry,sys.path) # match order

Modified: sandbox/trunk/setuptools/setuptools/init.py

--- sandbox/trunk/setuptools/setuptools/init.py (original) +++ sandbox/trunk/setuptools/setuptools/init.py Wed Apr 19 02:13:21 2006 @@ -40,7 +40,7 @@ return out setup = distutils.core.setup

@@ -53,7 +53,7 @@ _Command.init(self,dist) for k,v in kw.items(): setattr(self,k,v)

@@ -62,21 +62,3 @@ import distutils.core distutils.core.Command = Command # we can't patch distutils.cmd, alas

Modified: sandbox/trunk/setuptools/setuptools/archive_util.py

--- sandbox/trunk/setuptools/setuptools/archive_util.py (original) +++ sandbox/trunk/setuptools/setuptools/archive_util.py Wed Apr 19 02:13:21 2006 @@ -14,7 +14,7 @@ """Couldn't recognize the archive type""" def default_filter(src,dst): - """The default progress/filter callback; returns True for all files"""
+ """The default progress/filter callback; returns True for all files""" return dst @@ -184,7 +184,7 @@ name = member.name # don't extract absolute paths or ones with .. in them if not name.startswith('/') and '..' not in name: - dst = os.path.join(extract_dir, *name.split('/'))
+ dst = os.path.join(extract_dir, *name.split('/')) dst = progress_filter(name, dst) if dst: if dst.endswith(os.sep): @@ -198,8 +198,3 @@ extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile

Modified: sandbox/trunk/setuptools/setuptools/command/init.py

--- sandbox/trunk/setuptools/setuptools/command/init.py (original) +++ sandbox/trunk/setuptools/setuptools/command/init.py Wed Apr 19 02:13:21 2006 @@ -8,7 +8,7 @@ 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

Modified: sandbox/trunk/setuptools/setuptools/command/alias.py

--- sandbox/trunk/setuptools/setuptools/command/alias.py (original) +++ sandbox/trunk/setuptools/setuptools/command/alias.py Wed Apr 19 02:13:21 2006 @@ -11,17 +11,17 @@ 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"""

@@ -77,6 +77,3 @@ else: source = '--filename=%r' % source return source+name+' '+command

Modified: sandbox/trunk/setuptools/setuptools/command/bdist_egg.py

--- sandbox/trunk/setuptools/setuptools/command/bdist_egg.py (original) +++ sandbox/trunk/setuptools/setuptools/command/bdist_egg.py Wed Apr 19 02:13:21 2006 @@ -233,7 +233,7 @@ if self.exclude_source_files: self.zap_pyfiles()

@@ -262,7 +262,7 @@ 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 @@ 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 @@ 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 @@ os.path.walk(base_dir, visit, None) return zip_filename

Modified: sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py

--- sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py (original) +++ sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py Wed Apr 19 02:13:21 2006 @@ -35,34 +35,3 @@ ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) return spec

Modified: sandbox/trunk/setuptools/setuptools/command/build_ext.py

--- sandbox/trunk/setuptools/setuptools/command/build_ext.py (original) +++ sandbox/trunk/setuptools/setuptools/command/build_ext.py Wed Apr 19 02:13:21 2006 @@ -283,5 +283,3 @@ self.create_static_lib( objects, basename, output_dir, debug, target_lang )

Modified: sandbox/trunk/setuptools/setuptools/command/build_py.py

--- sandbox/trunk/setuptools/setuptools/command/build_py.py (original) +++ sandbox/trunk/setuptools/setuptools/command/build_py.py Wed Apr 19 02:13:21 2006 @@ -93,7 +93,7 @@ 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 @@ 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 @@ 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.py directory, never absolute paths. """ % path )

Modified: sandbox/trunk/setuptools/setuptools/command/develop.py

Modified: sandbox/trunk/setuptools/setuptools/command/easy_install.py

--- sandbox/trunk/setuptools/setuptools/command/easy_install.py (original) +++ sandbox/trunk/setuptools/setuptools/command/easy_install.py Wed Apr 19 02:13:21 2006 @@ -1357,7 +1357,7 @@ """Write changed .pth file back to disk""" if not self.dirty: return

@@ -1434,7 +1434,7 @@ del zdc[p] return

@@ -1553,8 +1553,3 @@ distclass=DistributionWithoutHelpCommands, **kw ) )

Modified: sandbox/trunk/setuptools/setuptools/command/egg_info.py

--- sandbox/trunk/setuptools/setuptools/command/egg_info.py (original) +++ sandbox/trunk/setuptools/setuptools/command/egg_info.py Wed Apr 19 02:13:21 2006 @@ -363,7 +363,3 @@ if match: return int(match.group(1)) return 0

Modified: sandbox/trunk/setuptools/setuptools/command/install.py

--- sandbox/trunk/setuptools/setuptools/command/install.py (original) +++ sandbox/trunk/setuptools/setuptools/command/install.py Wed Apr 19 02:13:21 2006 @@ -60,7 +60,7 @@ caller = sys._getframe(2) caller_module = caller.f_globals.get('name','') caller_name = caller.f_code.co_name

@@ -68,7 +68,7 @@ _install.run(self) else: self.do_egg_install()

@@ -99,25 +99,3 @@ cmd.args = args cmd.run() setuptools.bootstrap_install_from = None

Modified: sandbox/trunk/setuptools/setuptools/command/install_egg_info.py

--- sandbox/trunk/setuptools/setuptools/command/install_egg_info.py (original) +++ sandbox/trunk/setuptools/setuptools/command/install_egg_info.py Wed Apr 19 02:13:21 2006 @@ -22,7 +22,7 @@ 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 @@ 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 @@ "(p not in mp) and mp.append(p)\n" % locals() ) - f.close()

Modified: sandbox/trunk/setuptools/setuptools/command/install_lib.py

--- sandbox/trunk/setuptools/setuptools/command/install_lib.py (original) +++ sandbox/trunk/setuptools/setuptools/command/install_lib.py Wed Apr 19 02:13:21 2006 @@ -74,9 +74,3 @@ if exclude: return [f for f in outputs if f not in exclude] return outputs

Modified: sandbox/trunk/setuptools/setuptools/command/install_scripts.py

--- sandbox/trunk/setuptools/setuptools/command/install_scripts.py (original) +++ sandbox/trunk/setuptools/setuptools/command/install_scripts.py Wed Apr 19 02:13:21 2006 @@ -11,7 +11,7 @@ def initialize_options(self): _install_scripts.initialize_options(self) self.no_ep = False

@@ -20,9 +20,9 @@ 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 @@ os.chmod(target,0755) except (AttributeError, os.error): pass

Modified: sandbox/trunk/setuptools/setuptools/command/rotate.py

--- sandbox/trunk/setuptools/setuptools/command/rotate.py (original) +++ sandbox/trunk/setuptools/setuptools/command/rotate.py Wed Apr 19 02:13:21 2006 @@ -28,7 +28,7 @@ "(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 @@ log.info("Deleting %s", f) if not self.dry_run: os.unlink(f)

Modified: sandbox/trunk/setuptools/setuptools/command/saveopts.py

--- sandbox/trunk/setuptools/setuptools/command/saveopts.py (original) +++ sandbox/trunk/setuptools/setuptools/command/saveopts.py Wed Apr 19 02:13:21 2006 @@ -22,4 +22,3 @@ settings.setdefault(cmd,{})[opt] = val edit_config(self.filename, settings, self.dry_run)

Modified: sandbox/trunk/setuptools/setuptools/command/sdist.py

--- sandbox/trunk/setuptools/setuptools/command/sdist.py (original) +++ sandbox/trunk/setuptools/setuptools/command/sdist.py Wed Apr 19 02:13:21 2006 @@ -144,7 +144,7 @@ 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 @@ # dying and thus masking the real error sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() raise

Modified: sandbox/trunk/setuptools/setuptools/command/setopt.py

--- sandbox/trunk/setuptools/setuptools/command/setopt.py (original) +++ sandbox/trunk/setuptools/setuptools/command/setopt.py Wed Apr 19 02:13:21 2006 @@ -82,7 +82,7 @@ class option_base(Command): """Abstract base class for commands that mess with config files"""

@@ -94,7 +94,7 @@ boolean_options = [ 'global-config', 'user-config', - ]
+ ] def initialize_options(self): self.global_config = None @@ -116,7 +116,7 @@ "Must specify only one configuration file option", filenames ) - self.filename, = filenames
+ self.filename, = filenames @@ -130,7 +130,7 @@ ('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 @@ }, self.dry_run )

Modified: sandbox/trunk/setuptools/setuptools/command/test.py

--- sandbox/trunk/setuptools/setuptools/command/test.py (original) +++ sandbox/trunk/setuptools/setuptools/command/test.py Wed Apr 19 02:13:21 2006 @@ -88,7 +88,7 @@ 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 @@ None, None, [unittest.file]+self.test_args, testLoader = loader_class() )

Modified: sandbox/trunk/setuptools/setuptools/depends.py

--- sandbox/trunk/setuptools/setuptools/depends.py (original) +++ sandbox/trunk/setuptools/setuptools/depends.py Wed Apr 19 02:13:21 2006 @@ -237,10 +237,3 @@ return const else: const = default

Modified: sandbox/trunk/setuptools/setuptools/dist.py

--- sandbox/trunk/setuptools/setuptools/dist.py (original) +++ sandbox/trunk/setuptools/setuptools/dist.py Wed Apr 19 02:13:21 2006 @@ -796,25 +796,3 @@ " doesn't contain any packages or modules under %s" % (self.description, item, item) )

Modified: sandbox/trunk/setuptools/setuptools/extension.py

--- sandbox/trunk/setuptools/setuptools/extension.py (original) +++ sandbox/trunk/setuptools/setuptools/extension.py Wed Apr 19 02:13:21 2006 @@ -14,7 +14,7 @@ """Extension that uses '.c' files in place of '.pyx' files""" if not have_pyrex: - # convert .pyx extensions to .c + # convert .pyx extensions to .c def init(self,*args,**kw): _Extension.init(self,*args,**kw) sources = [] @@ -33,4 +33,3 @@ distutils.extension.Extension = Extension if 'distutils.command.build_ext' in sys.modules: sys.modules['distutils.command.build_ext'].Extension = Extension

Modified: sandbox/trunk/setuptools/setuptools/package_index.py

--- sandbox/trunk/setuptools/setuptools/package_index.py (original) +++ sandbox/trunk/setuptools/setuptools/package_index.py Wed Apr 19 02:13:21 2006 @@ -260,7 +260,7 @@ def find_packages(self, requirement): self.scan_url(self.index_url + requirement.unsafe_name+'/')

@@ -489,7 +489,7 @@ "Can't process plain .py files without an '#egg=name-version'" " suffix to enable automatic setup script generation." )

@@ -672,26 +672,3 @@ # DNS-bl0ck1n9 f1r3w4llz sUx0rs! _sf_mirrors[:] = ['dl.sourceforge.net'] return random.choice(_sf_mirrors)

Modified: sandbox/trunk/setuptools/setuptools/sandbox.py

--- sandbox/trunk/setuptools/setuptools/sandbox.py (original) +++ sandbox/trunk/setuptools/setuptools/sandbox.py Wed Apr 19 02:13:21 2006 @@ -201,5 +201,3 @@ support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available.""" % self.args

Modified: sandbox/trunk/setuptools/setuptools/site-patch.py

--- sandbox/trunk/setuptools/setuptools/site-patch.py (original) +++ sandbox/trunk/setuptools/setuptools/site-patch.py Wed Apr 19 02:13:21 2006 @@ -1,5 +1,5 @@ def __boot(): - import sys, imp, os, os.path
+ import sys, imp, os, os.path PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] @@ -48,7 +48,7 @@ addsitedir(item) sys.__egginsert += oldpos # restore effective old position

@@ -66,17 +66,9 @@ # new path after the insert point, back-insert it new_path.insert(insert_at, item) insert_at += 1

-if name=='site':
+if name=='site': __boot() del __boot

Modified: sandbox/trunk/setuptools/setuptools/tests/init.py

--- sandbox/trunk/setuptools/setuptools/tests/init.py (original) +++ sandbox/trunk/setuptools/setuptools/tests/init.py Wed Apr 19 02:13:21 2006 @@ -362,8 +362,3 @@ ts5 = makeSetup().get_command_obj('test') ts5.ensure_finalized() self.assertEqual(ts5.test_suite, None)

Modified: sandbox/trunk/setuptools/setuptools/tests/test_resources.py

--- sandbox/trunk/setuptools/setuptools/tests/test_resources.py (original) +++ sandbox/trunk/setuptools/setuptools/tests/test_resources.py Wed Apr 19 02:13:21 2006 @@ -143,7 +143,7 @@ self.assertRaises(VersionConflict, ws.resolve, parse_requirements("Foo==0.9"), ad) ws = WorkingSet([]) # reset

@@ -161,7 +161,7 @@ self.assertRaises( VersionConflict, ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad )

@@ -481,12 +481,3 @@ for p,v1 in enumerate(torture): for v2 in torture[p+1:]: c(v2,v1)



More information about the Python-checkins mailing list