-
Notifications
You must be signed in to change notification settings - Fork 53
/
setup.py
executable file
·59 lines (52 loc) · 2.07 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
#!/usr/bin/env python
if __name__ == '__main__':
from setuptools import setup
from setuptools.extension import Extension
from pathlib import Path
import subprocess as sp
import numpy as np
import json
import re
# This package may not be distributed with `make_version.py` and
# `make_cython_extensions.py`. In that case, the version file and
# extensions should already exist.
if Path('make_version.py').exists():
sp.call(['python', 'make_version.py'])
if Path('make_cython_extensions.py').exists():
sp.call(['python', 'make_cython_extensions.py'])
version_file = Path('rbf/_version.py')
version_text = version_file.read_text()
version_info = dict(
re.findall('(__[A-Za-z_]+__)\s*=\s*"([^"]+)"', version_text)
)
ext = []
ext += [Extension(name='rbf.poly', sources=['rbf/poly.c'])]
ext += [Extension(name='rbf.sputils', sources=['rbf/sputils.c'])]
ext += [Extension(name='rbf.pde.halton', sources=['rbf/pde/halton.c'])]
ext += [Extension(name='rbf.pde.geometry', sources=['rbf/pde/geometry.c'])]
ext += [Extension(name='rbf.pde.sampling', sources=['rbf/pde/sampling.c'])]
with open('rbf/_rbf_ufuncs/metadata.json', 'r') as f:
rbf_ufunc_metadata = json.load(f)
for itm in rbf_ufunc_metadata:
ext += [Extension(name=itm['module'], sources=itm['sources'], include_dirs=[np.get_include()])]
setup(
name='treverhines-rbf',
version=version_info['__version__'],
description='Package containing the tools necessary for radial basis '
'function (RBF) applications',
author='Trever Hines',
author_email='treverhines@gmail.com',
url='https://www.github.com/treverhines/RBF',
packages=['rbf', 'rbf.pde', 'rbf._rbf_ufuncs'],
ext_modules=ext,
include_package_data=True,
licence='MIT',
python_requires='>=3.5',
install_requires=[
'numpy>=1.10',
'scipy',
'sympy',
'cython',
'rtree'
]
)