Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 1.86 KB

File metadata and controls

76 lines (51 loc) · 1.86 KB

Getting started with development

django-rusty-templates is written in Rust, so you'll need to install the Rust toolchain.

Option 1: Using uv

uv is a fast Python package installer and resolver. Using it will significantly speed up dependency installation.

First, install uv:

$ curl -LsSf https://astral.sh/uv/install.sh | sh

Then sync the dependencies and activate the automatically created virtual env:

$ uv sync
$ source .venv/bin/activate

Option 2: Using standard Python tools

If you prefer not to use uv, you can set up your development environment with standard Python tools:

$ python -m venv .venv
$ source .venv/bin/activate
$ pip install --group dev

Note: The [dev] dependency group is defined in pyproject.toml and includes all necessary development dependencies.

Running tests

To run the Python tests, build Django Rusty Templates in develop mode with maturin and then run pytest. Each change in rust needs a new execution of maturin develop.

$ maturin develop
$ pytest

You can also run the Rust tests:

$ cargo test

If you get an ImportError from python, you may need to set the PYTHONPATH environment variable:

export PYTHONPATH=/path/to/venv/lib/python3.x/site-packages

Pre-commit hooks

You can optionally install pre-commit hooks to automatically run some validation checks when making a commit:

$ pip install pre-commit  # or: uv tool install pre-commit
$ pre-commit install

Coverage

When submitting a PR we check coverage. You can check coverage locally by running a command from the justfile:

$ just python-coverage
$ just rust-coverage
$ just rust-coverage-browser

You will need Just installed.