-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
66 lines (60 loc) · 2.33 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
import inspect
import os
import re
from setuptools import setup
INSTALL_REQUIRES = [
'numpy',
'scipy',
'matplotlib',
'obspy',
'gdal',
]
SETUP_DIRECTORY = os.path.dirname(os.path.abspath(inspect.getfile(
inspect.currentframe())))
ENTRY_POINTS = {
'console_scripts': [
'pySW4-plot-image = pySW4.cli.plot_image:main',
'pySW4-create-plots = pySW4.cli.create_all_plots:main',
'png2mp4 = pySW4.cli.png2mp4:main']}
def find_packages():
"""
Simple function to find all modules under the current folder.
"""
modules = []
for dirpath, _, filenames in os.walk(
os.path.join(SETUP_DIRECTORY, "pySW4")):
if "__init__.py" in filenames:
modules.append(os.path.relpath(dirpath, SETUP_DIRECTORY))
return [_i.replace(os.sep, ".") for _i in modules]
# get the package version from from the main __init__ file.
version_regex_pattern = r"__version__ += +(['\"])([^\1]+)\1"
for line in open(os.path.join(SETUP_DIRECTORY, 'pySW4', '__init__.py')):
if '__version__' in line:
package_version = re.match(version_regex_pattern, line).group(2)
setup(
name="pySW4",
version=package_version,
description="Python routines for interaction with SW4",
author="Shahar Shani-Kadmiel, Omry Volk, Tobias Megies",
author_email="[email protected]",
url="https://github.com/shaharkadmiel/pySW4",
download_url="https://github.com/shaharkadmiel/pySW4.git",
install_requires=INSTALL_REQUIRES,
keywords=["pySW4", "seismology", "SW4"],
packages=find_packages(),
entry_points=ENTRY_POINTS,
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
long_description='pySW4 is an open-source project dedicated to '
'provide a Python framework for working with '
'numerical simulations of seismic-wave propagation '
'with SW4 in all phases of the task (preprocessing, '
'post-processing and runtime visualization).'
)