diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f455d9e..32a3ee2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,9 +46,8 @@ jobs: uses: prefix-dev/setup-pixi@v0.8.1 - name: Run mypy run: | - pixi run jupyter nbconvert --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags no-convert --to script docs/examples/*.ipynb - for file in docs/examples/*.txt; do mv -- "$file" "${file%.txt}.py"; done - pixi run mypy docs/examples/*.py + pixi run nb-convert + pixi run nb-mypy unit-tests: name: Unit Tests diff --git a/nb-convert.sh b/nb-convert.sh new file mode 100755 index 0000000..e6da4ef --- /dev/null +++ b/nb-convert.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +jupyter nbconvert --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags no-convert --to script docs/examples/*.ipynb && +for file in docs/examples/*.txt; +do mv -- "$file" "${file%.txt}.py"; +done diff --git a/pixi.toml b/pixi.toml index ff5a975..16f3608 100644 --- a/pixi.toml +++ b/pixi.toml @@ -6,6 +6,9 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tasks] postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ." coverage = "pytest tests --cov=metalearners --cov-report=xml --cov-report term-missing --color=yes" +# Note that this task will fail on systems without bash. +nb-convert = "nb-convert.sh" +nb-mypy = "mypy docs/examples/*.py" [dependencies] pre-commit = "*"