1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
[project]
name = "django-stubs"
version = "5.2.9"
description = "Mypy stubs for Django"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE.md"]
requires-python = ">=3.10"
authors = [
{ name = "Maksim Kurnikov", email = "maxim.kurnikov@gmail.com" },
]
maintainers = [
{ name = "Marti Raudsepp", email = "marti@juffo.org" },
{ name = "Nikita Sobolev", email = "mail@sobolevn.me" },
{ name = "Petter Friberg", email = "petter_friberg@hotmail.com" },
{ name = "Adam Johnson", email = "me@adamj.eu" },
]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
"Framework :: Django",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
]
dependencies = [
"django",
"django-stubs-ext>=5.2.9",
"tomli; python_version < '3.11'",
# Types:
"types-pyyaml",
"typing-extensions>=4.11.0",
]
[project.optional-dependencies]
compatible-mypy = ["mypy>=1.13,<1.20"]
oracle = ["oracledb"]
redis = ["redis", "types-redis"]
[dependency-groups]
tests = [
# Dev tools:
"pytest==9.0.2",
"pytest-mypy-plugins==3.2.0",
"pytest-shard==0.1.2",
"pytest-xdist==3.8.0",
# Django deps:
"django==5.2.10",
"mysqlclient==2.2.7",
"psycopg2-binary==2.9.11",
"jinja2==3.1.6",
"pyyaml==6.0.3",
# typing:
"django-stubs[compatible-mypy,oracle,redis]",
]
pyright = [
"pyright==1.1.408",
]
pyrefly = [
"pyrefly==0.48.0",
]
dev = [
{include-group = "tests"},
{include-group = "pyright"},
{include-group = "pyrefly"},
]
[project.urls]
Homepage = "https://github.com/typeddjango/django-stubs"
Funding = "https://github.com/sponsors/typeddjango"
"Release notes" = "https://github.com/typeddjango/django-stubs/releases"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
packages = ["django-stubs", "mypy_django_plugin"]
[tool.codespell]
ignore-words-list = "aadd,acount,nam,asend"
[tool.ruff]
# Adds to default excludes: https://ruff.rs/docs/settings/#exclude
line-length = 120
target-version = "py310"
[tool.ruff.lint]
# See Rules in Ruff documentation: https://beta.ruff.rs/docs/rules/
select = [
"B", # bugbear
"E", # pycodestyle
"F", # pyflakes
"FURB", # refurb
"INP", # flake8-tidy-imports
"W", # pycodestyle
"I", # isort
"ISC001", # Implicitly concatenated string literals on one line
"ISC002", # Implicitly concatenated string literals over multiple lines
"UP", # pyupgrade
"TID251", # Disallowed imports (flake8-tidy-imports.banned-api)
"PYI", # flake8-pyi
"RUF100", # Equivalent to flake8-noqa NQA103
"PGH004", # Equivalent to flake8-noqa NQA104
"PGH003", # Disallowed blanket `type: ignore` annotations.
"RET504", # Unnecessary assignment to {name} before return statement
"RET505", # Unnecessary {branch} after return statement
"RET506", # Unnecessary {branch} after raise statement
"RET507", # Unnecessary {branch} after continue statement
"RET508", # Unnecessary {branch} after break statement
"RUF", # Ruff specific rules
"TC", # flake8-type-checking
]
ignore = [
"PYI021", # We have a few meaningful docstrings for stubs only constructs/utilities.
"PYI041", # This might not be obvious that `float | int` is mostly equivalent to `float` typing wise | int | str
"PYI043",
]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = [
"B",
"E501",
"E741",
"E743",
"F403", # Use wildcard import
"F405",
"F822",
"F821",
]
"tests/*.py" = ["INP001", "PGH003", "RUF012"]
"ext/tests/*.py" = ["INP001"]
"setup.py" = ["INP001"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"_typeshed.Self".msg = "Use typing_extensions.Self (PEP 673) instead. If you type a metaclass, add a noqa"
"typing.assert_type".msg = "Only available in Python 3.11 and above. Use `typing_extensions.assert_type` instead."
"typing.Self".msg = "Only available in Python 3.11 and above. Use `typing_extensions.Self` instead."
[tool.ruff.lint.isort]
known-first-party = ["django_stubs_ext", "mypy_django_plugin"]
split-on-trailing-comma = false
|