diff --git a/.github/workflows/test_python_cplusplus.yml b/.github/workflows/test_python_cplusplus.yml index b6e9491b71..44eeec8acb 100644 --- a/.github/workflows/test_python_cplusplus.yml +++ b/.github/workflows/test_python_cplusplus.yml @@ -137,7 +137,7 @@ jobs: -d ${AMICI_DIR}/build/CMakeFiles/amici.dir/src \ -b ${AMICI_DIR} -c -o coverage_cpp.info \ && lcov --compat-libtool --no-external \ - -d ${AMICI_DIR}/python/sdist/build/$(python -c "import sys, sysconfig; print(f'temp.{sysconfig.get_platform()}-{sys.implementation.cache_tag}_amici')")/CMakeFiles/amici.dir/src \ + -d ${AMICI_DIR}/python/sdist/build/temp_amici/CMakeFiles/amici.dir/src \ -b ${AMICI_DIR}/python/sdist -c -o coverage_py.info \ && lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info diff --git a/python/sdist/amici/custom_commands.py b/python/sdist/amici/custom_commands.py index d54060a009..46abfe3290 100644 --- a/python/sdist/amici/custom_commands.py +++ b/python/sdist/amici/custom_commands.py @@ -126,6 +126,16 @@ def run(self): class AmiciBuildCMakeExtension(BuildExtension): + def finalize_options(self): + # Allow overriding the - since setuptools version 64 randomly named - + # setuptools/distutils temporary build directory via environment variable. + # This is useful for CI builds where we need the files in this directory + # for code coverage analysis. + if os.getenv("AMICI_BUILD_TEMP"): + self.build_temp = os.getenv("AMICI_BUILD_TEMP") + + super().finalize_options() + def run(self): """Copy the generated clibs to the extensions folder to be included in the wheel diff --git a/scripts/installAmiciSource.sh b/scripts/installAmiciSource.sh index aa330bef22..4e693468b7 100755 --- a/scripts/installAmiciSource.sh +++ b/scripts/installAmiciSource.sh @@ -27,10 +27,9 @@ else source ${AMICI_PATH}/build/venv/bin/activate fi -pip install -U "setuptools<64" pip install --upgrade pip wheel pip install --upgrade pip scipy matplotlib coverage pytest \ pytest-cov cmake_build_extension numpy pip install git+https://github.com/FFroehlich/pysb@fix_pattern_matching # pin to PR for SPM with compartments -pip install --verbose -e ${AMICI_PATH}/python/sdist[petab,test,vis] --no-build-isolation +AMICI_BUILD_TEMP="${AMICI_PATH}/python/sdist/build/temp" pip install --verbose -e ${AMICI_PATH}/python/sdist[petab,test,vis] --no-build-isolation deactivate