An error occurred while loading the file. Please try again.
-
remi cresson authored939f2d3f
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
import sys
import os
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
import numpy
# collect centrally sourced package version
with open("evalhyd/version.py", 'r') as fv:
exec(fv.read())
# vendor dependencies (unless told otherwise via environment variable)
deps = ['xtl', 'xtensor', 'xtensor-python', 'evalhyd']
deps_blank_path = os.path.join(os.getcwd(), 'deps', '{}', 'include')
deps_include_dirs = []
for dep in deps:
if not os.getenv(f"EVALHYD_PYTHON_VENDOR_{dep.upper().replace('-', '_')}") == 'FALSE':
# register dependency headers
deps_include_dirs.append(deps_blank_path.format(dep))
# configure Python extension
ext_modules = [
Pybind11Extension(
"evalhyd._evalhyd",
['evalhyd/src/evalhyd.cpp'],
include_dirs=[
numpy.get_include(),
os.path.join(sys.prefix, 'include'),
os.path.join(sys.prefix, 'Library', 'include'),
*deps_include_dirs
],
language='c++',
define_macros=[('VERSION_INFO', __version__)]
),
]
# build Python extension and install Python package
setup(
name='evalhyd-python',
version=__version__,
author='Thibault Hallouin',
author_email='thibault.hallouin@inrae.fr',
url='https://gitlab.irstea.fr/hycar-hydro/evalhyd/evalhyd-python',
description='Python bindings for EvalHyd',
long_description='An evaluator for streamflow predictions.',
packages=["evalhyd"],
ext_modules=ext_modules,
cmdclass={'build_ext': build_ext},
extras_require={'tests': 'numpy>=1.16'},
zip_safe=False,
)