/
setup.py
130 lines (119 loc) · 3.71 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- coding: utf-8 -*-
#
import os
import shlex
import subprocess
import sys
import setuptools
from numpy.distutils.core import Extension, setup
# temporarily redirect config directory to prevent matplotlib importing
# testing that for writeable directory which results in sandbox error in
# certain easy_install versions
os.environ["MPLCONFIGDIR"] = "."
pkg_name = "wdmtoolbox"
version = open("VERSION").readline().strip()
if sys.argv[-1] == "publish":
subprocess.run(shlex.split("cleanpy ."), check=True)
subprocess.run(shlex.split("python setup.py sdist"), check=True)
subprocess.run(
shlex.split(f"twine upload dist/{pkg_name}-{version}.tar.gz"), check=True
)
subprocess.run(
shlex.split(f"twine upload dist/{pkg_name}-{version}*.whl"), check=True
)
sys.exit()
README = open("README.rst").read()
install_requires = [
# List your project dependencies here.
# For more details, see:
# http://packages.python.org/distribute/setuptools.html#declaring-dependencies
"tstoolbox >= 103.17.1",
"filelock",
]
extras_require = {
"dev": [
"black",
"cleanpy",
"twine",
"pytest",
"coverage",
"flake8",
"pytest-cov",
"pytest-mpl",
"pre-commit",
"black-nbconvert",
"blacken-docs",
"velin",
"isort",
"pyroma",
"pyupgrade",
"commitizen",
]
}
libraries = []
wdm_support = Extension(
"_wdm_lib",
[
"wdm_support/wdm.pyf",
"wdm_support/DTTM90.f",
"wdm_support/TSBUFR.f",
"wdm_support/UTCHAR.f",
"wdm_support/UTCP90.f",
"wdm_support/UTDATE.f",
"wdm_support/UTNUMB.f",
"wdm_support/UTWDMD.f",
"wdm_support/UTWDMF.f",
"wdm_support/UTWDT1.f",
"wdm_support/WDATM1.f",
"wdm_support/WDATM2.f",
"wdm_support/WDATRB.f",
"wdm_support/WDBTCH.f",
"wdm_support/WDMESS.f",
"wdm_support/WDMID.f",
"wdm_support/WDOP.f",
"wdm_support/WDTMS1.f",
"wdm_support/WDTMS2.f",
],
include_dirs=["wdm_support"],
libraries=libraries,
)
setup(
name=pkg_name,
version=version,
description="Read and write Watershed Data Management (WDM) files",
long_description=README,
classifiers=[
# Get strings from
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"Environment :: Console",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
],
keywords="WDM watershed data_management data hydrology hydrological simulation fortran HSPF",
author="Tim Cera, PE",
author_email="tim@cerazone.net",
url=f"http://timcera.bitbucket.io/{pkg_name}/docs/index.html",
license="BSD",
packages=setuptools.find_packages("src"),
package_dir={"": "src"},
package_data={"wdmtoolbox": ["message.wdm"]},
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
extras_require=extras_require,
ext_modules=[wdm_support],
entry_points={"console_scripts": [f"{pkg_name}={pkg_name}.{pkg_name}:main"]},
test_suite="tests",
python_requires=">=3.7.1",
)