diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools/command/build_ext.py setuptools-0.7a1dev-r66/setuptools/command/build_ext.py --- orig/setuptools-0.7a1dev-r66/setuptools/command/build_ext.py 2009-03-14 23:30:55.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools/command/build_ext.py 2009-09-08 14:23:24.000000000 +0200 @@ -111,6 +111,9 @@ for ext in self.extensions: fullname = ext._full_name self.ext_map[fullname] = ext + # distutils 3.1 will also ask for module names + # XXX what to do with conflicts? + self.ext_map[fullname.split('.')[-1]] = ext ltd = ext._links_to_dynamic = \ self.shlibs and self.links_to_dynamic(ext) or False ext._needs_stub = ltd and use_stubs and not isinstance(ext,Library) diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools/command/build_py.py setuptools-0.7a1dev-r66/setuptools/command/build_py.py --- orig/setuptools-0.7a1dev-r66/setuptools/command/build_py.py 2009-03-14 23:30:55.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools/command/build_py.py 2009-09-08 14:23:24.000000000 +0200 @@ -3,7 +3,15 @@ from distutils.util import convert_path from glob import glob -class build_py(_build_py): +try: + from distutils.util import Mixin2to3 +except ImportError: + class Mixin2to3: + def run_2to3(self, files): + # Nothing done in 2.x + pass + +class build_py(_build_py, Mixin2to3): """Enhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. @@ -23,6 +31,7 @@ if not self.py_modules and not self.packages: return + self.updated_files = [] if self.py_modules: self.build_modules() @@ -30,10 +39,21 @@ self.build_packages() self.build_package_data() + # 2to3 + if self.with_2to3: + self.run_2to3(self.updated_files) + # Only compile actual .py files, using our base class' idea of what our # output files are. self.byte_compile(_build_py.get_outputs(self, include_bytecode=0)) + def build_module(self, module, module_file, package): + res = _build_py.build_module(self, module, module_file, package) + if res[1]: + # file was copied + self.updated_files.append(res[0]) + return res + def __getattr__(self,attr): if attr=='data_files': # lazily compute data files self.data_files = files = self._get_data_files(); return files @@ -154,6 +174,7 @@ def initialize_options(self): self.packages_checked={} + self.with_2to3 = False _build_py.initialize_options(self) diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools/command/easy_install.py setuptools-0.7a1dev-r66/setuptools/command/easy_install.py --- orig/setuptools-0.7a1dev-r66/setuptools/command/easy_install.py 2009-03-14 23:31:20.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools/command/easy_install.py 2009-09-08 14:23:24.000000000 +0200 @@ -607,7 +607,7 @@ "import pkg_resources\n" "pkg_resources.run_script(%(spec)r, %(script_name)r)\n" ) % locals() - self.write_script(script_name, script_text, 'b') + self.write_script(script_name, script_text.encode('ascii'), 'b') def write_script(self, script_name, contents, mode="t", blockers=()): """Write an executable file to the scripts directory""" diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools/command/egg_info.py setuptools-0.7a1dev-r66/setuptools/command/egg_info.py --- orig/setuptools-0.7a1dev-r66/setuptools/command/egg_info.py 2009-03-14 23:31:21.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools/command/egg_info.py 2009-09-08 14:23:24.000000000 +0200 @@ -326,8 +326,63 @@ if not msg.startswith("standard file not found:"): sdist.warn(self, msg) + # 2.6 version of add_defaults + def sdist_add_defaults (self): + """Add all the default files to self.filelist: + - README or README.txt + - setup.py + - test/test*.py + - all pure Python modules mentioned in setup script + - all C sources listed as part of extensions or C libraries + in the setup script (doesn't catch C headers!) + Warns if (README or README.txt) or setup.py are missing; everything + else is optional. + """ + from glob import glob + standards = [('README', 'README.txt'), self.distribution.script_name] + for fn in standards: + if type(fn) is tuple: + alts = fn + got_it = 0 + for fn in alts: + if os.path.exists(fn): + got_it = 1 + self.filelist.append(fn) + break + + if not got_it: + self.warn("standard file not found: should have one of " + + string.join(alts, ', ')) + else: + if os.path.exists(fn): + self.filelist.append(fn) + else: + self.warn("standard file '%s' not found" % fn) + + optional = ['test/test*.py', 'setup.cfg'] + for pattern in optional: + files = filter(os.path.isfile, glob(pattern)) + if files: + self.filelist.extend(files) + + if self.distribution.has_pure_modules(): + build_py = self.get_finalized_command('build_py') + self.filelist.extend(build_py.get_source_files()) + + if self.distribution.has_ext_modules(): + build_ext = self.get_finalized_command('build_ext') + self.filelist.extend(build_ext.get_source_files()) + + if self.distribution.has_c_libraries(): + build_clib = self.get_finalized_command('build_clib') + self.filelist.extend(build_clib.get_source_files()) + + if self.distribution.has_scripts(): + build_scripts = self.get_finalized_command('build_scripts') + self.filelist.extend(build_scripts.get_source_files()) + def add_defaults(self): - sdist.add_defaults(self) + self.sdist_add_defaults() self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools/command/sdist.py setuptools-0.7a1dev-r66/setuptools/command/sdist.py --- orig/setuptools-0.7a1dev-r66/setuptools/command/sdist.py 2009-03-14 23:30:55.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools/command/sdist.py 2009-09-08 14:23:24.000000000 +0200 @@ -59,7 +59,7 @@ def externals_finder(dirname, filename): """Find any 'svn:externals' directories""" found = False - f = open(filename,'rb') + f = open(filename,'r', encoding="utf-8") for line in iter(f.readline, ''): # can't use direct iter! parts = line.split() if len(parts)==2: diff -ur -x '*.pyc' -x '*~' -x build -x dist -x install.sh orig/setuptools-0.7a1dev-r66/setuptools.egg-info/entry_points.txt setuptools-0.7a1dev-r66/setuptools.egg-info/entry_points.txt --- orig/setuptools-0.7a1dev-r66/setuptools.egg-info/entry_points.txt 2009-03-14 23:32:18.000000000 +0100 +++ setuptools-0.7a1dev-r66/setuptools.egg-info/entry_points.txt 2009-09-10 03:57:14.000000000 +0200 @@ -31,7 +31,7 @@ [console_scripts] easy_install = setuptools.command.easy_install:main -easy_install-3.0 = setuptools.command.easy_install:main +easy_install-3.1 = setuptools.command.easy_install:main [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl