-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
63 lines (56 loc) · 2.2 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
import os
from setuptools import Extension, find_packages, setup
import sys
import numpy as np
if sys.version_info[0] < 3:
with open("README.md", 'r') as readme:
long_description = readme.read().decode('utf-8')
else:
with open("README.md", 'r', encoding="utf-8") as readme:
long_description = readme.read()
# Compile the Cython code to C for development builds:
# USE_CYTHON=1 python -m pip install -e .
# and for building source distribution packages:
# USE_CYTHON=1 python -m build --sdist
# and *not* when installing a distribution package.
# See http://docs.cython.org/en/latest/src/userguide/source_files_and_compilation.html#distributing-cython-modules
USE_CYTHON = 'USE_CYTHON' in os.environ
ext = '.pyx' if USE_CYTHON else '.c'
arrow_dir = os.path.join('src', 'stochastic_arrow')
cython_extensions = [
Extension('stochastic_arrow.arrowhead',
sources=[
os.path.join(arrow_dir, 'mersenne.c'),
os.path.join(arrow_dir, 'obsidian.c'),
os.path.join(arrow_dir, 'arrowhead'+ext),],
include_dirs=[arrow_dir, np.get_include()],
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')],
)]
if USE_CYTHON:
from Cython.Build import cythonize
cython_extensions = cythonize(
cython_extensions,
include_path=[arrow_dir],
annotate=True, # to get an HTML code listing
)
setup(
name='stochastic-arrow',
version='1.1.0',
packages=find_packages('src'),
package_dir={'': 'src'},
author='Ryan Spangler, John Mason, Jerry Morrison, Chris Skalnik, Travis Ahn-Horst, Sean Cheah',
author_email='[email protected]',
url='https://github.com/CovertLab/arrow',
license='MIT',
ext_modules=cython_extensions,
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=['numpy>=1.14', 'six'],
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
])