Skip to content

Commit d7bebd9

Browse files
committed
refactor: manage the release script using inline metadata
1 parent 704e8fc commit d7bebd9

File tree

4 files changed

+4
-39
lines changed

4 files changed

+4
-39
lines changed

changelog.d/+d5a951bf.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Manage `scripts/release.py` using inline metadata.

template/pyproject.toml.jinja

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ scripts.{{ distribution_name }} = "{{ package_name }}.cli:main"
8181
[dependency-groups]
8282
dev = [
8383
{ include-group = "lint" },
84-
{ include-group = "release" },
8584
{ include-group = "tests" },
8685
{ include-group = "type" },
8786
]
@@ -110,13 +109,6 @@ pkg = [
110109
"twine>=6.0.1",
111110
"uv>=0.6.5",
112111
]
113-
release = [
114-
"packaging>=24.2",
115-
"towncrier>=24.8",
116-
{%- if not dynamic_version %}
117-
"uv>=0.7.7",
118-
{%- endif %}
119-
]
120112
{% if backend == 'hatch' and hatch_plugins %}
121113
[tool.hatch]
122114
{%- if 'hatch-vcs' in hatch_plugins %}

template/{% if tasks == 'nox' %}noxfile.py{% endif %}.jinja

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -235,23 +235,5 @@ def autodocs(session: nox.Session) -> None:
235235
)
236236

237237
{% endif %}
238-
@nox.session(python=DEFAULT_PYTHON_VERSION)
239-
def release(session: nox.Session) -> None:
240-
"""Prepare a new release."""
241-
{%- if install == 'uv pip' %}
242-
session.install(*nox.project.dependency_groups(PYPROJECT, "release"))
243-
{%- else %}
244-
session.run_install(
245-
"uv",
246-
"sync",
247-
"--locked",
248-
"--only-group=release",
249-
f"--python={session.virtualenv.location}",
250-
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
251-
)
252-
{%- endif %}
253-
session.run("python", Path("scripts", "release.py"), *session.posargs)
254-
255-
256238
if __name__ == "__main__":
257239
nox.main()

template/{% if tasks == 'tox' %}tox.toml{% endif %}.jinja

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ commands = [
124124
"{env_tmp_dir}{/}*",
125125
],
126126
]
127-
{% if docs == 'mkdocs' %}
127+
{%- if docs == 'mkdocs' %}
128+
128129
[env.docs]
129130
description = "generate documentation"
130131
package = "editable"
@@ -154,15 +155,4 @@ commands = [
154155
{ replace = "posargs", extend = true },
155156
],
156157
]
157-
{% endif %}
158-
[env.release]
159-
description = "prepare a new release"
160-
skip_install = true
161-
dependency_groups = [ "release" ]
162-
commands = [
163-
[
164-
"python",
165-
"{tox_root}{/}scripts{/}release.py",
166-
{ replace = "posargs", extend = true },
167-
],
168-
]
158+
{%- endif %}

0 commit comments

Comments
 (0)