-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
73 lines (59 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
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
import sys
import os
import numpy as np
from setuptools import setup, Extension, find_packages
VERSION = '2.3.5'
debug = '--debug' in sys.argv or '-g' in sys.argv
try:
from Cython.Build import cythonize
except ImportError:
use_cython = False
else:
use_cython = True
cy_suff = '.pyx' if use_cython else '.c'
cy_files = [
['force_match'],
['utilities', 'blas'],
['utilities', 'math'],
]
macros = []
if debug:
macros.append(('CYTHON_TRACE_NOGIL', '1'))
ext_modules = []
for cy_file in cy_files:
ext_modules.append(Extension('.'.join(['sella', *cy_file]),
[os.path.join('sella', *cy_file) + cy_suff],
define_macros=macros,
include_dirs=[np.get_include()]))
if use_cython:
compdir = dict(linetrace=debug, boundscheck=debug, language_level=3,
wraparound=False, cdivision=True)
ext_modules = cythonize(ext_modules, compiler_directives=compdir)
with open('README.md', 'r') as f:
long_description = f.read()
with open('requirements.txt', 'r') as f:
install_requires = f.read().strip().split()
setup(name='Sella',
version=VERSION,
author='Eric Hermes',
author_email='[email protected]',
long_description=long_description,
long_description_content_type='text/markdown',
packages=find_packages(),
ext_modules=ext_modules,
include_dirs=[np.get_include()],
classifiers=['Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.8',
'Programming Language :: Cython',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Physics'],
python_requires='>=3.8',
install_requires=install_requires,
)