blob: c991a091cbed59b2f9efcaba11497eecd52b082c [file] [log] [blame]
Aaron Ilesc18d6942013-01-06 13:12:00 +11001#!/usr/bin/env python
2from distribute_setup import use_setuptools
3use_setuptools()
4
5from setuptools import setup
6import re
7import sys
8
9def 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
20def 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
27setup(
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",
Aaron Iles823ef732013-01-06 21:28:14 +110035 description="Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+",
Aaron Ilesc18d6942013-01-06 13:12:00 +110036 long_description=open('README.rst').read(),
37 # long_description=load_rst(),
38 license="ASL",
39 install_requires = [],
40 classifiers = [
Aaron Iles823ef732013-01-06 21:28:14 +110041 'Development Status :: 4 - Beta',
Aaron Ilesc18d6942013-01-06 13:12:00 +110042 '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',
Aaron Iles823ef732013-01-06 21:28:14 +110051 'Programming Language :: Python :: 3.3',
Aaron Ilesc18d6942013-01-06 13:12:00 +110052 'Programming Language :: Python :: Implementation :: CPython',
53 'Programming Language :: Python :: Implementation :: PyPy',
54 'Topic :: Software Development :: Libraries :: Python Modules'
55 ],
56 tests_require = [] if sys.version_info[0] > 2 else ['unittest2'],
57 test_suite = "tests" if sys.version_info[0] > 2 else 'unittest2.collector'
58)