- Clone this repo
- Ensure python >= 3.7 is available on your system (it doesn't need to be the default installation)
- Install poetry
- Navigate your shell to the project direction
- Run
poetry env use 3.7(or 3.x for your version) to create a Python virtual environment - Run
poetry installto install dependencies in the environment - Run
poetry shellto shell into the virtual environment - Run
sh dev_scripts/install_devtools.shto install dependencies used to enforce code standards. - Test your environment by running
python examples/kitchen_sink.py - Install the pre-commit hook with
pre-commit install -f, then test it withpre-commit run --all-files.
The automated test suite is run using pytest. Simply call pytest to run the suite. The suite can be run much faster in parallel with pytest -n auto.
The examples folder also serves as a collection of visual tests for verifying graphical output. If your change affects these examples, please verify against them. When adding new graphical features, consider adding an example covering it.
The docs are built using Sphinx.
cd doc
make html # (On Windows, use the `make.bat` script)You can then serve the docs locally easily with python -m http.server -d doc/_build/html or by running sh dev_scripts/start_doc_server.sh.
Full builds require Graphviz available on your system path, but you can still work on the docs without it.
The pre-commit hook, installed as described above, will automatically apply formatting and import corrections. If corrections are needed, the hook will abort the commit and apply the needed changes, which you should then validate with a git diff, stage with a git add, and try committing again. PRs which fail these checks will not build successfully.