1+ [project ]
2+ name = " djangorestframework-stubs"
3+ version = " 3.16.1"
4+ requires-python = " >=3.10"
5+ description = " Mypy stubs for Django"
6+ readme = " README.md"
7+ license = " MIT"
8+ license-files = [" LICENSE.txt" ]
9+ authors = [{
name =
" Maksim Kurnikov" ,
email =
" [email protected] " }]
10+ maintainers = [
11+ {
name =
" Marti Raudsepp" ,
email =
" [email protected] " },
12+ {
name =
" Nikita Sobolev" ,
email =
" [email protected] " },
13+ ]
14+ classifiers = [
15+ " License :: OSI Approved :: MIT License" ,
16+ " Operating System :: OS Independent" ,
17+ " Programming Language :: Python :: 3.10" ,
18+ " Programming Language :: Python :: 3.11" ,
19+ " Programming Language :: Python :: 3.12" ,
20+ " Programming Language :: Python :: 3.13" ,
21+ " Typing :: Typed" ,
22+ " Framework :: Django" ,
23+ ]
24+ dependencies = [
25+ " django-stubs>=5.2.5" ,
26+ " typing-extensions>=4.0" ,
27+ " requests>=2.0" ,
28+ " types-requests" ,
29+ " types-PyYAML" ,
30+ ]
31+
32+ [project .urls ]
33+ Homepage = " https://github.com/typeddjango/djangorestframework-stubs"
34+ Funding = " https://github.com/sponsors/typeddjango"
35+ "Release notes" = " https://github.com/typeddjango/djangorestframework-stubs/releases"
36+
37+ [project .optional-dependencies ]
38+ compatible-mypy = [" mypy>=1.13,<1.19" , " django-stubs[compatible-mypy]" ]
39+ coreapi = [" coreapi>=2.0.0" ]
40+ markdown = [" types-Markdown>=0.1.5" ]
41+
42+ [dependency-groups ]
43+ dev = [
44+ " wheel" ,
45+ " mypy==1.18.2" ,
46+ " pre-commit==4.3.0" ,
47+ " pytest==8.4.2" ,
48+ " pytest-mypy-plugins==3.2.0" ,
49+ " djangorestframework==3.16.1" ,
50+ " types-pytz==2025.2.0.20250809" ,
51+ " types-requests==2.32.4.20250913" ,
52+ " types-urllib3==1.26.25.14" ,
53+ " types-Pygments==2.19.0.20250809" ,
54+ " types-pyyaml==6.0.12.20250915" ,
55+ " django-stubs[compatible-mypy] @ git+https://github.com/typeddjango/django-stubs" ,
56+ " django-stubs-ext @ git+https://github.com/typeddjango/django-stubs#subdirectory=ext" ,
57+ " djangorestframework-stubs[compatible-mypy,coreapi,markdown]" ,
58+ ]
59+
60+ [build-system ]
61+ requires = [" uv_build>=0.8.19,<0.9.0" ]
62+ build-backend = " uv_build"
63+
64+ [tool .uv .build-backend ]
65+ module-name = [" rest_framework-stubs" , " mypy_drf_plugin" ]
66+ module-root = " "
67+
68+ [tool .pytest .ini_options ]
69+ pythonpath = [" ." ]
70+ testpaths = [" tests" ]
71+ addopts = [
72+ " --tb=native" ,
73+ " -s" ,
74+ " -v" ,
75+ " --cache-clear" ,
76+ " --mypy-extension-hook=scripts.tests_extension_hook.django_plugin_hook" ,
77+ # Suppress errors from other packages due to https://github.com/typeddjango/pytest-mypy-plugins/issues/134
78+ " --mypy-only-local-stub" ,
79+ " --mypy-ini-file=mypy.ini"
80+ ]
81+
82+ # Ruff configuration
183[tool .ruff ]
284line-length = 120
385target-version = " py310"
86+
487# See Rules in Ruff documentation: https://docs.astral.sh/ruff/rules/
588[tool .ruff .lint ]
689select = [
7- " B" , # bugbear
8- " E" , # pycodestyle
9- " F" , # pyflakes
10- " INP" , # flake8-tidy-imports
11- " W" , # pycodestyle
12- " I" , # isort
13- " UP" , # pyupgrade
14- " TID251" , # Disallowed imports (flake8-tidy-imports.banned-api)
15- " PYI" , # flake8-pyi
16- " RUF100" , # Equivalent to flake8-noqa NQA103
17- " PGH004" , # Equivalent to flake8-noqa NQA104
18- " PGH003" , # Disallowed blanket `type: ignore` annotations.
90+ " B" , # bugbear
91+ " E" , # pycodestyle
92+ " F" , # pyflakes
93+ " INP" , # flake8-tidy-imports
94+ " W" , # pycodestyle
95+ " I" , # isort
96+ " UP" , # pyupgrade
97+ " TID251" , # Disallowed imports (flake8-tidy-imports.banned-api)
98+ " PYI" , # flake8-pyi
99+ " RUF100" , # Equivalent to flake8-noqa NQA103
100+ " PGH004" , # Equivalent to flake8-noqa NQA104
101+ " PGH003" , # Disallowed blanket `type: ignore` annotations.
19102]
20103ignore = [" PYI021" , " PYI024" , " PYI041" , " PYI043" ]
21104
22105[tool .ruff .lint .per-file-ignores ]
23106"*.pyi" = [
24- " B" ,
25- " E501" ,
26- " E741" ,
27- " E743" ,
28- " F403" , # Use wildcard import
29- " F405" ,
30- " F822" ,
31- " F821" ,
107+ " B" ,
108+ " E501" ,
109+ " E741" ,
110+ " E743" ,
111+ " F403" , # Use wildcard import
112+ " F405" ,
113+ " F822" ,
114+ " F821" ,
32115]
33116"rest_framework-stubs/compat.pyi" = [" PYI042" ]
34117
@@ -39,5 +122,12 @@ ignore = ["PYI021", "PYI024", "PYI041", "PYI043"]
39122split-on-trailing-comma = false
40123extra-standard-library = [" _typeshed" ]
41124
42- [build-system ]
43- requires = [" setuptools<79.0.0" , " wheel" ]
125+
126+ [tool .django-stubs ]
127+ django_settings_module = " scripts.drf_tests_settings"
128+
129+ # Pyright configuration
130+ [tool .pyright ]
131+ pythonVersion = " 3.10"
132+ include = [" rest_framework-stubs" , " tests" ]
133+ exclude = [" .venv" , " .mypy_cache" , " .pytest_cache" , " .idea" ]
0 commit comments