-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (132 loc) · 4.03 KB
/
pyproject.toml
File metadata and controls
153 lines (132 loc) · 4.03 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
[project]
name = "{{ cookiecutter.project_slug }}"
version = "{{ cookiecutter.version }}"
description = "{{ cookiecutter.project_description }}"
readme = "README.md"
license-files = ["LICENSE"]
{%- if cookiecutter.license == "Apache 2.0" %}
license = "Apache-2.0"
{%- elif cookiecutter.license == "AGPL v3" %}
license = "AGPL-3.0-or-later"
{%- elif cookiecutter.license == "Proprietary" %}
license = "LicenseRef-Proprietary-License"
{%- endif %}
authors = [
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" },
]
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = []
requires-python = ">=3.11"
[build-system]
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"
[dependency-groups]
doc = [
{%- if cookiecutter.documentation == "pdoc" -%}
"pdoc"
{%- endif -%}
]
test = ["pytest", "pytest-cov", "pytest-timeout", "pretend", "coverage[toml]"]
lint = [
# NOTE: ruff is under active development, so we pin conservatively here
# and let Dependabot periodically perform this update.
"ruff ~= 0.14.0",
"ty >=0.0.8",
{%- if cookiecutter.docstring_coverage %}
"interrogate",
{%- endif %}
]
audit = ["pip-audit"]
dev = [
{include-group = "doc"},
{include-group = "test"},
{include-group = "lint"},
{include-group = "audit"},
"prek",
]
{% if cookiecutter.entry_point -%}
[project.scripts]
"{{ cookiecutter.entry_point }}" = "{{ cookiecutter.__project_import }}._cli:main"
{%- endif %}
[project.urls]
Homepage = "https://pypi.org/project/{{ cookiecutter.project_slug }}"
Documentation = "https://{{ cookiecutter.github_username }}.github.io/{{ cookiecutter.project_slug }}/"
Issues = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/issues"
Source = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}"
[tool.coverage.run]
branch = true
# don't attempt code coverage for the CLI entrypoints
omit = ["{{ cookiecutter.__project_src_path }}/_cli.py"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.ty.terminal]
error-on-warning = true
[tool.ty.environment]
python-version = "3.11"
[tool.ty.src]
include = ["src", "test"]
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src"]
[tool.ruff.format]
line-ending = "lf"
quote-style = "double"
docstring-code-format = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D203", # Incompatible with D211
"D213", # Incompatible with D212
"COM812", # Can conflict with formatter
"ISC001", # Can conflict with formatter
]
[tool.ruff.lint.mccabe]
# Maximum cyclomatic complexity
max-complexity = 8
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings
convention = "google"
[tool.ruff.lint.pylint]
# Maximum number of branches for function or method
max-branches = 12
# Maximum number of return statements in function or method
max-returns = 6
# Maximum number of positional arguments for function or method
max-positional-args = 5
[tool.ruff.lint.per-file-ignores]
{% if cookiecutter.entry_point -%}
"{{ cookiecutter.__project_src_path }}/_cli.py" = [
"T201", # allow print in cli module
]
{%- endif %}
"test/**/*.py" = [
"D", # no docstrings in tests
"S101", # asserts are expected in tests
"PLR2004", # Allow magic values in tests
]
"**/conftest.py" = ["D"] # No docstrings in pytest config
{%- if cookiecutter.docstring_coverage %}
[tool.interrogate]
# don't enforce documentation coverage for packaging, testing, the virtual
# environment, or the CLI (which is documented separately).
exclude = ["env", "test", "{{ cookiecutter.__project_src_path }}/_cli.py"]
ignore-semiprivate = true
fail-under = 100
{%- endif %}
[tool.pytest.ini_options]
testpaths = ["test"]
python_files = ["test_*.py"]
addopts = "--durations=10"
[tool.uv.sources]
{{ cookiecutter.project_slug }} = { workspace = true }
{%- if cookiecutter.project_namespace_import %}
[tool.uv.build-backend]
module-name = "{{ cookiecutter.__project_import }}"
{%- endif %}