summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-25 00:44:23 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-25 00:44:23 +0000
commit1eb947dcc63716d2efb0ddecfda12491d80a3ab0 (patch)
tree12721af1e4297d1d01f8b38ad32d043cdb84e948
parent91d247d3f2a859053089d3ed2e3e138291128a5f (diff)
downloadpyserial-git-1eb947dcc63716d2efb0ddecfda12491d80a3ab0.tar.gz
- use 2to3 on the fly when installing for Python 3.x (bdist/install)
- update categories - drop support for older Python than 2.2.3
-rw-r--r--pyserial/setup.py33
1 files changed, 22 insertions, 11 deletions
diff --git a/pyserial/setup.py b/pyserial/setup.py
index ac0d8fd..9a2d657 100644
--- a/pyserial/setup.py
+++ b/pyserial/setup.py
@@ -1,23 +1,24 @@
# setup.py
import sys
+from distutils.core import setup
+
try:
- from setuptools import setup
+ from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
- sys.stdout.write("standard distutils\n")
- from distutils.core import setup
-else:
- sys.stdout.write("setuptools\n")
+ if sys.version_info >= (3, 0):
+ raise ImportError("build_py_2to3 not found in distutils - it is required for Python 3.x")
+ from distutils.command.build_py import build_py
-#windows installer:
-# python setup.py bdist_wininst
+# windows installer:
+# python setup.py bdist_wininst
# patch distutils if it can't cope with the "classifiers" or
# "download_url" keywords
if sys.version < '2.2.3':
- from distutils.dist import DistributionMetadata
- DistributionMetadata.classifiers = None
- DistributionMetadata.download_url = None
+ raise ValueError("Sorry Python versions older than 2.2.3 are no longer"
+ "supported - check http://pyserial.sf.net for older "
+ "releases or upgrade your Python installation.")
setup(
name = "pyserial",
@@ -38,10 +39,20 @@ setup(
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.3',
+ 'Programming Language :: Python :: 2.4',
+ 'Programming Language :: Python :: 2.5',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.0',
+ 'Programming Language :: Python :: 3.1',
'Topic :: Communications',
'Topic :: Software Development :: Libraries',
'Topic :: Terminals :: Serial',
],
platforms = 'any',
- #~ scripts = ['scripts/python-miniterm'],
+ cmdclass = {'build_py': build_py},
+
+ #~ scripts = ['scripts/pyserial-miniterm'],
)