-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
155 lines (143 loc) · 3.15 KB
/
pyproject.toml
File metadata and controls
155 lines (143 loc) · 3.15 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
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
148
149
150
151
152
153
154
155
[project]
name = "flashcard_workshop"
version = "0.1.0"
description = ""
requires-python = ">=3.12, <4.0"
dependencies = [
"Django",
"djangorestframework",
"drf-spectacular",
"django-extensions",
"django-debug-toolbar",
"psycopg2-binary",
"ipython",
"environs",
"pyyaml",
"drf-nested-routers>=0.94.1",
"django-cors-headers>=4.7.0",
"djangorestframework-camel-case>=1.4.2",
]
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
"pytest-django",
"pytest-xdist",
"pre-commit",
"factory-boy",
"ruff",
"mypy",
"django-stubs",
"djangorestframework-stubs[compatible-mypy]",
]
prod = [
"gunicorn",
"whitenoise",
]
[tool.ruff]
target-version = "py312"
line-length = 120
extend-exclude = [
"__pycache__",
"build",
]
[tool.ruff.lint]
select = [
"A", # flake8 builtins
"S", # flake8-bandit
"DJ", # flake8-django
"PT", # flake8-pytest-style
"TID", # flake8-tidy-imports
"INT", # flake8-gettext
"PTH", # flake8-use-pathlib
"T10", # flake8-debugger
"ERA", # flake8-eradicate
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"G", # flake8-logging-format
"E", # pycodestyle error
"W", # pycodestyle warning
"F", # pyflakes
"N", # pep8-naming
"UP", # pyupgrade
"I", # isort
"C9", # mccabe
"I", # isort
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = [
"S101", # "Use of `assert` detected"
"ARG", # "Unused function argument". Fixtures can be unused.
"S105", # "Possible hardcoded password".
]
"**settings/**" = [
"F405", # variable may be undefined due to * import
"F403", # allow * imports
"TID252", # Allow relative imports
]
"**/settings/tests.py" = [
"S105",
]
"**/settings/local.py" = [
"S105",
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
"pydantic.validator",
"pydantic.root_validator",
]
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:"
]
omit = [
"manage.py",
"**/wsgi.py",
"**/asgi.py",
"**/settings/*.py",
"**/migrations/*.py",
]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "flashcard_workshop.settings.tests"
python_files = ["tests.py", "test_*.py", "*_tests.py"]
norecursedirs = [".git/*",
".mypy_cache/*",
".pytest_cache/*",
"migrations/*",
"settings/*",
]
addopts = "--nomigrations"
[tool.mypy]
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
check_untyped_defs = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
[tool.django-stubs]
django_settings_module = "flashcard_workshop.settings.local"
[[tool.mypy.overrides]]
module = [
"*.migrations.*",
"*.settings.*",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = "factory.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"django_extensions.*",
"factory.*",
]
ignore_missing_imports = true