distutils2: 6aadad4c1cb3 (original) (raw)
Mercurial > distutils2
changeset 1098:6aadad4c1cb3
Porting setup.py for Python 3: * use either build_py or build_py_2to3 based on Python version for automatic 2to3 * replaced find_packages() with static package list since distutils2.utils can't be ported to Py3 before setup.py is run * replaced "if rev == ''" with "if not rev" to avoid bytes vs string issue on Py3
Arc Riley arcriley@gmail.com | |
---|---|
date | Sat, 20 Nov 2010 14:00:07 -0500 |
parents | a8eaafda8fd3 |
children | 001ff262c405 |
files | setup.py |
diffstat | 1 files changed, 24 insertions(+), 4 deletions(-)[+] [-] setup.py 28 |
line wrap: on
line diff
--- a/setup.py +++ b/setup.py @@ -5,13 +5,20 @@ import os import re from distutils2 import version as VERSION -from distutils2.util import find_packages from distutils import log from distutils.core import setup, Extension from distutils.ccompiler import new_compiler from distutils.command.sdist import sdist from distutils.command.install import install +# Python 3.x hook to run 2to3 automatically +try:
+ + f = open('README.txt') try: README = f.read() @@ -26,7 +33,7 @@ def get_tip_revision(path=os.getcwd()): except OSError: return 0 rev = cmd.stdout.read()
- if not rev : # there has been an error in the command return 0 return int(rev) @@ -217,7 +224,20 @@ setup(name="Distutils2", license="PSF", long_description=README, classifiers=_CLASSIFIERS.split('\n'),
packages=find_packages(),[](#l1.38)
cmdclass={'sdist_hg': sdist_hg, 'install_hg': install_hg},[](#l1.39)
packages=[[](#l1.40)
'distutils2',[](#l1.41)
'distutils2.tests', [](#l1.42)
'distutils2.compiler', [](#l1.43)
'distutils2.command', [](#l1.44)
'distutils2._backport', [](#l1.45)
'distutils2.index', [](#l1.46)
'distutils2.tests.fixer', [](#l1.47)
'distutils2._backport.tests',[](#l1.48)
],[](#l1.49)
cmdclass={[](#l1.50)
'build_py':build_py, [](#l1.51)
'install_hg': install_hg,[](#l1.52)
'sdist_hg': sdist_hg, [](#l1.53)
},[](#l1.54) package_data={'distutils2._backport': ['sysconfig.cfg']},[](#l1.55) **setup_kwargs)[](#l1.56)