Run dev tasks

This project uses nox.

Since nox will be running inside of a poetry environment (to guarantee you are running the same version of nox as everyone else), we recommend adding the following alias to your .bashrc / .zshrc to save you some keystrokes:

alias prn='poetry run nox'

To run all checks:

prn # with alias
poetry run nox # without alias

Linting

To run linter:

prn -s lint # with alias
poetry run nox -s lint # without alias

Formatting

To run formatter:

prn -s format # with alias
poetry run nox -s format # without alias

Run the formatter with the --fix flag to autofix formatting:

prn -s format -- --fix # with alias
poetry run nox -s format -- --fix # without alias

Typechecks

To run typechecks:

prn -s typecheck # with alias
poetry run nox -s typecheck # without alias

Tests

To run all tests:

prn -s test # with alias
poetry run nox -s test # without alias

To run tests for a specific Python version e.g. 3.6:

prn -s test-3.6 # with alias
poetry run nox -s test-3.6 # without alias

See nox --list for more details.


To run specific tests, see these pytest docs and pass pytest args after -- e.g.:

prn -s test -- tests/unit/test_attribute.py # with alias
poetry run nox -s test -- tests/unit/test_attribute.py # without alias

Docs

To build the docs:

prn -s docs # with alias
poetry run nox -s docs # without alias

After docs are build, view them by:

open -a 'firefox' docs/_build/index.html # open in Firefox
open -a 'Google Chrome' docs/_build/index.html # open in Chrome