forked from sbgaia/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
122 lines (109 loc) · 2.99 KB
/
Copy pathpyproject.toml
File metadata and controls
122 lines (109 loc) · 2.99 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
[project]
name = "project_name"
version = "0.1.0"
description = "A simple template project."
authors = [{ name = "Mario Potato", email = "mario.potato@univr.it" }]
requires-python = ">=3.10,<4"
readme = "README.md"
license = "BSD-2-Clause"
[project.optional-dependencies]
dev = [
"build>=1.3.0,<2",
"git-cliff>=2.13,<3",
"hatchling>=1.29.0,<2",
"radon>=6.0.1,<7",
"lizard>=1.22.1,<2",
"pre-commit>=4.6.0,<5",
"pip-audit>=2.9.0,<3",
"ruff>=0.15.13,<0.16",
"tox>=4.54.0,<5",
"tox-uv>=1.15,<2",
"pytest>=9.0.3,<10",
"pytest-cov>=7.1.0,<8",
"pyrefly>=1.0.0",
]
docs = [
"furo>=2024.8.6,<2027",
"myst-parser>=3,<5",
"sphinx>=7.4,<10",
"sphinx-autobuild>=2024.10.3,<2027",
"sphinx-autodoc-typehints>=2.2,<4",
"sphinx-copybutton>=0.5,<1",
]
[build-system]
requires = ["hatchling>=1.29.0,<2"]
build-backend = "hatchling.build"
[tool.pyrefly]
python-version = "3.10.0"
preset = "legacy"
check-unannotated-defs = true
infer-return-types = "never"
[tool.pyrefly.errors]
# Keep the policy close to the previous strict type-checking setup.
implicit-any = "error"
implicit-any-parameter = "error"
invalid-decorator = "error"
invalid-inheritance = "error"
missing-import = "ignore"
redundant-cast = "error"
redundant-condition = "error"
unannotated-return = "error"
unnecessary-comparison = "error"
unreachable = "error"
unused-ignore = "error"
untyped-import = "ignore"
[tool.ruff]
# Google style uses 80 chars
line-length = 80
target-version = "py310"
[tool.ruff.lint]
# Google Python Style Guide compliant rules
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort (import sorting)
"N", # pep8-naming
"D", # pydocstyle (docstring conventions)
"UP", # pyupgrade (modern Python syntax)
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # Ruff-specific rules
]
ignore = [
"D100", # missing docstring in public module
"D104", # missing docstring in public package
"D105", # missing docstring in magic method
"D107", # missing docstring in __init__
"D203", # one-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"D", # docstrings not required in tests
]
[tool.ruff.lint.pydocstyle]
# Google docstring convention
convention = "google"
[tool.ruff.lint.isort]
# Google style: absolute imports, sorted
known-first-party = ["project_name"]
force-single-line = false
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pytest.ini_options]
markers = [
"template_smoke: end-to-end generated-project smoke test",
]
[tool.coverage.run]
branch = true
source = ["project_name"]
[tool.coverage.report]
fail_under = 90
show_missing = true
skip_covered = true