-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
99 lines (76 loc) · 3.1 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
'''PyWENO setup script.'''
import glob
import os
import re
from setuptools import setup, Extension
import numpy as np
###############################################################################
# version
with open('version.py') as f:
exec(f.read()) # this sets 'version'
with open('README') as file:
long_description = file.read()
###############################################################################
# save git version to 'pyweno/__git_version__.py'
try:
git_head_file = os.path.join(os.path.dirname(__file__), '.git', 'HEAD')
with open(git_head_file) as f:
m = re.match(r'ref: (.+)', f.readline())
ref = m.group(1)
git_head_file = os.path.join(os.path.dirname(__file__), '.git', ref)
with open(git_head_file) as f:
git_version = f.readline().rstrip()
except:
git_version = 'not_available'
git_version_file = os.path.join(os.path.dirname(__file__),
'pyweno','__git_version__.py')
with open(git_version_file, 'w') as f:
f.write("version = '%s'\n" % (git_version))
###############################################################################
# save version to 'pyweno/__version__.py'
version_file = os.path.join(os.path.dirname(__file__),
'pyweno','__version__.py')
with open(version_file, 'w') as f:
f.write("version = '%s'\n" % (version))
###############################################################################
# setup!
setup(
name = "PyWENO",
packages = ['pyweno'],
version = version,
author = "Matthew Emmett",
author_email = "[email protected]",
description = "Weighted Essentially Non-oscillatory (WENO) reconstructions.",
license = "BSD",
keywords = "weno, interpolate, interpolation, finite, volume",
url = "http://readthedocs.org/docs/pyweno/en/latest/",
ext_modules = [
Extension('pyweno.ccoeffs',
sources = ['src/ccoeffs.c'] + glob.glob('src/coeffs*.c'),
include_dirs=[np.get_include()]
),
Extension('pyweno.cweno',
sources = ['src/cweno.c'] + glob.glob('src/weno*.c'),
include_dirs=[np.get_include()],
extra_compile_args = ['-std=c99'],
),
Extension('pyweno.cnonuniform',
sources = ['src/nfweno.c', 'src/poly.c'],
include_dirs=[np.get_include()],
extra_compile_args = ['-std=c99'],
)],
long_description = long_description,
classifiers = [
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
# 'Development Status :: 6 - Mature',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python ',
'Programming Language :: C',
'Programming Language :: Fortran',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
],
)