@@ -7,18 +7,46 @@ export DUNE_ENABLE_PYTHONMODULE_PRECOMPILE=ON
77PYTHON_INTERP=` which python3`
88# PYTHON_INTERP=/usr/bin/python3
99
10+ extractPythonRequired ()
11+ {
12+ # Python-Requires:
13+ PYTHONREQALL=` grep " Python-Requires" $1 | cut -d ' :' -f 2`
14+ PYTHONREQ=
15+ # skip all dune packages here
16+ for PACK in $PYTHONREQALL ; do
17+ SKIP=` echo $PACK | grep " dune" `
18+ if [ " $SKIP " != " " ]; then
19+ continue
20+ else
21+ PYTHONREQ=" $PYTHONREQ $PACK "
22+ fi
23+ done
24+ echo $PYTHONREQ
25+ }
26+
27+ cd ../repos
28+
1029# install missing python packages in users local environment
1130# Note: wheel and setuptools may not be required
1231# we only do this for Mac OS, ubuntu has the necessary packages installed
1332if [ " $3 " == " macOS" ]; then
33+ # extract fenics-ufl version from dune-fem/dune.module for consistency
34+ # FENICSUFL=`grep -o "fenics-ufl[==]*20[0-9]*.[0-9]*.[0-9]*" dune-fem/dune.module`
35+
36+ COMREQ=` extractPythonRequired " dune-common/dune.module" `
37+ FEMREQ=` extractPythonRequired " dune-fem/dune.module" `
38+
39+ if [ " $FEMREQ " == " " ]; then
40+ echo " Python-Requires not found in dune-fem/dune.module!"
41+ exit 1
42+ fi
43+
1444 # dune-common dependencies
15- $PYTHON_INTERP -m pip install --user --break-system-packages -U jinja2 wheel setuptools mpi4py numpy ninja
45+ $PYTHON_INTERP -m pip install --user --break-system-packages -U $COMREQ ninja
1646 # dune-fem dependencies
17- $PYTHON_INTERP -m pip install --user --break-system-packages -U scipy fenics-ufl==2022.2.0 matplotlib
47+ $PYTHON_INTERP -m pip install --user --break-system-packages -U $FEMREQ
1848fi
1949
20- cd ../repos
21-
2250FLAGS=" -O3 -DNDEBUG"
2351BUILDDIR=build-cmake
2452
0 commit comments