From 012c524700d533e84951801dada83d545abfc254 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 00:20:52 +0000 Subject: [PATCH 01/10] Bump numpy from 1.26.4 to 2.2.0 Bumps [numpy](https://github.com/numpy/numpy) from 1.26.4 to 2.2.0. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.26.4...v2.2.0) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 48f0c4f6..7eb34f8b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ click==8.1.7 entrypoints==0.4 requests==2.32.3 -numpy==1.26.4 +numpy==2.2.0 scipy==1.14.1 h5netcdf==1.4.1 h5py==3.12.1 From 41b4cd5da533aea45f87de3c045bf5fede0d72f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 9 Dec 2024 09:19:20 +0100 Subject: [PATCH 02/10] use older numpy for older python --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 7eb34f8b..5fd46aa0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ click==8.1.7 entrypoints==0.4 requests==2.32.3 numpy==2.2.0 +numpy==1.26.4; python_version < '3.10' scipy==1.14.1 h5netcdf==1.4.1 h5py==3.12.1 From e1d0acf7a4f19c5f1eff70ec361acc5a964dd8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 9 Dec 2024 10:35:43 +0100 Subject: [PATCH 03/10] better reqs parsing --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a723876f..1b9ad4d5 100644 --- a/setup.py +++ b/setup.py @@ -61,16 +61,21 @@ def parse_requirements(reqfile): with open(os.path.join(here, reqfile), encoding="utf-8") as f: for line in f: line = line.strip() - pkg = re.match(r"(\w+)\b.*", line).group(1) + parsed = re.match(r"(\w+)(.*?)(;.*)?$", line) + pkg, deps, extra = parsed.groups() + if extra is None: + extra = "" + deps = deps.replace("==", "<=") if pkg in MINIMUM_VERSIONS: - line = "".join([line, ",>=", MINIMUM_VERSIONS[pkg]]) - line = line.replace("==", "<=") + deps = f"{deps},>={MINIMUM_VERSIONS[pkg]}" + line = "".join([pkg, deps, extra]) requirements.append(line) return requirements INSTALL_REQUIRES = parse_requirements("requirements.txt") +print(INSTALL_REQUIRES) jax_req = parse_requirements("requirements_jax.txt") From 284a13c8b3a189f8da21339779517330dda69689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 9 Dec 2024 14:09:59 +0100 Subject: [PATCH 04/10] install petsc from pypi --- .github/workflows/test-all.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index c320f750..31055c27 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -23,7 +23,7 @@ jobs: env: PYOM2_DIR: /home/runner/pyom2 - PETSC_VERSION: "3.20.0" + PETSC_VERSION: "3.22.1" PETSC_DIR: /home/runner/petsc PETSC_ARCH: arch-linux-c-opt OMPI_MCA_rmaps_base_oversubscribe: "1" @@ -57,12 +57,12 @@ jobs: path: ${{ env.PYOM2_DIR }}/py_src/*.so key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('vendor/pyom2/**/*') }}-${{ hashFiles('requirements.txt') }} - - name: Restore PETSc build cache - uses: actions/cache@v2 - id: petsc-cache - with: - path: ${{ env.PETSC_DIR }} - key: ${{ matrix.os }}-${{ env.PETSC_VERSION }} + # - name: Restore PETSc build cache + # uses: actions/cache@v2 + # id: petsc-cache + # with: + # path: ${{ env.PETSC_DIR }} + # key: ${{ matrix.os }}-${{ env.PETSC_VERSION }} - name: Setup Python environment run: | @@ -75,14 +75,14 @@ jobs: sudo apt-get update sudo apt-get install libopenmpi-dev liblapack-dev libblas-dev - - name: Build PETSc - if: steps.petsc-cache.outputs.cache-hit != 'true' - run: | - git clone -b v$PETSC_VERSION --depth 1 https://gitlab.com/petsc/petsc.git $PETSC_DIR - pushd $PETSC_DIR - ./configure --with-debugging=0 -with-shared-libraries --with-precision=double - make all - popd + # - name: Build PETSc + # if: steps.petsc-cache.outputs.cache-hit != 'true' + # run: | + # git clone -b v$PETSC_VERSION --depth 1 https://gitlab.com/petsc/petsc.git $PETSC_DIR + # pushd $PETSC_DIR + # ./configure --with-debugging=0 -with-shared-libraries --with-precision=double + # make all + # popd - name: Install Veros run: | @@ -94,7 +94,7 @@ jobs: else pip install -e .[test] fi - pip install petsc4py==$PETSC_VERSION --no-deps --no-build-isolation + pip install petsc==$PETSC_VERSION petsc4py==$PETSC_VERSION --no-deps --no-build-isolation # Build PyOM2 after Veros to make sure we have compatible versions of NumPy / f2py - name: Build PyOM2 From 3a5fcf7ce269168bd991f18ef0acc18ea28afcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 9 Dec 2024 14:27:13 +0100 Subject: [PATCH 05/10] wip --- .github/workflows/test-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 31055c27..a5cf5a67 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -24,8 +24,8 @@ jobs: env: PYOM2_DIR: /home/runner/pyom2 PETSC_VERSION: "3.22.1" - PETSC_DIR: /home/runner/petsc - PETSC_ARCH: arch-linux-c-opt + # PETSC_DIR: /home/runner/petsc + # PETSC_ARCH: arch-linux-c-opt OMPI_MCA_rmaps_base_oversubscribe: "1" OMPI_MCA_mpi_yield_when_idle: "1" VEROS_REQUIRE_CYTHON_EXT: "1" From f172d31f878357145ad0e38a30254750bc19318b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 9 Dec 2024 14:34:08 +0100 Subject: [PATCH 06/10] wip --- .github/workflows/test-all.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index a5cf5a67..7055014f 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -94,7 +94,8 @@ jobs: else pip install -e .[test] fi - pip install petsc==$PETSC_VERSION petsc4py==$PETSC_VERSION --no-deps --no-build-isolation + pip install petsc==$PETSC_VERSION --no-deps --no-build-isolation + pip install petsc4py==$PETSC_VERSION --no-deps --no-build-isolation # Build PyOM2 after Veros to make sure we have compatible versions of NumPy / f2py - name: Build PyOM2 From a5bc13845d6cf6ce62687c5819a5a3d25c62abdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 10 Dec 2024 13:52:15 +0100 Subject: [PATCH 07/10] wip --- .github/workflows/test-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 7055014f..14bad2fa 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -94,8 +94,8 @@ jobs: else pip install -e .[test] fi - pip install petsc==$PETSC_VERSION --no-deps --no-build-isolation - pip install petsc4py==$PETSC_VERSION --no-deps --no-build-isolation + pip install petsc==$PETSC_VERSION --no-build-isolation + pip install petsc4py==$PETSC_VERSION --no-build-isolation # Build PyOM2 after Veros to make sure we have compatible versions of NumPy / f2py - name: Build PyOM2 From be4cc530718e20b25e8d8f7b43098d3a52730245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 10 Dec 2024 14:15:23 +0100 Subject: [PATCH 08/10] wip --- .github/workflows/test-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 14bad2fa..f6b9944e 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -86,10 +86,10 @@ jobs: - name: Install Veros run: | - pip install mpi4py + pip install "mpi4py<4" if [ ${{ matrix.backend }} == "jax" ] then - pip install mpi4jax + pip install mpi4jax --no-build-isolation pip install -e .[test,jax] else pip install -e .[test] From fe3c1568b42e56414a3a49343887e2d2a0f3f7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 10 Dec 2024 14:15:33 +0100 Subject: [PATCH 09/10] wip --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index f6b9944e..6b1f5643 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -121,7 +121,7 @@ jobs: - name: Run tests run: | - pytest . -v --cov --pyom2-lib $PYOM2_LIB --backend ${{ matrix.backend }} + pytest . -x -v --cov --pyom2-lib $PYOM2_LIB --backend ${{ matrix.backend }} - name: Upload coverage uses: codecov/codecov-action@v1 From abeb30b87b04e46a5b75452a7935cf87c2a38be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 10 Dec 2024 14:34:24 +0100 Subject: [PATCH 10/10] cleanup --- .github/workflows/test-all.yml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 6b1f5643..afa0c1ac 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -24,8 +24,6 @@ jobs: env: PYOM2_DIR: /home/runner/pyom2 PETSC_VERSION: "3.22.1" - # PETSC_DIR: /home/runner/petsc - # PETSC_ARCH: arch-linux-c-opt OMPI_MCA_rmaps_base_oversubscribe: "1" OMPI_MCA_mpi_yield_when_idle: "1" VEROS_REQUIRE_CYTHON_EXT: "1" @@ -57,13 +55,6 @@ jobs: path: ${{ env.PYOM2_DIR }}/py_src/*.so key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('vendor/pyom2/**/*') }}-${{ hashFiles('requirements.txt') }} - # - name: Restore PETSc build cache - # uses: actions/cache@v2 - # id: petsc-cache - # with: - # path: ${{ env.PETSC_DIR }} - # key: ${{ matrix.os }}-${{ env.PETSC_VERSION }} - - name: Setup Python environment run: | python -m pip install --upgrade pip @@ -75,25 +66,20 @@ jobs: sudo apt-get update sudo apt-get install libopenmpi-dev liblapack-dev libblas-dev - # - name: Build PETSc - # if: steps.petsc-cache.outputs.cache-hit != 'true' - # run: | - # git clone -b v$PETSC_VERSION --depth 1 https://gitlab.com/petsc/petsc.git $PETSC_DIR - # pushd $PETSC_DIR - # ./configure --with-debugging=0 -with-shared-libraries --with-precision=double - # make all - # popd - - name: Install Veros run: | - pip install "mpi4py<4" if [ ${{ matrix.backend }} == "jax" ] then - pip install mpi4jax --no-build-isolation pip install -e .[test,jax] else pip install -e .[test] fi + + - name: Install optional requirements + run: | + # PETSc has issues with mpi4py v4 + pip install "mpi4py<4" + pip install mpi4jax --no-build-isolation pip install petsc==$PETSC_VERSION --no-build-isolation pip install petsc4py==$PETSC_VERSION --no-build-isolation @@ -121,7 +107,7 @@ jobs: - name: Run tests run: | - pytest . -x -v --cov --pyom2-lib $PYOM2_LIB --backend ${{ matrix.backend }} + pytest . -v --cov --pyom2-lib $PYOM2_LIB --backend ${{ matrix.backend }} - name: Upload coverage uses: codecov/codecov-action@v1