Development#
TurboGraph uses the uv package manager for dependency management and packaging.
Setup#
First, install uv by following the official installation guide.
Once uv is installed, set up the project dependencies by running:
uv sync --all-extras --all-groups --no-install-project
This will install all dependencies, including development dependencies,
inside a virtual environment located at .venv.
Running Tests#
TurboGraph uses tox for testing, with uv handling the virtual environments.
Install Tox#
Before running tests, install tox along with the
tox-uv plugin:
uv tool install tox --with tox-uv
Available Test Commands#
Run all unit tests across multiple Python,
networkxandigraphversions:tox
Run tests with coverage analysis:
tox -e cov
Check code formatting and linting with
isortandrufftox -e lintcheck
Automatically fix linting and formatting issues with
isortandrufftox -e lintfix
Run static type checking with
mypytox -e typecheck
Check for spelling errors using
codespelltox -e spellcheck
Fix spelling errors automatically
tox -e spellfix
Build the documentation for the current branch
tox -e docbuild
These checks are automatically run by the GitLab CI/CD pipeline.
Pre-commit Hooks#
Developers may use pre-commit to enforce code quality before commits,
so that issues are caught early.
The following checks are run:
isort\(\to\) Import sorting.ruff\(\to\) Linting and code formatting.mypy\(\to\) Static type checking.codespell\(\to\) Spell checking.Dependency exports \(\to\) Update requirement files in the
requirements/directory.
pre-commit is already installed as a development dependency. To run all checks manually, use:
pre-commit run --all-files
If you wish to install the pre-commit hooks, run:
pre-commit install