[Python-checkins] distutils2: Porting setup.py for Python 3: (original) (raw)
tarek.ziade python-checkins at python.org
Sun Mar 13 19:45:14 CET 2011
- Previous message: [Python-checkins] cpython (2.7): Remove documentation to non-existent function PyObject_CopyToObject (fixes
- Next message: [Python-checkins] distutils2: Ran 2to3 on runtests.py, the resulting changes run clean on Python 2.4+
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
http://hg.python.org/distutils2/rev/6aadad4c1cb3 changeset: 1098:6aadad4c1cb3 parent: 836:a8eaafda8fd3 user: Arc Riley <arcriley at gmail.com> date: Sat Nov 20 14:00:07 2010 -0500 summary: 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
files: setup.py
diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -5,13 +5,20 @@ 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:
- from distutils.command.build_py import build_py_2to3 as build_py
+except ImportError:
2.x
- from distutils.command.build_py import build_py
- f = open('README.txt') try: README = f.read()
@@ -26,7 +33,7 @@ except OSError: return 0 rev = cmd.stdout.read()
- if rev == '':
- if not rev : # there has been an error in the command return 0 return int(rev) @@ -217,7 +224,20 @@ license="PSF", long_description=README, classifiers=_CLASSIFIERS.split('\n'),
packages=find_packages(),
cmdclass={'sdist_hg': sdist_hg, 'install_hg': install_hg},
packages=[
'distutils2',
'distutils2.tests',
'distutils2.compiler',
'distutils2.command',
'distutils2._backport',
'distutils2.index',
'distutils2.tests.fixer',
'distutils2._backport.tests',
],
cmdclass={
'build_py':build_py,
'install_hg': install_hg,
'sdist_hg': sdist_hg,
}, package_data={'distutils2._backport': ['sysconfig.cfg']}, **setup_kwargs)
-- Repository URL: http://hg.python.org/distutils2
- Previous message: [Python-checkins] cpython (2.7): Remove documentation to non-existent function PyObject_CopyToObject (fixes
- Next message: [Python-checkins] distutils2: Ran 2to3 on runtests.py, the resulting changes run clean on Python 2.4+
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]