diff --git a/pyproject.toml b/pyproject.toml index a3882d8b..2339bfb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,10 @@ dev = [ "black", "ruff", "pip-tools", + "pytest-cov", + "geopandas", + "matplotlib", + "shapely", "pytest-cov" ] diff --git a/requirements-dev.txt b/requirements-dev.txt index 912ffccd..36514b7b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,43 +4,80 @@ # # pip-compile --extra=dev --output-file=requirements-dev.txt # +attrs==23.2.0 + # via fiona black==23.10.1 # via wsimod (pyproject.toml) build==1.0.3 # via pip-tools +certifi==2023.11.17 + # via + # fiona + # pyproj cfgv==3.4.0 # via pre-commit click==8.1.7 # via # black + # click-plugins + # cligj + # fiona # pip-tools +click-plugins==1.1.1 + # via fiona +cligj==0.7.2 + # via fiona +contourpy==1.2.0 + # via matplotlib coverage[toml]==7.3.2 # via pytest-cov +cycler==0.12.1 + # via matplotlib dill==0.3.7 # via wsimod (pyproject.toml) distlib==0.3.7 # via virtualenv filelock==3.13.1 # via virtualenv +fiona==1.9.5 + # via geopandas +fonttools==4.47.0 + # via matplotlib +geopandas==0.14.2 + # via wsimod (pyproject.toml) identify==2.5.31 # via pre-commit iniconfig==2.0.0 # via pytest +kiwisolver==1.4.5 + # via matplotlib +matplotlib==3.8.2 + # via wsimod (pyproject.toml) mypy-extensions==1.0.0 # via black nodeenv==1.8.0 # via pre-commit numpy==1.26.2 - # via pandas + # via + # contourpy + # matplotlib + # pandas + # shapely packaging==23.2 # via # black # build + # geopandas + # matplotlib # pytest pandas==2.1.3 - # via wsimod (pyproject.toml) + # via + # geopandas + # wsimod (pyproject.toml) pathspec==0.11.2 # via black +pillow==10.2.0 + # via matplotlib pip-tools==7.3.0 # via wsimod (pyproject.toml) platformdirs==3.11.0 @@ -51,6 +88,10 @@ pluggy==1.3.0 # via pytest pre-commit==3.5.0 # via wsimod (pyproject.toml) +pyparsing==3.1.1 + # via matplotlib +pyproj==3.6.1 + # via geopandas pyproject-hooks==1.0.0 # via build pytest==7.4.3 @@ -60,7 +101,9 @@ pytest==7.4.3 pytest-cov==4.1.0 # via wsimod (pyproject.toml) python-dateutil==2.8.2 - # via pandas + # via + # matplotlib + # pandas pytz==2023.3.post1 # via pandas pyyaml==6.0.1 @@ -69,8 +112,14 @@ pyyaml==6.0.1 # wsimod (pyproject.toml) ruff==0.1.4 # via wsimod (pyproject.toml) +shapely==2.0.2 + # via + # geopandas + # wsimod (pyproject.toml) six==1.16.0 - # via python-dateutil + # via + # fiona + # python-dateutil tqdm==4.66.1 # via wsimod (pyproject.toml) tzdata==2023.3 diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py new file mode 100644 index 00000000..11d10a98 --- /dev/null +++ b/tests/test_tutorials.py @@ -0,0 +1,18 @@ +from pathlib import Path +from typing import List + +from pytest import mark + + +def available_tutorials() -> List[Path]: + """Locate the available tutorials in the docs.""" + base_path = Path(__file__).parent.parent / "docs" / "demo" + return [p for p in base_path.rglob("*.py")] + + +@mark.parametrize("tutorial", available_tutorials()) +def test_tutorials(tutorial): + import subprocess + import sys + + subprocess.run([sys.executable, tutorial]).check_returncode()