Skip to content

Commit 3ac8a8a

Browse files
committed
Tidy pyproject.toml
1 parent d4bcfec commit 3ac8a8a

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

template/pyproject.toml.jinja

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ dynamic = ["version"]
1717
license.file = "LICENSE"
1818
readme = "README.md"
1919
requires-python = ">=3.10"
20-
21-
[project.optional-dependencies]
22-
dev = [
20+
optional-dependencies = { dev = [
2321
"build",
2422
"copier",
2523
{% if type_checker=="mypy" %}"mypy",
@@ -37,17 +35,11 @@ dev = [
3735
{% endif %}"tox-uv",
3836
"twine",
3937
"types-mock",
40-
]
41-
42-
[project.scripts]
43-
{{ repo_name }} = "{{ package_name }}.__main__:main"
44-
45-
[project.urls]
46-
GitHub = "{{ repo_url }}"
47-
48-
[[project.authors]] # Further authors may be added by duplicating this section
49-
email = "{{ author_email }}"
50-
name = "{{ author_name }}"
38+
] }
39+
scripts = { {{ repo_name }} = "{{ package_name }}.__main__:main" }
40+
urls = { GitHub = "{{ repo_url }}" }
41+
# Further authors may be added by appending to this list
42+
authors = [ { email = "{{ author_email }}", name = "{{ author_name }}" } ]
5143

5244
[tool.uv]
5345
default-groups = []
@@ -63,6 +55,8 @@ typeCheckingMode = "standard"
6355
{% endif %}{% if type_checker=="mypy" %}
6456
[tool.mypy]
6557
ignore_missing_imports = true # Ignore missing stubs in imported modules
58+
explicit_package_bases = true
59+
#no_namespace_packages = true
6660
{% endif %}
6761
[tool.pytest.ini_options]
6862
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
@@ -101,7 +95,7 @@ commands = [
10195
"run",
10296
#"--all-files",
10397
"--show-diff-on-failure",
104-
{ replace = "posargs", default = [], extend = true },
98+
"{posargs}",
10599
],
106100
]
107101

@@ -110,15 +104,7 @@ description = "Run type-checking"
110104
allowlist_externals = ["{{ type_checker }}"]
111105
# needed otherwise throws reportUnknownMemberType errors
112106
deps = ["pytest"]
113-
commands = [
114-
[
115-
"{{ type_checker }}",
116-
"src",
117-
"tests",
118-
{ replace = "posargs", default = [
119-
], extend = true },
120-
],
121-
]
107+
commands = [["{{ type_checker }}", "src", "{posargs}"]]
122108

123109
[tool.tox.env.tests]
124110
description = "Run tests"
@@ -127,13 +113,12 @@ commands = [
127113
[
128114
"pytest",
129115
"-vv",
130-
"--cov=python_copier_template_example",
116+
"--cov={{ package_name}}",
131117
"--cov-report",
132118
"term",
133119
"--cov-report",
134120
"xml:cov.xml",
135-
{ replace = "posargs", default = [
136-
], extend = true },
121+
"{posargs}",
137122
],
138123
]
139124

0 commit comments

Comments
 (0)