Skip to content

Commit 417a05f

Browse files
committed
chore: consolidate type checking and testing configurations
- Remove the mypy configuration file - Update the pyproject.toml to include mypy settings - Add configuration for pytest to pyproject.toml - Remove the pytest.ini file Signed-off-by: kyo <[email protected]>
1 parent c79b208 commit 417a05f

File tree

3 files changed

+37
-38
lines changed

3 files changed

+37
-38
lines changed

mypy.ini

Lines changed: 0 additions & 27 deletions
This file was deleted.

pyproject.toml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ version = "0.1.0"
66

77
[tool.poetry.dependencies]
88
django = "^4.2"
9-
python = "^3.12"
109
django-ninja = "^1.3.0"
1110
pillow = "^10.4.0"
11+
python = "^3.12"
1212

1313
[tool.poetry.group.dev.dependencies]
1414
django-stubs = "^5.0.4"
@@ -43,3 +43,39 @@ select = [
4343

4444
[tool.ruff.format] # https://docs.astral.sh/ruff/settings/#format
4545
quote-style = "single" # 引號風格,雙引號是預設值
46+
47+
[tool.mypy]
48+
allow_redefinition = true
49+
check_untyped_defs = true
50+
disable_error_code = ["empty-body"]
51+
disallow_incomplete_defs = true
52+
disallow_untyped_calls = true
53+
disallow_untyped_defs = true
54+
exclude = "^(migrations|.*manage\\.py)$"
55+
force_union_syntax = true
56+
force_uppercase_builtins = true
57+
ignore_missing_imports = true
58+
incremental = true
59+
plugins = ["mypy_django_plugin.main"]
60+
show_traceback = true
61+
strict_optional = true
62+
warn_redundant_casts = true
63+
warn_return_any = true
64+
warn_unreachable = true
65+
warn_unused_configs = true
66+
warn_unused_ignores = true
67+
68+
[tool.django-stubs]
69+
django_settings_module = "NinjaForum.settings"
70+
71+
[tool.pytest.ini_options]
72+
addopts = [
73+
"--ds=NinjaForum.settings",
74+
]
75+
filterwarnings = [
76+
"ignore::Warning",
77+
]
78+
python_files = [
79+
"tests.py",
80+
"test_*.py",
81+
]

pytest.ini

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)