From ce5b3c85a28e70a67f1f7d5d8bd43d9d0e2f35d9 Mon Sep 17 00:00:00 2001 From: cliechti Date: Sat, 25 Jul 2009 00:44:23 +0000 Subject: - use 2to3 on the fly when installing for Python 3.x (bdist/install) - update categories - drop support for older Python than 2.2.3 git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@246 f19166aa-fa4f-0410-85c2-fa1106f25c8a --- setup.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ac0d8fd..9a2d657 100644 --- a/setup.py +++ b/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'], ) -- cgit v1.2.1