Skip to content

Commit 67dd15d

Browse files
authored
Set the version in pyproject.toml instead of having it dynamic (#706)
* Set the version in pyproject.toml instead of having it dynamic This reduces complexity of the build and should allow us to use dependabot with uv. Also standardizes releases a bit more as the version isn't hidden anymore in the __init__.py file * Run uv sync to make pre-commit happy The uv lockfile is now on version 2 * Don't try to include a file that doesn't exist anymore in the decision container
1 parent 9ac8522 commit 67dd15d

File tree

6 files changed

+1112
-1124
lines changed

6 files changed

+1112
-1124
lines changed

.hatch_build.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Releasing taskcluster-taskgraph
156156
In order to release a new version of Taskgraph, you will need to:
157157

158158
1. Update ``CHANGELOG.md``
159-
2. Update ``__version__`` in ``src/taskgraph/__init__.py``
159+
2. Update ``version`` in ``pyproject.toml``
160160
3. Commit, and land the above changes with a commit message like "chore: bump <version>"
161161
4. Draft a release in Github pointing to the above commit.
162162

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Project
22
[project]
33
name = "taskcluster-taskgraph"
4+
version = "14.4.1"
45
description = "Build taskcluster taskgraphs"
56
readme = "README.rst"
67
authors = [
@@ -31,7 +32,6 @@ dependencies = [
3132
"taskcluster-urls>=11.0",
3233
"voluptuous>=0.12.1",
3334
]
34-
dynamic = ["version"] # set in src/taskgraph/__init__.py
3535

3636
[project.optional-dependencies]
3737
load-image = ["zstandard"]
@@ -73,9 +73,6 @@ build-backend = "hatchling.build"
7373
[tool.hatch.build.targets.wheel]
7474
packages = ["src/taskgraph"]
7575

76-
[tool.hatch.metadata.hooks.custom]
77-
path = ".hatch_build.py" # handles reading version from src/taskgraph/__init__.py
78-
7976
### Test
8077
[tool.pytest.ini_options]
8178
xfail_strict = true

src/taskgraph/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

5-
__version__ = "14.4.1"
5+
import importlib.metadata
6+
7+
__version__ = importlib.metadata.version("taskcluster-taskgraph")
68

79
# Maximum number of dependencies a single task can have
810
# https://docs.taskcluster.net/docs/reference/platform/queue/api#createTask

taskcluster/docker/decision/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ LABEL maintainer="Release Engineering <release+taskgraph@mozilla.com>"
33

44
# %include src
55
# %include packages
6-
# %include .hatch_build.py
76
# %include README.rst
87
# %include pyproject.toml
98
# %include uv.lock

0 commit comments

Comments
 (0)