-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
111 lines (98 loc) · 2.79 KB
/
pyproject.toml
File metadata and controls
111 lines (98 loc) · 2.79 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 = "backend"
version = "0.1.0"
description = "A django-ninja backend template"
dependencies = [
"uwsgi; sys_platform == 'linux'",
"pick",
"rich",
"ipython",
"pydantic~=2.0",
"django-ninja>=1.4.0",
"django-extensions",
"django>=4.2",
"arrow",
"PyJWT",
"django-cors-headers",
"mysqlclient",
"requests",
"redis==4.6.0",
"loguru",
"django-print-sql",
"psutil>=6.0",
"django-tinymce",
"beautifulsoup4",
"django-filebrowser-no-grappelli",
"pillow",
]
readme = "README.md"
requires-python = ">=3.10"
[dependency-groups]
dev = [
"inline-snapshot",
"pytest",
"pytest-django",
"pytest-xdist",
"ruff",
"taskipy",
"types-redis~=4.6",
]
[tool.ruff]
extend-exclude = ["backend/apps/*/migrations"]
line-length = 120
target-version = "py310"
[tool.ruff.lint]
extend-select = [
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default/
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"RET503", # https://docs.astral.sh/ruff/rules/implicit-return/
"TID251", # https://docs.astral.sh/ruff/rules/banned-api/
]
ignore = [
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
"F401", # https://docs.astral.sh/ruff/rules/unused-import/
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"venv.logger".msg = "Use `loguru.logger` instead"
[tool.uv]
package = false
[[tool.uv.dependency-metadata]]
name = "uwsgi"
requires-dist = []
[[tool.uv.index]]
url = "https://mirrors.aliyun.com/pypi/simple"
default = true
[tool.pytest.ini_options]
addopts = ["-vx", "--failed-first"]
DJANGO_SETTINGS_MODULE = "backend.settings"
python_files = [
"tests/test_*.py",
"tests/**/test_*.py",
"backend/apps/*/tests.py",
"backend/apps/*/test_*.py",
]
filterwarnings = ["ignore::pydantic.warnings.PydanticDeprecatedSince20"]
[tool.inline-snapshot]
format-command = "ruff format --stdin-filename {filename}"
[tool.taskipy.tasks]
sg = "uvx --from ast-grep-cli sg"
lint = "task sg scan -U && ruff format && ruff check --fix"
check = "python manage.py check"
pre_reload = "task lint && task check"
reload = "touch uwsgi.reload"
sync = "git pull --ff && uv sync && python manage.py migrate && python manage.py collectstatic"
shell = "python manage.py shell_plus --print-sql --ipython"
test = "pytest"
mypy = "uv run --with django-stubs[compatible-mypy] mypy"
ci = "task lint && task mypy && task check && task test -n auto"
[tool.mypy]
files = ["backend"]
plugins = ["mypy_django_plugin.main"]
fixed_format_cache = true
disable_error_code = "var-annotated,import-untyped"
check_untyped_defs = true
allow_redefinition_new = true
local_partial_types = true
[tool.django-stubs]
django_settings_module = "backend.settings"