forked from fatiando/fatiando
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
92 lines (87 loc) · 3.03 KB
/
Copy pathsetup.py
File metadata and controls
92 lines (87 loc) · 3.03 KB
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
"""
Build extension modules, package and install Fatiando.
"""
import sys
import os
from distutils.core import setup
from distutils.extension import Extension
import numpy
import versioneer
versioneer.VCS = 'git'
versioneer.versionfile_source = 'fatiando/_version.py'
versioneer.versionfile_build = 'fatiando/_version.py'
versioneer.tag_prefix = 'v'
versioneer.parentdir_prefix = '.'
NAME = 'fatiando'
FULLNAME = 'Fatiando a Terra'
DESCRIPTION = "Modeling and inversion for geophysics"
VERSION = versioneer.get_version()
CMDCLASS = versioneer.get_cmdclass()
with open("README.rst") as f:
LONG_DESCRIPTION = ''.join(f.readlines())
PACKAGES = ['fatiando',
'fatiando.gravmag',
'fatiando.seismic',
'fatiando.geothermal',
'fatiando.vis',
'fatiando.inversion']
AUTHOR = "Leonardo Uieda"
AUTHOR_EMAIL = 'leouieda@gmail.com'
LICENSE = "BSD License"
URL = "http://www.fatiando.org"
PLATFORMS = "Any"
SCRIPTS = []
CLASSIFIERS = ["Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries",
"Environment :: Console",
"Programming Language :: Python :: 2.7",
"Programming Language :: Cython",
"License :: OSI Approved :: BSD License",
"Development Status :: 3 - Alpha",
"Natural Language :: English"]
KEYWORDS = 'geophysics modeling inversion gravimetry seismic magnetometry'
# The running setup.py with --cython, then set things up to generate the Cython
# .c files. If not, then compile the pre-converted C files.
USE_CYTHON = True if '--cython' in sys.argv else False
ext = '.pyx' if USE_CYTHON else '.c'
libs = []
if os.name == 'posix':
libs.append('m')
C_EXT = [[['fatiando', 'seismic', '_ttime2d'], {}],
[['fatiando', 'seismic', '_wavefd'], {}],
[['fatiando', 'gravmag', '_polyprism'], {}],
[['fatiando', 'gravmag', '_sphere'], {}],
[['fatiando', 'gravmag', '_prism'], {}],
]
extensions = []
for e, extra_args in C_EXT:
extensions.append(
Extension('.'.join(e), [os.path.join(*e) + ext],
libraries=libs,
include_dirs=[numpy.get_include()],
**extra_args))
if USE_CYTHON:
sys.argv.remove('--cython')
from Cython.Build import cythonize
extensions = cythonize(extensions)
if __name__ == '__main__':
setup(name=NAME,
fullname=FULLNAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
version=VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
license=LICENSE,
url=URL,
platforms=PLATFORMS,
scripts=SCRIPTS,
packages=PACKAGES,
ext_modules=extensions,
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
cmdclass=CMDCLASS)