playbook/templates/python/pyproject.toml

52 lines
1.0 KiB
TOML

[tool.black]
# Black 代码格式化工具配置(模板)
line-length = 80
target-version = ["py313"]
exclude = '''
/(
\.git
| \.venv
| venv
| build
| dist
| __pycache__
| \.egg-info
)/
'''
[tool.isort]
# isort 导入排序工具配置(模板)
profile = "google"
line_length = 80
multi_line_output = 3
lines_after_imports = 2
# 按项目需要填写/维护:
known_third_party = []
known_first_party = []
skip = [".venv", "venv", "build", "dist"]
[tool.mypy]
# MyPy 类型检查配置(可选,模板)
python_version = "3.13"
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
disallow_untyped_defs = false
disallow_untyped_calls = false
ignore_missing_imports = true
[tool.pytest.ini_options]
# pytest 测试配置(模板)
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short --strict-markers"
markers = [
"slow: marks tests as slow",
"integration: marks tests as integration tests",
]