Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
100 lines (88 loc) · 2.99 KB
/
Copy pathpyproject.toml
File metadata and controls
100 lines (88 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
[project]
name = "Python-Project-Template"
version = "0.0.1"
description = "Modern Python Project"
readme = "README.md"
authors = [{ name = "Junya Morioka", email = "mjun@mjunya.com" }]
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.12"
dependencies = []
[project.scripts]
"Python-Project-Template" = "my_package.__main__:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/my_package"]
[dependency-groups]
dev = [
"prek>=0.5.2",
"pytest>=9.1.1",
"pytest-cov>=7.1.0",
"pytest-xdist>=3.8.0",
"ruff>=0.16.6",
"ty>=0.0.78",
]
[tool.ruff]
line-length = 100
target-version = "py312"
exclude = [".git", ".ruff_cache", ".venv", ".vscode"]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
"ANN", # type annotation
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle errors
"F", # pyflakes
"FURB", # refurb
"I", # isort
"PERF", # perflint
"PT", # flake8-pytest-style
"PTH", # use `pathlib.Path` instead of `os.path`
"RUF", # ruff specific rules
"SIM", # flake8-simplify
"TC", # flake8-type-checking
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"ANN401", # Checks that function arguments are annotated with a more specific type than Any.
"B905", # `zip()` without `strict=True`
"D100", # Missing docstring in public module
"D203", # One blank line required before class docstring (ignored because D211 is prioritized in pydocstyle convention 'google')
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line
"D400", # First line of docstring should end with a period
"D415", # First line of docstring should end with punctuation (period, question mark, or exclamation point)
"E114", # Indentation is not a multiple of four (comment)
"PTH123", # `open()` should be replaced by `Path.open()`
"RUF002", # Checks for ambiguous Unicode characters in docstrings.
"RUF003", # Checks for ambiguous Unicode characters in comments.
"SIM105", # try-except-pass blocks that can be replaced with the contextlib.suppress context manager.
"SIM108", # Use ternary operator instead of `if`-`else`-block
"SIM116", # Use a dictionary instead of consecutive `if` statements
]
unfixable = [
"F401", # unused import
"F841", # unused variable
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest]
testpaths = ["tests"]
addopts = ["-ra", "--strict-markers", "--strict-config", "--numprocesses=auto"]
xfail_strict = true
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 80
show_missing = true
exclude_also = ['if __name__ == "__main__":']