This guide is meant for contributors to the workshop materials. If you are a participant, you can ignore this section.
The development environment is similar to the installation instructions for the workshop.
Additionally, you will need to install the development dependencies (see in .github/workflows/ci.yml for the newest dependencies).
These are pytest and more to run the tutorial notebooks for testing and pre-commit to run some cleanup before committing.
uv pip install pytest pytest-xdist nbval pre-commitTo install the pre-commit hooks, run:
pre-commit installThis will run a few tests and notebook cleanups before you commit. You can also manually run the checks with:
pre-commit run -a # -a means run on all files, not just the ones you are committing. Not needed switchTo run the tests, you can use the following command:
pytest --nbval-lax --dist loadscope -n auto --ignore=session1where --nbval-lax will run the notebooks and check for errors, --dist loadscope -n auto will run the tests in parallel, and --ignore=session1 will ignore the first session tests (as an example).
If a notebook is supposed to have an exception, you can add a tag raises-exception to the cell that raises the exception. This will tell nbval to ignore that exception and treat the raise as a success.