diff options
author | tarek <none@none> | 2009-10-14 19:53:59 +0200 |
---|---|---|
committer | tarek <none@none> | 2009-10-14 19:53:59 +0200 |
commit | 87213900312e662b805b2956d179a81521029487 (patch) | |
tree | 892ec139c2d3568a0fdb5d2c57e815ae043b09de | |
parent | f35ccfd8afd630d3b3445fa74ee6fde4edd5ee3e (diff) | |
download | external_python_setuptools-87213900312e662b805b2956d179a81521029487.tar.gz external_python_setuptools-87213900312e662b805b2956d179a81521029487.tar.bz2 external_python_setuptools-87213900312e662b805b2956d179a81521029487.zip |
Now cli.exe and gui.exe are generated at build time - win_script_wrapper.txt covers this case - refs #65
--HG--
branch : distribute
extra : rebase_source : 940bcb596a59153bc62056328b75cb670fa44273
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | distribute.egg-info/entry_points.txt | 2 | ||||
-rwxr-xr-x | setup.py | 36 |
3 files changed, 36 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 88dd59b1..c9f1713e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,9 @@ CHANGES 0.6.5 ----- +* Issue 65: cli.exe and gui.exe are not generated at build time, + depending on the platform in use. + * Issue 67: Fixed doc typo (PEP 381/382) * Distribute no longer shadows setuptools if we require a 0.7-series diff --git a/distribute.egg-info/entry_points.txt b/distribute.egg-info/entry_points.txt index 0aaa28c0..f4b74da0 100644 --- a/distribute.egg-info/entry_points.txt +++ b/distribute.egg-info/entry_points.txt @@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete [console_scripts] easy_install = setuptools.command.easy_install:main -easy_install-2.5 = setuptools.command.easy_install:main +easy_install-2.6 = setuptools.command.easy_install:main [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl @@ -1,7 +1,8 @@ #!/usr/bin/env python """Distutils setup file, used to install or test 'setuptools'""" - -import sys, os +import sys +import os +import platform src_root = None if sys.version_info >= (3,): @@ -39,10 +40,36 @@ SETUP_COMMANDS = d['__all__'] VERSION = "0.6.5" from setuptools import setup, find_packages -import os -import sys +from setuptools.command.build_py import build_py as _build_py scripts = [] +# specific command that is used to generate windows .exe files +class build_py(_build_py): + def build_package_data(self): + """Copy data files into build directory""" + lastdir = None + is_64 = platform.architecture()[0] == '64bit' + + for package, src_dir, build_dir, filenames in self.data_files: + for filename in filenames: + target = os.path.join(build_dir, filename) + self.mkpath(os.path.dirname(target)) + srcfile = os.path.join(src_dir, filename) + outf, copied = self.copy_file(srcfile, target) + + # creating cli.exe and gui.exe + if filename in ('gui-32.exe', 'cli-32.exe') and not is_64: + exe_target = os.path.join(build_dir, filename.replace('-32.exe', '.exe')) + self.copy_file(srcfile, exe_target) + + if filename in ('gui-64.exe', 'cli-64.exe') and is_64: + exe_target = os.path.join(build_dir, filename.replace('-64.exe', '.exe')) + self.copy_file(srcfile, exe_target) + + srcfile = os.path.abspath(srcfile) + if copied and srcfile in self.distribution.convert_2to3_doctests: + self.__doctests_2to3.append(outf) + # if we are installing Distribute using "python setup.py install" # we need to get setuptools out of the way def _easy_install_marker(): @@ -149,6 +176,7 @@ dist = setup( Topic :: System :: Systems Administration Topic :: Utilities""".splitlines() if f.strip()], scripts = scripts, + cmdclass = {'build_py': build_py} ) if _being_installed(): |