Skip to main content

django-ty

django-ty adds Django ORM semantics to ty-extended. It installs Django, the checker runtime, and a packaged Django static API for Django 5.0-6.0.

Install

uv add django-ty

Installed plugin discovery is deliberately opt-in. Add this to the project configuration:

[tool.ty.plugins]
auto-discover = true

Then run:

uv run ty check .

No installer command, .ty directory, or file copy is needed.

Coverage

The complete pinned static API is packaged inside the wheel. No upstream django-stubs, django-stubs-ext, or mypy-plugin distribution is installed. Utilities supplied by django-stubs-ext, including WithAnnotations, are intentionally outside django-ty's product surface. django-ty handles Django model fields, forward and reverse relations, model-specific managers, queryset result types, values(), values_list(), basic annotate(), and literal lookup validation.

The measured feature parity is 100.0% against pinned mypy 2.1.0 with django-stubs 6.0.6: all 82 of 82 in-scope reference outcomes match. The exact behavior is in the compatibility map. It is generated by running both checkers against the same 82 assertions and is reproduced in CI. Hand-assigned statuses and weights are not used.

Development

uv run --no-project --python 3.11 python scripts/evaluate_django_stubs_coverage.py --check
uv run --no-project --python 3.11 python -m unittest tests/test_compatibility_value.py tests/test_evaluate_differential_conformance.py
bash scripts/differential-conformance.sh --check
cargo test --locked
cargo llvm-cov --locked --all-targets --summary-only --fail-under-lines 98
bash scripts/e2e.sh

To refresh the vendored static API from the reviewed pinned checkout:

uv run --no-project --python 3.11 python scripts/vendor_django_static_api.py --upstream-root /path/to/django-stubs-6.0.6
bash scripts/differential-conformance.sh --write
uv run --no-project --python 3.11 python scripts/evaluate_django_stubs_coverage.py --write --check

License

django-ty is licensed under the MIT License. By submitting a contribution for inclusion in django-ty, you agree that the contribution is licensed under the MIT License without additional terms or conditions.

Metadata

Release files for django-ty 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-ty 0.2.0
File Interpreter ABI Platform
django_ty-0.2.0-py3-none-any.whl Python 3 none any Details

Release files / django_ty-0.2.0-py3-none-any.whl

Download URL django_ty-0.2.0-py3-none-any.whl
Size 756.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
402d893f75e93acc15044866f868da4d3bac3b13109409889b7ba14f0b478522
BLAKE2b-256 checksum
How to use checksums
591b7884c485b17d30f2b698c8f31f5f75bfc7963c0316f2fd79d62bd7379fd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.0 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page