Development

You need git and uv to work on django-slugify-processor. Install uv from the installation documentation if it is not already available.

Clone the repository:

$ git clone https://github.com/tony/django-slugify-processor.git
$ cd django-slugify-processor

Install packages:

$ uv sync --all-extras --dev

Codebase Map

The slugification behavior lives in src/django_slugify_processor/text.py. Template integration lives in src/django_slugify_processor/templatetags/slugify_processor.py, which delegates to the same Python helper so templates and Python code do not diverge.

Tests live in tests/, with importable example processors in test_app/. Documentation pages live in docs/; API pages are generated from docstrings, and runnable docs examples are checked by the docs/ doctest recipe.

Tests

Run the test suite directly:

$ uv run py.test

Or use the just helper:

$ just test

Automatically run tests on file save

Use pytest-watcher:

$ just start

Or use entr(1):

$ just watch-test

Documentation

Default preview server: http://localhost:8034

sphinx-autobuild will automatically build the docs, watch for file changes and launch a server.

From the repository root:

$ just start-docs

From inside docs/:

$ just start

Manual documentation (the hard way)

Build from inside docs/:

$ cd docs && just html

Start the documentation server from inside docs/:

$ cd docs && just serve

Helpers:

$ just build-docs
$ just serve-docs

Rebuild docs on file change:

$ just watch-docs

This requires entr(1).

Rebuild docs and run the server from one terminal:

$ just dev-docs

Formatting / Linting

Linting and Formatting

The project uses ruff to handle formatting, sorting imports and linting.

uv:

$ uv run ruff check .

If you setup manually:

$ ruff check .
$ just ruff
$ just watch-ruff

requires entr(1).

uv:

$ uv run ruff check . --fix

If you setup manually:

$ ruff check . --fix

Formatting

ruff format is used for formatting.

uv:

$ uv run ruff format .

If you setup manually:

$ ruff format .
$ just ruff-format

Type Checking

mypy is used for static type checking.

uv:

$ uv run mypy .

If you setup manually:

$ mypy .
$ just mypy
$ just watch-mypy

requires entr(1).

Releasing

uv handles virtualenv creation, package requirements, versioning, building, and publishing. Therefore there is no setup.py or requirements files.

See Releasing for the release checklist. Update django_slugify_processor.__version__ in src/django_slugify_processor/__about__.py and version in pyproject.toml, then commit the release:

$ git commit -m 'Tag v0.1.1'