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