Skip to content

Commit 494ce4e

Browse files
authored
Patch release preparation (#35)
* Bump numpy version, update CI pip cache * Try intalling newer PETSc/SLEPc versions on CI * Pin versions in tox.ini * Fix pins * Remove redundant CI step * Try remove arpack for macOS * Try using 3.9 on macOS * Temp. disable PETSc/SLEPc on macOS
1 parent 3c52a39 commit 494ce4e

4 files changed

Lines changed: 35 additions & 55 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,7 @@ on:
1313
- main
1414

1515
jobs:
16-
init:
17-
runs-on: ubuntu-latest
18-
outputs:
19-
skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
20-
steps:
21-
- uses: actions/checkout@v2
22-
with:
23-
fetch-depth: 0
24-
- id: ci-skip-step
25-
uses: mstachniuk/ci-skip@master
26-
with:
27-
commit-filter: '[ci skip];[ci-skip];[skip ci];[skip-ci]'
28-
commit-filter-separator: ';'
29-
3016
lint:
31-
needs: init
32-
if: ${{ github.event_name == 'schedule' || needs.init.outputs.skip == 'false' }}
3317
runs-on: ubuntu-latest
3418
steps:
3519
- uses: actions/checkout@v2
@@ -43,7 +27,7 @@ jobs:
4327
- uses: actions/cache@v2
4428
with:
4529
path: ~/.cache/pre-commit
46-
key: precommit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
30+
key: precommit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
4731
restore-keys: |
4832
precommit-${{ env.pythonLocation }}-
4933
@@ -58,8 +42,6 @@ jobs:
5842
tox -e lint,check-docs,readme
5943
6044
test:
61-
needs: init
62-
if: ${{ github.event_name == 'schedule' || needs.init.outputs.skip == 'false' }}
6345
runs-on: ${{ matrix.os }}
6446
strategy:
6547
fail-fast: false
@@ -73,15 +55,16 @@ jobs:
7355
python: 3.8
7456
use_slepc: true
7557
- os: macos-latest
76-
python: 3.7
77-
use_slepc: true
58+
python: 3.9
59+
# TODO(michalk8): enable this in the future (problem/missing mpif90)
60+
use_slepc: false
7861
- os: macos-latest
7962
python: 3.8
8063
use_slepc: false
8164
env:
82-
# for macOS only, make sure to pin this in tox.ini as well
83-
PC_VERSION: 3.13.5 # PETSc version
84-
SC_VERSION: 3.13.2 # SLEPc version
65+
# make sure to pin this in tox.ini as well
66+
PC_VERSION: 3.15.4 # PETSc version
67+
SC_VERSION: 3.15.2 # SLEPc version
8568

8669
steps:
8770
- uses: actions/checkout@v2
@@ -93,11 +76,11 @@ jobs:
9376
python-version: ${{ matrix.python }}
9477

9578
- name: Export environment variables
96-
if: matrix.use_slepc == true && runner.os == 'macOS'
79+
if: matrix.use_slepc == true
9780
run: |
9881
echo "PETSC_DIR=$HOME/petsc-$PC_VERSION" >> $GITHUB_ENV
9982
echo "SLEPC_DIR=$HOME/slepc-$SC_VERSION" >> $GITHUB_ENV
100-
echo "PETSC_ARCH=arch-darwin-c-opt" >> $GITHUB_ENV
83+
echo "PETSC_ARCH=arch-$RUNNER_OS-c-opt" >> $GITHUB_ENV
10184
- name: Install PETSc/SLEPc dev dependencies
10285
if: matrix.use_slepc == true
10386
run: |
@@ -112,8 +95,6 @@ jobs:
11295
with:
11396
path: ${{ steps.pip-cache-dir.outputs.dir }}
11497
key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt') }}
115-
restore-keys: |
116-
pip-${{ runner.os }}-${{ env.pythonLocation }}-
11798

11899
- name: Install pip dependencies
119100
run: |

.scripts/ci/install_dependencies.sh

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail
44

5-
function install_petsc_macos {
5+
function install_petsc {
66
curl -O "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-$PC_VERSION.tar.gz"
77
tar -xzf "petsc-lite-$PC_VERSION.tar.gz"
88
pushd "petsc-$PC_VERSION"
@@ -15,42 +15,41 @@ function install_petsc_macos {
1515
popd
1616
}
1717

18-
function install_slepc_macos {
18+
function install_slepc {
1919
curl -O "https://slepc.upv.es/download/distrib/slepc-$SC_VERSION.tar.gz"
2020
tar -xzf "slepc-$SC_VERSION.tar.gz"
2121
pushd "slepc-$SC_VERSION"
2222

23-
./configure --with-arpack-dir=/usr/local/Cellar/arpack
23+
./configure
2424
make all
2525
make check
2626
# make install # only to move into the appropriate location
2727

2828
popd
2929
}
3030

31-
3231
if [[ "$RUNNER_OS" == "Linux" ]]; then
3332
echo "Installing PETSc/SLEPc dependencies for Linux"
3433
sudo apt-get update -y
35-
sudo apt-get install gcc gfortran libopenmpi-dev libblas-dev liblapack-dev petsc-dev slepc-dev -y
34+
sudo apt-get install gcc gfortran libopenmpi-dev libblas-dev liblapack-dev -y
3635
elif [[ "$RUNNER_OS" == "macOS" ]]; then
37-
echo "Installing PETSc/SLEPc with SLEPc dir: '$SLEPC_DIR', PETSc dir: '$PETSC_DIR', PETSc arch: '$PETSC_ARCH'"
38-
pushd "$HOME"
39-
4036
brew install gcc open-mpi openblas lapack arpack
41-
install_petsc_macos
42-
install_slepc_macos
43-
44-
popd
45-
46-
# this seems to be only necessary on the CI
47-
echo "Symlinking numpy"
48-
python -m pip install --upgrade pip
49-
pip install numpy
50-
51-
NUMPY_INCLUDE="$(python -c 'import numpy; print(numpy.get_include())')"
52-
ln -sfv "$NUMPY_INCLUDE/numpy" "$PETSC_DIR/$PETSC_ARCH/include"
5337
else
54-
echo "Invalid OS for PETSc/SLEPc dependencies: $OS"
38+
echo "Invalid OS for PETSc/SLEPc dependencies: '$OS'"
5539
exit 42
5640
fi
41+
42+
echo "Installing PETSc/SLEPc with SLEPc dir: '$SLEPC_DIR', PETSc dir: '$PETSC_DIR', PETSc arch: '$PETSC_ARCH'"
43+
44+
pushd "$HOME"
45+
install_petsc
46+
install_slepc
47+
popd
48+
49+
# this seems to be only necessary on the CI
50+
echo "Installing and symlinking numpy"
51+
python -m pip install --upgrade pip
52+
pip install numpy
53+
54+
NUMPY_INCLUDE="$(python -c 'import numpy; print(numpy.get_include())')"
55+
ln -sfv "$NUMPY_INCLUDE/numpy" "$PETSC_DIR/$PETSC_ARCH/include"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
docrep>=0.3.1
22
# https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule
3-
numpy>=1.15.0
3+
numpy>=1.17.0
44
# https://github.com/scipy/scipy/releases/tag/v1.5.0
55
scipy>=1.5.0

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ deps =
109109
pytest-cov
110110
pytest-mock
111111
# we manually install PETSc and SLEPc on the CI from source and the [dev] installation causes problems
112-
macos-slepc: mpi4py>=3.0.3,<3.1
113-
macos-slepc: petsc4py>=3.13,<3.14
114-
macos-slepc: slepc4py>=3.13,<3.14
115-
extras =
116-
linux-slepc: slepc
112+
slepc: mpi4py>=3.0.3
113+
slepc: petsc==3.15.4
114+
slepc: petsc4py==3.15.1
115+
slepc: slepc==3.15.2
116+
slepc: slepc4py==3.15.1
117117
passenv = TOXENV CI CODECOV_* GITHUB_ACTIONS PETSC_* SLEPC_*
118118
usedevelop = true
119119
commands = python -m pytest --cov --cov-append --cov-report=term-missing --cov-config={toxinidir}/tox.ini --ignore docs/ {posargs:-vv}

0 commit comments

Comments
 (0)