forked from falconry/falcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
113 lines (97 loc) · 3.5 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import glob
import imp
import io
import os
from os import path
from setuptools import setup, find_packages, Extension
import sys
MYDIR = path.abspath(os.path.dirname(__file__))
VERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))
VERSION = VERSION.__version__
# NOTE(kgriffs): python-mimeparse is newer than mimeparse, supports Py3
# TODO(kgriffs): Fork and optimize/modernize python-mimeparse
REQUIRES = ['six>=1.4.0', 'python-mimeparse']
PYPY = True
CYTHON = False
try:
sys.pypy_version_info
except AttributeError:
PYPY = False
if not PYPY:
try:
from Cython.Distutils import build_ext
CYTHON = True
except ImportError:
print('\nWARNING: Cython not installed. '
'Falcon will still work fine, but may run '
'a bit slower.\n')
CYTHON = False
if CYTHON:
def list_modules(dirname):
filenames = glob.glob(path.join(dirname, '*.py'))
module_names = []
for name in filenames:
module, ext = path.splitext(path.basename(name))
if module != '__init__':
module_names.append(module)
return module_names
ext_modules = [
Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])
for ext in list_modules(path.join(MYDIR, 'falcon'))]
ext_modules += [
Extension('falcon.util.' + ext,
[path.join('falcon', 'util', ext + '.py')])
for ext in list_modules(path.join(MYDIR, 'falcon', 'util'))]
ext_modules += [
Extension('falcon.routing.' + ext,
[path.join('falcon', 'routing', ext + '.py')])
for ext in list_modules(path.join(MYDIR, 'falcon', 'routing'))]
cmdclass = {'build_ext': build_ext}
else:
cmdclass = {}
ext_modules = []
setup(
name='falcon',
version=VERSION,
description='An unladen web framework for building APIs and app backends.',
long_description=io.open('README.rst', 'r', encoding='utf-8').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Natural Language :: English',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP :: WSGI',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Programming Language :: Python',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: Jython',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
keywords='wsgi web api framework rest http cloud',
author='Kurt Griffiths',
author_email='mail@kgriffs.com',
url='http://falconframework.org',
license='Apache 2.0',
packages=find_packages(exclude=['tests']),
include_package_data=True,
zip_safe=False,
install_requires=REQUIRES,
setup_requires=[],
cmdclass=cmdclass,
ext_modules=ext_modules,
test_suite='nose.collector',
entry_points={
'console_scripts': [
'falcon-bench = falcon.cmd.bench:main'
]
}
)