diff --git a/MANIFEST.in b/MANIFEST.in index c1a7121..505d963 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include LICENSE -include README.md +graft requires diff --git a/requires/development.txt b/requires/development.txt new file mode 100644 index 0000000..d5f342e --- /dev/null +++ b/requires/development.txt @@ -0,0 +1,4 @@ +-rtesting.txt +sphinx>=1.2,<2 +sphinxcontrib-httpdomain>=1.3,<2 +tox>=1.7,<2 diff --git a/requires/installation.txt b/requires/installation.txt new file mode 100644 index 0000000..e69de29 diff --git a/requires/testing.txt b/requires/testing.txt new file mode 100644 index 0000000..3f8d1db --- /dev/null +++ b/requires/testing.txt @@ -0,0 +1,2 @@ +-rinstallation.txt +nose>=1.3.1,<2 diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 1e5db45..6408bc2 --- a/setup.py +++ b/setup.py @@ -1,49 +1,63 @@ -from setuptools import setup -import os +#!/usr/bin/env python +# + +import os.path import sys +import setuptools + from sprockets import http -requirements = ['sprockets'] -tests_require = ['coverage', 'coveralls', 'mock', 'nose'] - -# Requirements for Python 2.6 -version = sys.version_info -if (version.major, version.minor) < (2, 7): - tests_require.append('unittest2') +def read_requirements(filename): + requirements = [] + try: + with open(os.path.join('requires', filename)) as req_file: + for line in req_file: + if '#' in line: + line = line[:line.index('#')] + line = line.strip() + if line.startswith('-r'): + line = line[2:].strip() + requirements.extend(read_requirements(filename)) + else: + requirements.append(line) + except IOError: + pass + return requirements -setup(name='sprockets.http', - version=http.__version__, - description=('HTTP Server / Web application controller'), - author='AWeber Communications', - url='https://github.com/sprockets/sprockets.http', - entry_points={'sprockets.controller': ['http=sprockets.http']}, - install_requires=requirements, - license=open('LICENSE').read(), - namespace_packages=['sprockets'], - package_data={'': ['LICENSE', 'README.md']}, - packages=['sprockets.http'], - classifiers=['Development Status :: 3 - Alpha', - 'Environment :: No Input/Output (Daemon)', - 'Framework :: Tornado', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules'], - test_suite='nose.collector', - tests_require=tests_require, - zip_safe=True) +requirements = read_requirements('installation') +tests_require = read_requirements('testing') + +setuptools.setup( + name='sprockets.http', + version=http.__version__, + description='Tornado HTTP application runner', + author='AWeber Communications', + url='https://github.com/sprockets/sprockets.http', + install_requires=requirements, + license='BSD', + namespace_packages=['sprockets'], + packages=setuptools.find_packages(), + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: No Input/Output (Daemon)', + 'Framework :: Tornado', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules'], + test_suite='nose.collector', + tests_require=tests_require, + zip_safe=True, +)