-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
52 lines (48 loc) · 1.9 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
import setuptools
import os.path
import re
from numpy.distutils.core import setup, Extension
from numpy.distutils.system_info import get_info
ext = Extension(name='fraysum',
sources = ['pyraysum/src/buildmodel.f',
'pyraysum/src/eigenvec.f',
'pyraysum/src/eispack-cg.f',
'pyraysum/src/matrixops.f',
'pyraysum/src/phaselist.f',
'pyraysum/src/raysum.f',
'pyraysum/src/readwrite.f',
'pyraysum/src/seis-spread.f',
'pyraysum/src/trace.f'],
extra_compile_args=['-Ofast'])
def find_version(*paths):
fname = os.path.join(os.path.dirname(__file__), *paths)
with open(fname, encoding='utf-8') as fp:
code = fp.read()
match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", code, re.M)
if match:
return match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name='pyraysum',
version=find_version('pyraysum', '__init__.py'),
description='Python wrapper around Fortran code Raysum',
author='Andrew Frederiksen, Pascal Audet',
maintainer='Pascal Audet',
author_email='[email protected]',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Fortran',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'],
install_requires=['numpy>=1.15,<1.23', 'obspy>=1.0.0', 'matplotlib', 'setuptools'],
python_requires='>=3.7,<3.12',
ext_modules = [ext],
packages=setuptools.find_packages(),
include_package_data=True,
package_data={
'pyraysum': [
'examples/data/*.txt',
'examples/data/*.dat',
'examples/notebooks/*.ipynb']},
)