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.1.

The tested compatibility matrix covering django-ty, ty-extended, Django, and Python versions lives in docs/DJANGO-VERSIONS.md. Each Django line is probed against both the version-matched mypy + django-stubs comparison and the shipped wheel.

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. Auto-primary-key state follows construction, loading, saving, and deletion; aliases and branches are handled by ty-extended 0.84.4+.

Django's official documentation defines the expected behavior. All 166 assertions across 38 capabilities pass on the 18 supported Django/Python pairs from Django 5.0 through 6.1. Independent runtime checks cover 83 reviewed contracts and nine QueryDict assignment cases on each pair.

Mypy is a comparison tool. Its disagreements are listed with version-specific Django references and runtime evidence in the compatibility matrix. The disagreement audit explains upstream typing policies, historical feature gaps, and the fixes made after that review. CI rejects new unreviewed disagreements. The coverage map is generated from the same checks.

These results cover the tested corpus. They do not establish compatibility with every Django API, custom AppConfig label, or dynamically registered model.

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 discover -s tests
bash scripts/differential-conformance.sh --check
uv run --no-project --python 3.11 python scripts/probe_django_versions.py --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.1.1
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.5.0

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

Source distribution (sdist)

Source distribution for django-ty 0.5.0
File Size Uploaded Provenance Actions
django_ty-0.5.0.tar.gz 695.5 kB Without provenance Details for django_ty-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / django_ty-0.5.0.tar.gz

Download URL django_ty-0.5.0.tar.gz
Size 695.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c90a6e9a00eb8f6b7ee89c84b237dafc7cf072f281eec9222e3d5016428cc83e
BLAKE2b-256 checksum
How to use checksums
ab0672ada0041cb33563a65e262ccdad4fcf24e10aeadbdb5d4a969c247bcce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 files / django_ty-0.5.0-py3-none-any.whl

Download URL django_ty-0.5.0-py3-none-any.whl
Size 781.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1780bbb4f924608e01844834bc8bbc251d815c917bb512915189bd69e338c08a
BLAKE2b-256 checksum
How to use checksums
8b08146d4b032406398f5ce32619206d6f898307f1e0523ac23df497834a2d89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}

Security for django-ty 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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