Source

cheroot / setup.py

"""Installs Cheroot using distutils

Run:
    python setup.py install

to install this package.
"""

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

from distutils.command.install import INSTALL_SCHEMES
import sys
import os
import re

###############################################################################
# arguments for the setup command
###############################################################################
name = "Cheroot"
version = "4.0.0beta"
desc = "Object-Oriented HTTP server"
long_desc = "Cheroot is a highly-optimized, pure-python HTTP server"
classifiers=[
    "Development Status :: 4 - Beta",
    "Environment :: Web Environment",
    "Intended Audience :: Developers",
    "License :: Freely Distributable",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 2",
    "Programming Language :: Python :: 3",
    "Topic :: Internet :: WWW/HTTP",
    "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
    "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
    "Topic :: Internet :: WWW/HTTP :: WSGI",
    "Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
]
author="CherryPy Team"
author_email="team@cherrypy.org"
url="http://www.cherrypy.org"
cp_license="BSD"
packages=[
    "cheroot", "cheroot.ssllib", "cheroot.workers", "cheroot.test",
]
download_url="http://download.cherrypy.org/cheroot/4.0.0beta/"
data_files=[
    ('cheroot', ['cheroot/LICENSE.txt',
                 ]),
    ('cheroot/test', ['cheroot/test/test.pem',
                      ]),
]

if sys.version_info >= (3, 0):
    required_python_version = '3.0'
else:
    required_python_version = '2.3'

###############################################################################
# end arguments for setup
###############################################################################

# wininst may install data_files in Python/x.y instead of the cheroot package.
# Django's solution is at http://code.djangoproject.com/changeset/8313
# See also http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
if 'bdist_wininst' in sys.argv or '--format=wininst' in sys.argv:
    data_files = [(r'\PURELIB\%s' % path, files) for path, files in data_files]

def main():
    if sys.version < required_python_version:
        s = "I'm sorry, but %s %s requires Python %s or later."
        print(s % (name, version, required_python_version))
        sys.exit(1)
    # set default location for "data_files" to
    # platform specific "site-packages" location
    for scheme in list(INSTALL_SCHEMES.values()):
        scheme['data'] = scheme['purelib']

    dist = setup(
        name=name,
        version=version,
        description=desc,
        long_description=long_desc,
        classifiers=classifiers,
        author=author,
        author_email=author_email,
        url=url,
        license=cp_license,
        packages=packages,
        download_url=download_url,
        data_files=data_files,
    )


if __name__ == "__main__":
    main()