1#!/usr/bin/env python 2from setuptools import setup 3import re 4import sys 5 6def 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 17def 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 24setup( 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", 32 description="Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+", 33 long_description=open('README.rst').read(), 34 # long_description=load_rst(), 35 license="ASL", 36 install_requires = [], 37 classifiers = [ 38 'Development Status :: 4 - Beta', 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', 48 'Programming Language :: Python :: 3.3', 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) 56