From rawr, 10 Years ago, written in Plain Text.
Embed
  1. # -*- coding: utf-8 -
  2. #
  3. # This file is part of gunicorn released under the MIT license.
  4. # See the NOTICE for more information.
  5.  
  6. import os
  7. import sys
  8.  
  9. from setuptools import setup, find_packages
  10. from setuptools.command.test import test as TestCommand
  11.  
  12. from gunicorn import __version__
  13.  
  14.  
  15. CLASSIFIERS = [
  16.     'Development Status :: 4 - Beta',
  17.     'Environment :: Other Environment',
  18.     'Intended Audience :: Developers',
  19.     'License :: OSI Approved :: MIT License',
  20.     'Operating System :: MacOS :: MacOS X',
  21.     'Operating System :: POSIX',
  22.     'Programming Language :: Python',
  23.     'Programming Language :: Python :: 2',
  24.     'Programming Language :: Python :: 2.6',
  25.     'Programming Language :: Python :: 2.7',
  26.     'Programming Language :: Python :: 3',
  27.     'Programming Language :: Python :: 3.2',
  28.     'Programming Language :: Python :: 3.3',
  29.     'Programming Language :: Python :: 3.4',
  30.     'Topic :: Internet',
  31.     'Topic :: Utilities',
  32.     'Topic :: Software Development :: Libraries :: Python Modules',
  33.     'Topic :: Internet :: WWW/HTTP',
  34.     'Topic :: Internet :: WWW/HTTP :: WSGI',
  35.     'Topic :: Internet :: WWW/HTTP :: WSGI :: Server',
  36.     'Topic :: Internet :: WWW/HTTP :: Dynamic Content']
  37.  
  38. # read long description
  39. with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
  40.     long_description = f.read()
  41.  
  42. # read dev requirements
  43. fname = os.path.join(os.path.dirname(__file__), 'requirements_test.txt')
  44. with open(fname) as f:
  45.     tests_require = [l.strip() for l in f.readlines()]
  46.  
  47. if sys.version_info[:2] < (3, 3):
  48.     tests_require.append('mock')
  49. if sys.version_info[:2] < (2, 7):
  50.     tests_require.append('unittest2')
  51.  
  52. class PyTestCommand(TestCommand):
  53.     user_options = [
  54.         ("cov", None, "measure coverage")
  55.     ]
  56.  
  57.     def initialize_options(self):
  58.         TestCommand.initialize_options(self)
  59.         self.cov = None
  60.  
  61.     def finalize_options(self):
  62.         TestCommand.finalize_options(self)
  63.         self.test_args = ['tests']
  64.         if self.cov:
  65.             self.test_args += ['--cov', 'gunicorn']
  66.         self.test_suite = True
  67.  
  68.     def run_tests(self):
  69.         import pytest
  70.         errno = pytest.main(self.test_args)
  71.         sys.exit(errno)
  72.  
  73. setup(
  74.     name='gunicorn',
  75.     version=__version__,
  76.  
  77.     description='WSGI HTTP Server for UNIX',
  78.     long_description=long_description,
  79.     author='Benoit Chesneau',
  80.     author_email='benoitc@e-engura.com',
  81.     license='MIT',
  82.     url='http://gunicorn.org',
  83.  
  84.     classifiers=CLASSIFIERS,
  85.     zip_safe=False,
  86.     packages=find_packages(exclude=['examples', 'tests']),
  87.     include_package_data=True,
  88.  
  89.     tests_require=tests_require,
  90.     cmdclass={'test': PyTestCommand},
  91.  
  92.     entry_points="""
  93.     [console_scripts]
  94.     gunicorn=gunicorn.app.wsgiapp:run
  95.     gunicorn_django=gunicorn.app.djangoapp:run
  96.     gunicorn_paster=gunicorn.app.pasterapp:run
  97.  
  98.     [paste.server_runner]
  99.     main=gunicorn.app.pasterapp:paste_server
  100.     """
  101. )