-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·151 lines (122 loc) · 3.97 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/env python
# encoding: utf8
from __future__ import print_function
import os
import re
import sys
from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
PY2 = sys.version_info[0] == 2
try:
import colorama
colorama.init()
from colorama import Fore
RESET = Fore.RESET
GREEN = Fore.GREEN
RED = Fore.RED
except ImportError:
RESET = ''
GREEN = ''
RED = ''
import inspect
from os.path import join, dirname, abspath
PY2 = sys.version_info[0] == 2
OWN_PATH = abspath(inspect.getfile(inspect.currentframe()))
EXAMPLES_DIR = join(dirname(OWN_PATH), 'examples')
v = open(os.path.join(os.path.dirname(__file__), 'neurons', '__init__.py'), 'r')
VERSION = re.match(r".*__version__ = '(.*?)'", v.read(), re.S).group(1)
SHORT_DESC = \
"Neurons is a web framework tying together Spyne, Twisted and SQLAlchemy."
LONG_DESC = SHORT_DESC
try:
os.stat('CHANGELOG.rst')
LONG_DESC += "\n\n" + open('CHANGELOG.rst', 'r').read()
except OSError:
pass
common_reqs = ()
# twisted requirements that need an upper bound
if PY2:
common_reqs += 'idna<3',
common_reqs += (
'spyne>=2.14',
'SQLAlchemy<1.2.99',
'Twisted' if not PY2 else 'Twisted<21',
'pyyaml' if not PY2 else 'pyyaml<6',
'lxml>=3.8.0',
'msgpack', 'pycrypto', 'slimit', 'txpostgres', 'colorama',
)
test_reqs = common_reqs + ('pytest', 'pytest-cov', 'pytest-twisted','tox')
install_reqs = common_reqs + (
'werkzeug' if not PY2 else 'werkzeug<2',
'psycopg2' if not PY2 else 'psycopg2<2.8.99',
)
##################
# testing stuff
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
import shlex
errno = tox.cmdline(args=shlex.split(self.tox_args))
sys.exit(errno)
# testing stuff
##################
# try the fix in:
# http://scipy-dev.scipy.narkive.com/pAiap0yr/scikits-contribution#post14
# if python setup.py sdist upload fails
setup(
name='neurons',
packages=find_packages(),
version=VERSION,
description=SHORT_DESC,
long_description=LONG_DESC,
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: OS Independent',
'Natural Language :: English',
'Development Status :: 5 - Production',
'Intended Audience :: Developers',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
keywords=['http'],
author='Burak Arslan',
author_email='burak+neurons@arskom.com.tr',
maintainer='Burak Arslan',
maintainer_email='burak+neurons@arskom.com.tr',
url='http://spyne.io/neurons',
license='LGPL-2.1',
zip_safe=False,
install_requires=install_reqs,
entry_points={
'console_scripts': [],
},
package_data={
'neurons.form.const': ['*.html'],
'neurons.polymer.const': ['*.html', "*.js"],
'neurons.polymer.const.comp': ['neurons-*/*'],
},
tests_require=test_reqs,
cmdclass={'test': Tox},
)