forked from typeddjango/django-stubs
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathpyproject.toml
More file actions
111 lines (98 loc) · 3.17 KB
/
pyproject.toml
File metadata and controls
111 lines (98 loc) · 3.17 KB
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
[project]
name = "django-types"
version = "0.24.0"
description = "Type stubs for Django"
readme = "README.md"
authors = [{ name = "django-types team & contributors" }]
license = "MIT"
keywords = ["django", "types", "mypy", "stubs"]
requires-python = ">=3.10"
dependencies = ["types-psycopg2>=2.9.21.13"]
[project.urls]
Repository = "https://github.com/sbdchd/django-types"
[dependency-groups]
dev = [
"pytest==7.1.1",
"wheel==0.35.1",
"mypy==1.13.0",
"Django==5.2.1",
"flake8==4.0.1",
"flake8-pyi>=20.10.0",
"ty>=0.0.1a22",
"types-PyYAML>=6.0.1",
"types-pytz>=2021.3.0",
"psycopg2-binary>=2.9.3",
"pyright>=1.1.406",
"ruff>=0.1.0",
"tomlkit>=0.12.1",
"pre-commit>=4.3.0",
"ast-grep-cli>=0.40.5",
]
[tool.ruff]
line-length = 120
target-version = "py310"
exclude = ["*.py"] # only autofix stubs
[tool.ruff.lint]
# See Rules in Ruff documentation: https://docs.astral.sh/ruff/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"]
[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]
split-on-trailing-comma = false
[tool.ty.rules]
invalid-method-override = "ignore"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=native -s -v --cache-clear"
filterwarnings = [
"error", # all warnings that are not ignored should raise an error
]
[tool.hatch.build.targets.wheel]
packages = ["django-stubs"]
[tool.uv]
exclude-newer = "7 days"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"