Skip to content

Commit 3cddb83

Browse files
committed
chore: clean up dep listing in ci, bump build deps
Use yq to list the project optional dependencies instead of hatch. This is less hassle and doesn't require version pinning. While here use specific builder dependency pins, maintained by renovate, and pin any uvx tools to a specific version.
1 parent 0ce9925 commit 3cddb83

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ jobs:
120120
if: ${{ ! matrix.extras_best_effort && matrix.skip_extras == '' }}
121121
run: uv sync --all-extras
122122

123+
# Work around actions/runner-images#7443 and install yq on windows runners
124+
- name: Make yq tool available on Windows runners
125+
if: "matrix.os == 'windows-latest'"
126+
run: choco install yq --version 4.53.3
127+
123128
- name: Install additional backends (best effort)
124129
if: ${{ matrix.extras_best_effort || matrix.skip_extras != '' }}
125130
env:
@@ -130,10 +135,12 @@ jobs:
130135
set -eu -o pipefail
131136
EXTRAS=$(
132137
# for each extra, output the extra name followed by the listed dependencies, space-separated
133-
# This pins hatch to 1.15 or older to work around pypa/hatch#2118, and
134-
# virtualenv 20.x or older, to work around pypa/hatch#2193.
135-
uvx --from 'hatch<1.16' --with 'virtualenv<21' hatch project metadata \
136-
| jq --raw-output '."optional-dependencies" | to_entries[] | "\(.key) \(.value | join(" "))"'
138+
yq --output-format=yaml '
139+
.project.optional-dependencies
140+
| to_entries[]
141+
| .value |= join(" ")
142+
| "\(.key) \(.value)"
143+
' pyproject.toml
137144
)
138145
while read -r -a extra_deps; do
139146
extra_name="${extra_deps[0]}"
@@ -220,10 +227,10 @@ jobs:
220227
run: |
221228
uv build
222229
rm -f dist/.gitignore # get-releasenotes can't handle non-dist files here
223-
echo "version=$(uvx hatch version)" >> "$GITHUB_OUTPUT"
230+
echo "version=$(uvx uv-dynamic-versioning@0.14.0)" >> "$GITHUB_OUTPUT"
224231
225232
- name: Check build
226-
run: uvx twine check --strict dist/*
233+
run: uvx twine@7.0.0 check --strict dist/*
227234

228235
- name: Prepare Release Note
229236
id: note

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,21 @@ Issues = "https://github.com/mjpieters/rummikub-solver/issues"
5858
Changelog = "https://github.com/mjpieters/rummikub-solver/blob/main/CHANGELOG.md"
5959

6060
[build-system]
61-
requires = ["hatchling~=1.27", "uv-dynamic-versioning~=0.8"]
61+
requires = ["hatchling>=1.31.0,<1.32.0", "uv-dynamic-versioning>=0.14.0,<0.15.0"]
6262
build-backend = "hatchling.build"
6363

6464
[tool.hatch.version]
6565
source = "uv-dynamic-versioning"
6666

6767
[tool.uv]
6868
required-version = "~=0.9"
69+
# Ensure that uv rebuilds the project when git commit or tags change
70+
# to update the version
71+
cache-keys = [
72+
{ file = "pyproject.toml" },
73+
{ git = { commit = true, tags = true } },
74+
{ env = "UV_DYNAMIC_VERSIONING_BYPASS" }
75+
]
6976

7077
[tool.uv-dynamic-versioning]
7178
fallback-version = "0.0.0"

0 commit comments

Comments
 (0)