-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (136 loc) · 3.43 KB
/
pyproject.toml
File metadata and controls
163 lines (136 loc) · 3.43 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
156
157
158
159
160
161
162
163
[project]
name = "DISTRIBUTION-NAME"
version = "0.1.0"
description = "[[DESCRIPTION]]"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.12"
license = {"file" = "LICENSE.md"}
authors = [
{ name = "[[USERNAME]]", email = "AUTHOR@EXAMPLE.COM" }
]
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"pydantic-settings>=2.12.0",
"structlog>=25.5.0",
]
[dependency-groups]
test = ["pytest>=9.0.0", "pytest-cov>=7.0.0"]
quality = ["prek>=0.3.1", "bandit[toml]>=1.7.6", "ruff>=0.14.7", "mypy>=1.19.0"]
dev = [
{include-group = "test"},
{include-group = "quality"},
"python-dotenv>=1.2.1",
]
[project.urls]
Homepage = "https://github.com/[[USERNAME]]/[[REPO_NAME]]"
Repository = "https://github.com/[[USERNAME]]/[[REPO_NAME]]"
Documentation = "https://github.com/[[USERNAME]]/[[REPO_NAME]]/blob/main/docs/DOCUMENTATION.md"
Issues = "https://github.com/[[USERNAME]]/[[REPO_NAME]]/issues"
[project.scripts]
DISTRIBUTION-NAME = "package_name.main:main"
[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--cov=src",
"--cov-report=xml",
"--cov-report=html",
"--cov-report=term-missing",
"--verbose",
]
[tool.coverage.run]
source = ["src"]
relative_files = true
branch = true
data_file = ".log/coverage/.coverage"
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/.venv/*",
"*/env/*",
]
[tool.coverage.report]
skip_covered = false
fail_under = 80
show_missing = true
skip_empty = false
precision = 2
[tool.coverage.html]
directory = ".log/coverage/htmlcov"
[tool.coverage.xml]
output = ".log/coverage/coverage.xml"
[tool.ruff]
line-length = 120
target-version = "py312"
exclude = [
".git",
".venv",
"__pycache__",
".pytest_cache",
".log",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"E501", # Line too long, handled by formatter
]
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101"] # Allow asserts in tests
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
[tool.ruff.lint.isort]
known-first-party = ["package_name"]
[tool.mypy]
python_version = "3.12"
mypy_path = "src"
files = "src/package_name"
explicit_package_bases = true
namespace_packages = true
# Strictness Control
strict = true
check_untyped_defs = true
disallow_untyped_defs = false # Chang to true for stricter behaviour
disallow_incomplete_defs = false # Chang to true for stricter behaviour
disallow_untyped_decorators = false # Chang to true for stricter behaviour
no_implicit_optional = true
# Warnings & Code Quality
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
ignore_missing_imports = true
# Output & Cache
pretty = true
show_error_codes = true
cache_dir = ".log/mypy_cache"
[tool.bandit]
exclude_dirs = ["tests", ".venv"]
skips = ["B101"]
[tool.bandit.assert_used]
skips = ["tests/*", "test_*.py"]