-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
81 lines (71 loc) · 1.9 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
[tool.poetry]
authors = ["Kyo Huang <[email protected]>"]
description = "A Django project to demonstrate how to use Django Ninja"
name = "django-ninja-tutorial"
version = "0.1.0"
[tool.poetry.dependencies]
django = "^4.2"
django-ninja = "^1.3.0"
pillow = "^10.4.0"
python = "^3.12"
[tool.poetry.group.dev.dependencies]
django-stubs = "^5.0.4"
mypy = "^1.11.2"
pre-commit = "^3.8.0"
pytest = "^8.3.2"
pytest-django = "^4.9.0"
ruff = "0.6.3"
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[project]
requires-python = ">=3.12" # 影響 pyupgrade 檢查與自動修正的版本
[tool.ruff] # https://docs.astral.sh/ruff/settings/#top-level
exclude = ["**/migrations/", "**/manage.py"] # 排除 migrations 目錄和 manage.py 檔案
line-length = 100
[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint
ignore = [
"E402", # module level import not at top of file
]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
]
[tool.ruff.format] # https://docs.astral.sh/ruff/settings/#format
quote-style = "single" # 引號風格,雙引號是預設值
[tool.mypy]
allow_redefinition = true
check_untyped_defs = true
disable_error_code = ["empty-body"]
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
exclude = "^(migrations|.*manage\\.py)$"
force_union_syntax = true
force_uppercase_builtins = true
ignore_missing_imports = true
incremental = true
plugins = ["mypy_django_plugin.main"]
show_traceback = true
strict_optional = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.django-stubs]
django_settings_module = "NinjaForum.settings"
[tool.pytest.ini_options]
addopts = [
"--ds=NinjaForum.settings",
]
filterwarnings = [
"ignore::Warning",
]
python_files = [
"tests.py",
"test_*.py",
]