-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·135 lines (108 loc) · 3.17 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
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import re
import sys
from setuptools import setup, find_packages, Extension
import pkg_resources
import bndl
install_requires = [
'sortedcontainers',
'cycloudpickle',
'cyhll',
'cytoolz',
'numpy',
'scipy',
'pandas',
'flask',
'mmh3',
'scandir',
'psutil>=4.4',
'tblib',
'marisa_trie',
'yappi<=0.93',
'lz4',
]
if sys.version_info >= (3, 5):
install_requires.append('uvloop')
dev_requires = [
'cython<0.25',
'pytest',
'pytest-cov',
'pylint',
'flake8',
'sphinx',
'sphinx-autobuild',
'sphinx-rtd-theme',
'sphinxcontrib-programoutput',
]
def get_distributions(requirements):
packages = set(p.name for p in pkg_resources.parse_requirements(requirements))
for p in packages:
yield pkg_resources.get_distribution(p)
def print_distributions(requirements):
dists = sorted(get_distributions(requirements), key=lambda d: d.project_name)
for dist in dists:
print(dist.project_name.ljust(30), dist.version)
ext = re.compile(r'\.pyx$')
extensions = [
Extension(
'.'.join((root.replace(os.sep, '.'), ext.sub('', f))),
[os.path.join(root, f)]
)
for root, dirs, files in os.walk('bndl')
for f in files
if not root.endswith('tests')
if ext.search(f)
]
try:
from Cython.Build import cythonize
extensions = cythonize(extensions, compiler_directives={
'language_level': 3
})
except ImportError:
pass
if __name__ == '__main__':
setup(
name='bndl',
version=bndl.__version__,
url='https://stash.tgho.nl/projects/THCLUSTER/repos/bndl/browse',
description='Bundle compute resources with BNDL',
long_description=open('README.rst').read(),
author='Frens Jan Rumph',
author_email='[email protected]',
packages=(
find_packages()
),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
extras_require=dict(
dev=dev_requires,
),
ext_modules=extensions,
entry_points=dict(
console_scripts=[
'bndl-compute-shell = bndl.compute.shell:main',
'bndl-compute-workers = bndl.compute.worker:run_workers',
],
),
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)