From db677326ebec194b06a139326b886f6e36e482f0 Mon Sep 17 00:00:00 2001 From: Keerthan Jaic Date: Tue, 24 Mar 2015 03:49:56 -0400 Subject: [PATCH] clean up setup.py * Prefer setuptools over distutils * Extend version checking to disallow python 3.0 to 3.3 * Add python version classifiers --- setup.py | 75 +++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/setup.py b/setup.py index 04734079..7a9eaf2f 100644 --- a/setup.py +++ b/setup.py @@ -1,48 +1,41 @@ -""" myhdl's distutils distribution and installation script. """ +""" myhdl's distribution and installation script. """ -from __future__ import print_function import sys -requiredVersion = (2, 6) -requiredVersionStr = ".".join([str(i) for i in requiredVersion]) +if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 4): + raise RuntimeError("Python version 2.6, 2.7 or >= 3.4 required.") -versionError = "ERROR: myhdl requires Python %s or higher" % requiredVersionStr -# use version_info to check version -# this was new in 2.0, so first see if it exists +# Prefer setuptools over distutils try: - sys.version_info -except: - print(versionError) - raise SystemExit(1) + from setuptools import setup +except ImportError: + from distutils.core import setup -if sys.version_info < requiredVersion: - print(versionError) - raise SystemExit(1) - -from distutils.core import setup - -classifiers = """\ -Development Status :: 5 - Production/Stable -Intended Audience :: Developers -License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) -Operating System :: OS Independent -Programming Language :: Python -Topic :: Scientific/Engineering :: Electronic Design Automation (EDA) -""" - - -setup(name="myhdl", - version="0.9", - description="Python as a Hardware Description Language", - long_description = "See home page.", - author="Jan Decaluwe", - author_email="jan@jandecaluwe.com", - url="http://www.myhdl.org", - download_url="https://bitbucket.org/jandecaluwe/myhdl/get/0.8.1.zip", - packages=['myhdl', 'myhdl.conversion'], - license="LGPL", - platforms=["Any"], - keywords="HDL ASIC FPGA hardware design", - classifiers=filter(None, classifiers.split("\n")), - ) +setup( + name="myhdl", + version="0.9.dev0", + description="Python as a Hardware Description Language", + long_description="See home page.", + author="Jan Decaluwe", + author_email="jan@jandecaluwe.com", + url="http://www.myhdl.org", + download_url="https://bitbucket.org/jandecaluwe/myhdl/get/0.8.1.zip", + packages=['myhdl', 'myhdl.conversion'], + license="LGPL", + platforms='any', + keywords="HDL ASIC FPGA hardware design", + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)', + 'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + ] +)