forked from typeddjango/djangorestframework-stubs
-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
93 lines (85 loc) · 2.5 KB
/
pyproject.toml
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
[tool.poetry]
name = "djangorestframework-types"
version = "0.9.0"
description = "Type stubs for Django Rest Framework"
authors = ["Steve Dignam <[email protected]>"]
repository = "https://github.com/sbdchd/djangorestframework-types"
readme = "README.md"
license = "MIT"
keywords = ["django", "djangorestframework", "types", "mypy", "stubs"]
packages = [
{ include = "rest_framework-stubs" },
{ include = "coreapi-stubs" },
{ include = "coreschema-stubs" },
{ include = "rest_framework_swagger-stubs" },
{ include = "openapi_codec-stubs" },
]
[tool.poetry.dependencies]
python = "^3.8"
typing_extensions = { version = "^4.6", python = "<3.11" }
[tool.poetry.group.dev.dependencies]
ipython = "^7.19"
django-types = "^0.3.1"
django = "^3.1"
flake8 = "^3.8"
flake8-pyi = "^20.10"
mypy = "^1.4"
isort = "5.10.1"
types-requests = "^2.28.11"
ruff = "^0.6.5"
pyright = "^1.1.318"
[tool.ruff]
target-version = "py38"
line-length = 120
[tool.ruff.lint]
select = [
"E",
"F",
"TID252",
"I001",
"T20",
"C4",
"UP",
"N",
"BLE",
"B",
"RET",
"SIM",
"ARG",
"DTZ",
"ERA",
"RUF",
]
ignore = [
"E501", # line length is handled by black
"ARG001", # pytest fixtures mess with this
"ARG002", # sometimes parent classes require params
"N806", # django migrations violate this a lot
"B008", # type.Argument violates this
"N815", # we mix and match casing in serializers
"ARG005", # monkey patching false positive with *args, and **kwargs
"N805", # false positive with pydantic
"N802", # DRF serializers mess with this
"RET505", # if, elif, else are fine with returns
"RET507", # if, elif, else with continue is also fine
"RET508", # if, elif, else with break is also fine
# okay because we're doing hacky things for our runtime tests
"T201", # we use print for testing
"B905", # allow zip without strict
"B018", # useless expressions useful for type checking
"B904", # allow bad except clauses
"N803", # some APIs have weird names
"N818", # some exceptions have bad names
"N801", # some class names have bad names
"ERA001", # false positives
"UP007", # We're using Union/Optional here.
]
unfixable = [
"ERA001",
] # we want to check ourselves before we delete commented out code.
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[build-system]
requires = ["poetry>=0.12", "setuptools"]
build-backend = "poetry.masonry.api"