Skip to main content

Django semantic extension for ty-extended.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_ty-0.1.0-py3-none-any.whl (755.7 kB view details)

Uploaded Python 3

File details

Details for the file django_ty-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_ty-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 755.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}

File hashes

Hashes for django_ty-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47e2275eaa2487ca06538287239055d83615c374fbde47e6ccb758f2deaabbca
MD5 9c5f08ef9668b025f511dfd7ec5c1d62
BLAKE2b-256 55f9e2a323f1c3a3012cbaf58b51c425c3d2406c42d4539a6b81c6e1c9c501aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page