blob: 98b091260453c14638f70fce9f502dd82bbe8b3e [file] [log] [blame]
Aaron Ilesc18d6942013-01-06 13:12:00 +11001#!/usr/bin/env python
Aaron Ilesc18d6942013-01-06 13:12:00 +11002from 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",
Aaron Iles823ef732013-01-06 21:28:14 +110032 description="Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+",
Aaron Ilesc18d6942013-01-06 13:12:00 +110033 long_description=open('README.rst').read(),
34 # long_description=load_rst(),
35 license="ASL",
36 install_requires = [],
37 classifiers = [
Aaron Iles823ef732013-01-06 21:28:14 +110038 'Development Status :: 4 - Beta',
Aaron Ilesc18d6942013-01-06 13:12:00 +110039 '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 Iles823ef732013-01-06 21:28:14 +110048 'Programming Language :: Python :: 3.3',
Aaron Ilesc18d6942013-01-06 13:12:00 +110049 '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)