Skip to content

Commit 1c5e257

Browse files
authored
Test notebooks with a separate CI workflow (#151)
* Move test-notebooks job to a new workflow * Fix read_esri_ascii import * Fix requested version * Skip testing terrainbento and pymt notebooks * Clean up list of ignored notebooks
1 parent 7277567 commit 1c5e257

File tree

5 files changed

+37
-32
lines changed

5 files changed

+37
-32
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test Notebooks
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
test-notebooks:
8+
9+
if:
10+
github.event_name == 'push' ||
11+
github.event.pull_request.head.repo.full_name != github.repository
12+
13+
name: Test the notebooks
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: conda-incubator/setup-miniconda@v3
19+
with:
20+
python-version: "3.11"
21+
miniforge-variant: Miniforge3
22+
miniforge-version: latest
23+
auto-update-conda: true
24+
25+
- name: Install nox
26+
run: pip install nox
27+
28+
- name: Test
29+
env:
30+
MPLBACKEND: "Agg"
31+
OPENTOPOGRAPHY_API_KEY: ${{ secrets.OPENTOPOGRAPHY_API_KEY }}
32+
run: nox -s test-notebooks --python "3.11"

.github/workflows/test.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,3 @@ jobs:
3737

3838
- name: Test
3939
run: nox -s test
40-
41-
test-notebooks:
42-
43-
if:
44-
github.event_name == 'push' ||
45-
github.event.pull_request.head.repo.full_name != github.repository
46-
47-
name: Test the notebooks
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@v4
51-
52-
- uses: conda-incubator/setup-miniconda@v3
53-
with:
54-
python-version: "3.11"
55-
miniforge-variant: Miniforge3
56-
miniforge-version: latest
57-
auto-update-conda: true
58-
59-
- name: Install nox
60-
run: pip install nox
61-
62-
- name: Test
63-
env:
64-
MPLBACKEND: "Agg"
65-
OPENTOPOGRAPHY_API_KEY: ${{ secrets.OPENTOPOGRAPHY_API_KEY }}
66-
run: nox -s test-notebooks --python "3.11"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repos:
7070
files: \.py$
7171

7272
- repo: https://github.com/mcflugen/heartfelt-hooks
73-
rev: v1.3.3
73+
rev: v0.3.3
7474
hooks:
7575
- id: check-whitespace
7676
# - id: check-mixed-case

lessons/landlab/landlab/overland_flow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"source": [
4141
"import numpy as np\n",
4242
"from landlab.components.overland_flow import OverlandFlow\n",
43-
"from landlab.io.esri_ascii import read_esri_ascii\n",
43+
"from landlab.io import read_esri_ascii\n",
4444
"from matplotlib.pyplot import figure"
4545
]
4646
},

pytest.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ addopts =
77
--strict-markers
88
--doctest-modules
99
-vvv
10+
--ignore=lessons/landlab/landlab-terrainbento
11+
--ignore=lessons/pymt
1012
--ignore-glob=*/practice-your-skills.ipynb
11-
--ignore-glob=*/Welcome_to_TerrainBento.ipynb
12-
--ignore-glob=*/bedrockLandslides_on_DEMs.ipynb
13+
--ignore-glob=*/bedrock_landslides_on_dems.ipynb
1314
--ignore-glob=*/ku-eml-paleomip.ipynb
1415
--ignore-glob=*/paleomip-processing.ipynb
1516
--ignore-glob=*/PFdepth-dependent-diffusion.ipynb
1617
--ignore-glob=*/create_a_component.ipynb
1718
--ignore-glob=*/landlab-fault-scarp-for-espin.ipynb
1819
--ignore-glob=*/intro-to-grids.ipynb
19-
--ignore-glob=*/pymt/*.ipynb
2020
--ignore-glob=*/python/yet_another_oop.ipynb

0 commit comments

Comments
 (0)