Skip to content

Commit

Permalink
test up to python 3.12 (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
dionhaefner authored Nov 8, 2023
1 parent 672ed74 commit e89e23d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

matrix:
os: [ubuntu-20.04]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
backend: [numpy, jax]

env:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
id: pyom2-cache
with:
path: ${{ env.PYOM2_DIR }}/py_src/*.so
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('vendor/pyom2/patches/*.patch') }}-${{ hashFiles('requirements.txt') }}
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('vendor/pyom2/**/*') }}-${{ hashFiles('requirements.txt') }}

- name: Restore PETSc build cache
uses: actions/cache@v2
Expand All @@ -67,13 +67,13 @@ jobs:
- name: Setup Python environment
run: |
python -m pip install --upgrade pip
pip install wheel
pip install setuptools wheel
pip install cython
- name: Install system requirements
run: |
sudo apt-get update
sudo apt-get install libopenmpi-dev
sudo apt-get install libopenmpi-dev liblapack-dev libblas-dev
- name: Build PETSc
if: steps.petsc-cache.outputs.cache-hit != 'true'
Expand All @@ -94,7 +94,7 @@ jobs:
else
pip install -e .[test]
fi
pip install petsc4py==$PETSC_VERSION --no-deps
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
Expand All @@ -103,13 +103,19 @@ jobs:
mkdir -p $PYOM2_DIR
cp -r vendor/pyom2/* $PYOM2_DIR
pushd $PYOM2_DIR
mv pyOM2_site_specific site_specific.mk_
if [ ${{ matrix.python-version }} == "3.8" ]
then
mv pyOM2_site_specific_distutils site_specific.mk_
else
pip install meson ninja
mv pyOM2_site_specific_meson site_specific.mk_
fi
tar xzf pyOM2.1.0.tar.gz
git init
for patchfile in ./patches/*.patch; do
git apply --whitespace=fix $patchfile
done
make -C py_src -j 4 > /dev/null
make -C py_src -j 4
popd
- name: Export paths
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
nocc: [false]

include:
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions vendor/pyom2/pyOM2_site_specific_meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# fortran front end
F90 = mpif90
CDFFLAGS = $(shell nf-config --fflags --flibs)
MPIFLAGS =
F90FLAGS = -llapack -lblas -fconvert=big-endian -O3 -Wall #-check bounds

# python front end
F2PYFLAGS = --backend meson --dep lapack
F2PY_MPIFLAGS = --dep mpi

0 comments on commit e89e23d

Please sign in to comment.