Skip to content

Commit

Permalink
Draft usage of pixi task for notebook analysis. (#87)
Browse files Browse the repository at this point in the history
* Draft usage of pixi task for notebook analysis.

* Move logic to bash script.

* Bring back the quotes.
  • Loading branch information
kklein authored Aug 27, 2024
1 parent fccde2c commit 14fef77
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ jobs:
uses: prefix-dev/[email protected]
- 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
Expand Down
8 changes: 8 additions & 0 deletions nb-convert.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "*"
Expand Down

0 comments on commit 14fef77

Please sign in to comment.