Aaron Iles | c18d694 | 2013-01-06 13:12:00 +1100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | from distribute_setup import use_setuptools |
| 3 | use_setuptools() |
| 4 | |
| 5 | from setuptools import setup |
| 6 | import re |
| 7 | import sys |
| 8 | |
| 9 | def load_version(filename='funcsigs/version.py'): |
| 10 | "Parse a __version__ number from a source file" |
| 11 | with open(filename) as source: |
| 12 | text = source.read() |
| 13 | match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", text) |
| 14 | if not match: |
| 15 | msg = "Unable to find version number in {}".format(filename) |
| 16 | raise RuntimeError(msg) |
| 17 | version = match.group(1) |
| 18 | return version |
| 19 | |
| 20 | def load_rst(filename='docs/source/guide_content.rst'): |
| 21 | "Purge refs directives from restructured text" |
| 22 | with open(filename) as source: |
| 23 | text = source.read() |
| 24 | doc = re.sub(r':\w+:`~?([a-zA-Z._()]+)`', r'*\1*', text) |
| 25 | return doc |
| 26 | |
| 27 | setup( |
| 28 | name="funcsigs", |
| 29 | version=load_version(), |
| 30 | packages=['funcsigs'], |
| 31 | zip_safe=False, |
| 32 | author="Aaron Iles", |
| 33 | author_email="aaron.iles@gmail.com", |
| 34 | url="http://funcsigs.readthedocs.org", |
| 35 | description="", |
| 36 | long_description=open('README.rst').read(), |
| 37 | # long_description=load_rst(), |
| 38 | license="ASL", |
| 39 | install_requires = [], |
| 40 | classifiers = [ |
| 41 | 'Development Status :: 1 - Planning', |
| 42 | 'Intended Audience :: Developers', |
| 43 | 'License :: OSI Approved :: Apache Software License', |
| 44 | 'Operating System :: OS Independent', |
| 45 | 'Programming Language :: Python', |
| 46 | 'Programming Language :: Python :: 2', |
| 47 | 'Programming Language :: Python :: 2.6', |
| 48 | 'Programming Language :: Python :: 2.7', |
| 49 | 'Programming Language :: Python :: 3', |
| 50 | 'Programming Language :: Python :: 3.2', |
| 51 | 'Programming Language :: Python :: Implementation :: CPython', |
| 52 | 'Programming Language :: Python :: Implementation :: PyPy', |
| 53 | 'Topic :: Software Development :: Libraries :: Python Modules' |
| 54 | ], |
| 55 | tests_require = [] if sys.version_info[0] > 2 else ['unittest2'], |
| 56 | test_suite = "tests" if sys.version_info[0] > 2 else 'unittest2.collector' |
| 57 | ) |