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+ " pre-commit==4.3.0" ,
46+ " pytest==8.4.2" ,
47+ " pytest-mypy-plugins==3.2.0" ,
48+ " djangorestframework==3.16.1" ,
49+ " types-pytz==2025.2.0.20250809" ,
50+ " types-requests==2.32.4.20250913" ,
51+ " types-urllib3==1.26.25.14" ,
52+ " types-Pygments==2.19.0.20250809" ,
53+ " types-pyyaml==6.0.12.20250915" ,
54+ " django-stubs[compatible-mypy] @ git+https://github.com/typeddjango/django-stubs" ,
55+ " django-stubs-ext @ git+https://github.com/typeddjango/django-stubs#subdirectory=ext" ,
56+ " djangorestframework-stubs[compatible-mypy,coreapi,markdown]" ,
57+ ]
58+
59+ [build-system ]
60+ requires = [" uv_build>=0.8.19,<0.9.0" ]
61+ build-backend = " uv_build"
62+
63+ [tool .uv .build-backend ]
64+ module-name = [" rest_framework-stubs" , " mypy_drf_plugin" ]
65+ module-root = " "
66+
67+ [tool .pytest .ini_options ]
68+ pythonpath = [" ." ]
69+ testpaths = [" tests" ]
70+ addopts = [
71+ " --tb=native" ,
72+ " -s" ,
73+ " -v" ,
74+ " --cache-clear" ,
75+ " --mypy-extension-hook=scripts.tests_extension_hook.django_plugin_hook" ,
76+ # Suppress errors from other packages due to https://github.com/typeddjango/pytest-mypy-plugins/issues/134
77+ " --mypy-only-local-stub" ,
78+ " --mypy-ini-file=mypy.ini"
79+ ]
80+
81+ # Ruff configuration
182[tool .ruff ]
283line-length = 120
384target-version = " py310"
85+
486# See Rules in Ruff documentation: https://docs.astral.sh/ruff/rules/
587[tool .ruff .lint ]
688select = [
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.
89+ " B" , # bugbear
90+ " E" , # pycodestyle
91+ " F" , # pyflakes
92+ " INP" , # flake8-tidy-imports
93+ " W" , # pycodestyle
94+ " I" , # isort
95+ " UP" , # pyupgrade
96+ " TID251" , # Disallowed imports (flake8-tidy-imports.banned-api)
97+ " PYI" , # flake8-pyi
98+ " RUF100" , # Equivalent to flake8-noqa NQA103
99+ " PGH004" , # Equivalent to flake8-noqa NQA104
100+ " PGH003" , # Disallowed blanket `type: ignore` annotations.
19101]
20102ignore = [" PYI021" , " PYI024" , " PYI041" , " PYI043" ]
21103
22104[tool .ruff .lint .per-file-ignores ]
23105"*.pyi" = [
24- " B" ,
25- " E501" ,
26- " E741" ,
27- " E743" ,
28- " F403" , # Use wildcard import
29- " F405" ,
30- " F822" ,
31- " F821" ,
106+ " B" ,
107+ " E501" ,
108+ " E741" ,
109+ " E743" ,
110+ " F403" , # Use wildcard import
111+ " F405" ,
112+ " F822" ,
113+ " F821" ,
32114]
33115"rest_framework-stubs/compat.pyi" = [" PYI042" ]
34116
@@ -39,5 +121,12 @@ ignore = ["PYI021", "PYI024", "PYI041", "PYI043"]
39121split-on-trailing-comma = false
40122extra-standard-library = [" _typeshed" ]
41123
42- [build-system ]
43- requires = [" setuptools<79.0.0" , " wheel" ]
124+
125+ [tool .django-stubs ]
126+ django_settings_module = " scripts.drf_tests_settings"
127+
128+ # Pyright configuration
129+ [tool .pyright ]
130+ pythonVersion = " 3.10"
131+ include = [" rest_framework-stubs" , " tests" ]
132+ exclude = [" .venv" , " .mypy_cache" , " .pytest_cache" , " .idea" ]
0 commit comments