-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
208 lines (187 loc) · 5.53 KB
/
pyproject.toml
File metadata and controls
208 lines (187 loc) · 5.53 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# This project uses the most bleeding-edge Python tools that are stable enough for production.
# Tools like Cursor (AI-powered VSCode), UV, Ruff, mkdocs, mkdocstrings, pyright, pyupgrade, flynt, bandit, vulture, interrogate, xenon,
# and many more represent the latest advancements in the Python ecosystem,
# offering significant performance improvements over traditional tools.
[project]
dependencies = [
"pydantic-settings>=2.8.1",
"lazy-loader>=0.4",
]
description = "Add your description here"
name = "python-starting-project"
readme = "README.md"
requires-python = ">=3.11"
version = "0.1.0"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project.scripts]
python-starting-project = "src.main:main"
[tool.hatch.build.targets.wheel]
packages = ["src", "tests"]
[tool.uv]
default-groups = ["dev"]
package = true
[dependency-groups]
dev = [
"mdformat>=0.7.22",
"mdformat-config>=0.1.3",
"mdformat-web>=0.1.1",
"mdformat-tables>=0.4.1",
"mdformat-frontmatter>=0.4.1",
"codespell>=2.4.1",
"flynt>=1.0.2",
"mkdocs>=1.6.1",
"mkdocs-material>=9.6.8",
"mkdocstrings-python>=1.16.5",
"mkinit>=1.1.0",
"mkdocs-include-markdown-plugin>=7.1.5",
"poethepoet>=0.33.0",
"pre-commit>=4.1.0",
"pyright>=1.1.396",
"pytest>=8.3.5",
"pyupgrade>=3.19.1",
"ruff>=0.11.0",
"yesqa>=1.5.0",
"bandit>=1.7.8",
"interrogate>=1.5.0",
"darglint>=1.8.1",
"vulture>=2.11",
"commitizen>=3.20.0",
"xenon>=0.9.3",
"pytest-cov>=6.0.0",
"pytest-asyncio>=0.25.3",
"pytest-xdist>=3.6.1",
"shellcheck-py>=0.10.0.1",
"logging>=0.4.9.6",
"mdformat-mkdocs>=4.1.2",
"mdformat-gfm>=0.4.1",
]
[tool.poe.tasks]
flynt = "flynt --aggressive --fail-on-change --quiet src tests"
lint = {sequence = ["pyupgrade", "flynt", "pyright", "ruff-check", "ruff-format"]}
mdformat = {cmd = "mdformat --number docs"}
mkdocs = {cmd = "mkdocs build --strict"}
mkdocs-serve = {cmd = "mkdocs serve"}
mkinit = {sequence = ["mkinit-src", "mkinit-tests"]}
mkinit-src = {cmd = "mkinit src --relative --lazy_loader_typed --black --recursive -w"}
mkinit-tests = {cmd = "mkinit tests --relative --lazy_loader_typed --black --recursive -w"}
pre = "pre-commit run --all-files --verbose" # THE MOST IMPORTANT COMMAND "poe pre" or "uv run poe pre"
pre-commit = "pre-commit run --all-files --show-diff-on-failure"
pyright = "uv run pyright"
pyupgrade = "pyupgrade --py311-plus"
radon = "radon cc src --min C --total-average"
ruff-check = "ruff check"
ruff-format = "ruff format"
sync = "uv sync"
bandit = "bandit -c pyproject.toml -r src --exclude tests,.venv,.git"
interrogate = "interrogate -v src"
test-coverage = "pytest -xvs -n auto --cov=src --cov-report=term-missing --cov-report=xml --cov-fail-under=80 --ignore=tests"
vulture = "vulture src --min-confidence 80"
xenon = "xenon src -a A -b A -m A --paths-in-front"
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"__init__.py",
]
fix = true
line-length = 120
src = ["src"]
target-version = "py311"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
indent-style = "space"
line-ending = "auto"
quote-style = "double"
skip-magic-trailing-comma = false
[tool.ruff.lint]
extend-ignore = [
"E203", # Not PEP8 compliant and black insert space around slice: [Frequently Asked Questions - Black 22.12.0 documentation](https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated)
"E501", # Line too long. Disable it to allow long lines of comments and print lines which black allows.
"D401", # First line should be in imperative mood
"D203", # Removed incompatible rule (keep D211 instead)
"D213", # Removed incompatible rule (keep D212 instead)
"COM812", # Removed rule that may conflict with formatter
"F811", # Redefined variable from import
"ISC001",
"BLE001",
"PGH",
"C901", # Too complex
"PLR",
"TRY300",
]
extend-select = [
"ALL",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104"] # Allow __init__.py stuff
"tests/**/*.py" = ["S101", "ARG001", "FBT001"] # Allow assert statements in tests, unused function arguments, and boolean positional arguments
[tool.pyright]
exclude = [
"**/__init__.py",
]
include = ["src", "tests"]
pythonVersion = "3.11"
reportUnknownArgumentType = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"
typeCheckingMode = "strict"
[tool.bandit]
exclude_dirs = ["tests", ".venv", ".git"]
skips = ["B101"] # Skip assert statements warning
[tool.darglint]
docstring_style = "google"
strictness = "short" # Options: short, long, full
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version = "0.1.0"
[tool.interrogate]
exclude = ["tests", ".venv", ".git"]
fail-under = 80
ignore-init-method = true
ignore-init-module = true
[tool.vulture]
exclude = ["tests", ".venv", ".git"]
ignore_names = ["setUp", "tearDown", "test_*"]
min_confidence = 80
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
python_classes = ["Test*"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
testpaths = ["tests"]
addopts = "--cov-config=pyproject.toml"
[tool.coverage.run]
omit = ["src/utils/logging.py", "src/utils/settings.py", "*/__init__.py"]
[tool.coverage.report]
exclude_also = [
"def __repr__",
]