forked from MTgeophysics/mtpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
112 lines (93 loc) · 4.05 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
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env python
#import mtpy
# Check for setuptools package:
try:
from setuptools import setup
except ImportError:
setuptools = False
from distutils.core import setup
else:
setuptools = True
import codecs
import os.path
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
LONG_DESC = """
MTPy is an open source Python package to assist with magnetotelluric (MT) data processing, analysis,
modelling, visualization and interpretation.
"""
setup_kwargs = {}
# The advantage of setuptools is that EXE wrappers are created on Windows,
# which allows Tab-completion for the script names from the system Scripts
# folder.
# Add names of scripts here. You can also specify the function to call
# by adding :func_name after the module name, and the name of the script
# can be customized before the equals sign.
setup_kwargs['entry_points'] = {'console_scripts':
['ws2vtk = mtpy.utils.ws2vtk:main',
'modem_pyqt = mtpy.gui.modem_pyqt:main',
'modem_plot_response = mtpy.gui.modem_plot_response:main',
'modem_plot_pt_maps = mtpy.gui.modem_plot_pt_maps:main',
'modem_mesh_builder = mtpy.gui.modem_mesh_builder:main',
'modem2vtk = mtpy.utils.modem2vtk:main',
'occam1d_gui = mtpy.gui.occam1d_gui:main',
'edi_editor = mtpy.gui.edi_editor:main']}
# But many people will not have setuptools installed, so we need to handle
# the default Python installation, which only has Distutils:
if setuptools is False:
# Different script specification style for ordinary Distutils:
setup_kwargs['scripts'] = [
s.split(' = ')[1].replace('.', '/').split(':')[0] + '.py' for s in
setup_kwargs['entry_points']['console_scripts']]
del setup_kwargs['entry_points']
# "You must explicitly list all packages in packages: the Distutils will not
# recursively scan your source tree looking for any directory with an
# __init__.py file"
setup_kwargs['packages'] = [
'mtpy',
'mtpy.core',
'mtpy.imaging',
'mtpy.utils',
'mtpy.modeling',
'mtpy.modeling.modem',
'mtpy.contrib',
'mtpy.contrib.netcdf',
'mtpy.processing',
'mtpy.analysis',
#'tests',
#'mtpy.test',
'mtpy.uofa',
'mtpy.usgs',
'mtpy.gui']
setup_kwargs['install_requires'] = ['numpy>=1.8.1',
'scipy>=0.14.0',
'matplotlib<=3.3',
'pyyaml',
'pyproj',
'configparser']
setup_kwargs['data_files'] = [('data', ['mtpy/utils/epsg.npy'])]
setup(
name="mtpy",
version=get_version("mtpy/__init__.py") ,
author="Alison Kirkby,Fei Zhang,Jared Peacock,Rakib Hassan, Jinming Duan",
author_email="Fei.Zhang@ga.gov.au",
description="Python toolkit for standard magnetotelluric data processing.",
long_description=LONG_DESC,
url="https://github.com/MTgeophysics/mtpy",
#data_files=[('', ['mtpy/utils/epsg.npy',]),], #this will install datafiles in wearied palce such as ~/.local/
include_package_data=True,
license="GNU GENERAL PUBLIC LICENSE v3",
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
**setup_kwargs)