From 88fa0541f467f1ef397826a1fc5c24c8cbd0ff0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Wed, 24 Apr 2024 18:23:15 +0200 Subject: [PATCH] bump versions --- scripts/environment/Containerfile | 11 +++++------ scripts/host-env.sh | 28 ++++++++++++++++------------ setup.py | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/scripts/environment/Containerfile b/scripts/environment/Containerfile index a0d68fb1..2271aed1 100644 --- a/scripts/environment/Containerfile +++ b/scripts/environment/Containerfile @@ -1,17 +1,18 @@ -FROM docker.io/debian:bullseye +FROM docker.io/debian:bookworm MAINTAINER Björn Dahlgren ENV LANG C.UTF-8 RUN apt-get update && \ - apt-get --quiet --assume-yes install curl git g++-10 gfortran-10 libgmp-dev binutils-dev bzip2 make cmake sudo \ - python3-dev python3-pip libboost-dev libgsl-dev liblapack-dev libsuitesparse-dev graphviz && \ + apt-get --quiet --assume-yes install --no-install-recommends \ + curl git g++ gfortran libgmp-dev binutils-dev bzip2 make cmake sudo \ + python3-dev python3-venv python3-pip libboost-dev libgsl-dev liblapack-dev libsuitesparse-dev graphviz && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mkdir /tmp/sundials-5.8.0-build && \ curl -Ls https://github.com/LLNL/sundials/releases/download/v5.8.0/sundials-5.8.0.tar.gz | tar xz -C /tmp && \ - FC=gfortran-10 cmake \ + FC=gfortran cmake \ -S /tmp/sundials-5.8.0 \ -B /tmp/sundials-5.8.0-build \ -DCMAKE_INSTALL_PREFIX=/usr/local \ @@ -28,8 +29,6 @@ RUN mkdir /tmp/sundials-5.8.0-build && \ cmake --build /tmp/sundials-5.8.0-build && \ cmake --build /tmp/sundials-5.8.0-build --target install && \ rm -r /tmp/sundials-5.8.0*/ && \ - python3 -m pip install --upgrade-strategy=eager --upgrade pip && \ - python3 -m pip install --upgrade-strategy=eager numpy 'cython>=3.0.10' setuptools && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/scripts/host-env.sh b/scripts/host-env.sh index 370831a7..34092d0c 100755 --- a/scripts/host-env.sh +++ b/scripts/host-env.sh @@ -4,10 +4,12 @@ show_help() { echo "$(basename $0) host-notebook --port 8888 --listen 127.0.0.1" echo "$(basename $0) run-tests" } +set -euxo pipefail + HOST_NOTEBOOK=0 RUN_TESTS=0 PORT=8000 -while [ $# -gt 0]; do +while [ $# -gt 0 ]; do case "$1" in host-notebook) HOST_NOTEBOOK=1 @@ -33,6 +35,7 @@ while [ $# -gt 0]; do ;; --) break; + ;; *) show_help exit 1 @@ -40,8 +43,7 @@ while [ $# -gt 0]; do esac done -set -euxo pipefail -if ! which pod-run >/dev/null; then +if ! which podrun >/dev/null; then SOME_TEMP_DIR=$(mktemp -d) trap 'rm -rf -- "$SOME_TEMP_DIR"' EXIT ( cd "$SOME_TEMP_DIR"; curl -LOs https://raw.githubusercontent.com/bjodah/dotfiles/master/per-leaf-dir/bin/podrun; chmod +x podrun ) @@ -63,8 +65,10 @@ fi if [ ! -d .env/venv ]; then python3 -m venv .env/venv fi -source .env/venv/activate +source .env/venv/bin/activate if ! python -c "import pycvodes" 2>&1 >/dev/null; then + python -m pip install --upgrade-strategy=eager --upgrade pip && \ + python -m pip install --upgrade-strategy=eager numpy 'cython>=3.0.10' setuptools && \ env \ PYCVODES_NO_LAPACK=1 \ PYCVODES_NO_KLU=1 \ @@ -72,18 +76,22 @@ if ! python -c "import pycvodes" 2>&1 >/dev/null; then python -m pip install --cache-dir .env/pypi-cache -e .[all] fi if ! python -c "import pyodesys" 2>&1 >/dev/null; then - pip install --cache-dir .env/pypi-cache -e .[all] - jupyter-nbextension enable --user --py widgetsnbextension + python -m pip install --cache-dir .env/pypi-cache -e .[all] + #jupyter-nbextension enable --user --py widgetsnbextension fi export MPLBACKEND=Agg EOF cat <$ENV_DIR/run-tests.sh +#!/bin/bash +set -e source .env/setup.sh pytest -sv -ra --pyargs $PKG_NAME EOF cat <$ENV_DIR/host-notebook.sh +#!/bin/bash +set -e source .env/setup.sh jupyter notebook --no-browser --port $PORT --ip=* index.ipynb EOF @@ -92,15 +100,11 @@ EOF if [ $RUN_TESTS = 1 ]; then podrun --cont-img-dir $SCRIPTS_DIR/environment \ --name "${PKG_NAME}_run_tests" \ - --image $DOCKERIMAGE \ - -- $ENV_DIR/run-tests.sh + -- bash $ENV_DIR/run-tests.sh fi if [ $HOST_NOTEBOOK = 1 ]; then podrun --cont-img-dir $SCRIPTS_DIR/environment \ --name "${PKG_NAME}_host_notebook_${PORT}" \ - --image $DOCKERIMAGE \ -p $LISTEN:$PORT:$PORT \ - -- $ENV_DIR/host-notebook.sh + -- bash $ENV_DIR/host-notebook.sh fi - - diff --git a/setup.py b/setup.py index 84529cc3..5c0bfb27 100755 --- a/setup.py +++ b/setup.py @@ -128,7 +128,7 @@ def _path_under_setup(*args): "sympy>=1.1.1,!=1.2", "quantities>=0.12.1", "pyneqsys>=0.5.5", - "pyodesys>=0.14.3" if sys.version_info[0] >= 3 else "pyodesys<0.12", + "pyodesys>=0.14.4" if sys.version_info[0] >= 3 else "pyodesys<0.12", "pyparsing>=2.0.3", "sym>=0.3.4", "pulp>=1.6.8",