-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
81 lines (64 loc) · 2.77 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
import os
from Cython.Build import cythonize
from setuptools import setup, find_packages
from setuptools.extension import Extension
MAJOR = 0
MINOR = 0
MICRO = 6
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
FULLVERSION = VERSION
def readme():
with open('README.rst') as f:
return f.read()
def write_version_py(filename=None):
cnt = """\
version = '%s'
short_version = '%s'
"""
if not filename:
filename = os.path.join(
os.path.dirname(__file__), 'snakebacon', 'version.py')
a = open(filename, 'w')
try:
a.write(cnt % (FULLVERSION, VERSION))
finally:
a.close()
write_version_py()
bacon = Extension("snakebacon.mcmcbackends.bacon.baconwrap",
sources=["snakebacon/mcmcbackends/bacon/baconwrap.pyx",
"snakebacon/mcmcbackends/bacon/input.cpp",
"snakebacon/mcmcbackends/bacon/Matrix.cpp",
"snakebacon/mcmcbackends/bacon/ranfun.cpp",
"snakebacon/mcmcbackends/bacon/vector.cpp",
"snakebacon/mcmcbackends/bacon/kernel.cpp"],
language="c++",
libraries=["gsl", "openblas"],
# Below for clang, need -fopenmp if using gcc
extra_compile_args=["-xc++", "-lstdc++", "-shared-libgcc", "-O2"],
)
setup_kwargs = dict(name='snakebacon',
version=FULLVERSION,
description='snakebacon',
long_description=readme(),
url='https://github.com/brews/snakebacon',
author='S. Brewster Malevich',
author_email='[email protected]',
license='GPLv3',
classifiers=[
'Development Status :: 3 - Alpha',
'Operating System :: POSIX',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 3'],
keywords='marine radiocarbon c14',
install_requires=['numpy', 'Cython', 'pandas', 'matplotlib', 'scipy'],
packages=find_packages(),
package_data={'snakebacon': ['tests/*.csv', 'mcmcbackends/bacon/Curves/*.14C']},
)
# Deal with bad linking bug with conda in readthedocs builds.
if os.environ.get('READTHEDOCS') != 'True':
setup_kwargs['ext_modules'] = cythonize([bacon])
setup(**setup_kwargs)