Development
This page describes how to develop and contribute to jupygrader.
hatchis used as the build system.pytestis used as the test runner.mkdocsis used for the documentation site.
Test project
All tests are defined in the tests/ directory. To run all tests, you can use the following command:
hatch uses pytest as the test runner. You can parallelize the tests to speed up the testing process by using the -p flag (shorthand for --parallel), which will distribute the tests across multiple workers.
Print a code coverage table by using the --cover flag.
Tests that require an OpenAI API key
Test cases that require OpenAI API key and may incur costs are marked with the @pytest.mark.ai marker. By default, these tests are not run when you execute hatch test. To include these tests in the test run, use the -m ai option with hatch run pytest.
Generate a code coverage report
Build artifact
This creates a distribution package, which can be uploaded to PyPI.
- Source distribution (sdist):
dist\jupygrader-...tar.gz - Wheel distribution (wheel):
dist\jupygrader-...-py3-none-any.whl
Install the built package locally
Publish to PyPI
Alternatively, you can create a ~/.pypirc file with the token credentials.
~/.pypirc
Previewing documentation in development mode
Building documentation
Deploy Docs to GitHub Pages
This is automated by GitHub Actions, but can be used to manually deploy changes without pushing to the main branch.