-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
39 lines (31 loc) · 1016 Bytes
/
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
import os
import platform
import warnings
import setuptools # noqa
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
pyws_fortran = str(os.getenv("PYWS_FORTRAN"))
if pyws_fortran.lower() == "true":
pyws_fortran = True
if platform.system() == "Windows":
pyws_fortran = False
warnings.warn(
"Fortran source compilation not enabled on Windows", Warning
)
else:
pyws_fortran = False
config = Configuration("pywatershed")
if pyws_fortran:
source_dir_names = {
"hydrology": ["prms_groundwater", "prms_canopy", "prms_channel"]
}
for dir_name, names in source_dir_names.items():
for name in names:
config.add_extension(
f"{name}_f",
sources=[
f"pywatershed/{dir_name}/{name}.pyf",
f"pywatershed/{dir_name}/{name}.f90",
],
)
setup(**config.todict(), packages=setuptools.find_packages())