Skip to content

Commit 239b245

Browse files
committed
Add ctl to dev group and fix action-lint
1 parent 07b08ba commit 239b245

File tree

3 files changed

+53
-8
lines changed

3 files changed

+53
-8
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@ jobs:
3333
- name: Install UV
3434
uses: astral-sh/setup-uv@v4
3535
with:
36-
version: "latest"
36+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
3737

3838
- name: Install dependencies
3939
run: uv sync
4040

4141
- name: Check prerelease type
4242
id: release
4343
run: |
44-
echo is_prerelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').is_prerelease))") >> "$GITHUB_OUTPUT"
45-
echo is_devrelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').is_devrelease))") >> "$GITHUB_OUTPUT"
46-
echo "version=$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\"))" >> "$GITHUB_OUTPUT"
47-
echo major_minor_version=$(uv run python -c "from packaging.version import Version; print(f\"{Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').major}.{Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').minor}\")") >> "$GITHUB_OUTPUT"
44+
VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
45+
echo is_prerelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_prerelease))") >> "$GITHUB_OUTPUT"
46+
echo is_devrelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_devrelease))") >> "$GITHUB_OUTPUT"
47+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
48+
echo major_minor_version=$(uv run python -c "from packaging.version import Version; v = Version('$VERSION'); print(f'{v.major}.{v.minor}')") >> "$GITHUB_OUTPUT"
4849
echo latest_tag=$(curl -L \
4950
-H "Accept: application/vnd.github+json" \
5051
-H "Authorization: Bearer ${{ github.token }}" \
@@ -53,10 +54,14 @@ jobs:
5354
| jq -r '.tag_name') >> "$GITHUB_OUTPUT"
5455
5556
- name: Check tag version
56-
if: github.event.release.tag_name != format('v{0}', steps.release.outputs.version)
5757
run: |
58-
echo "Tag version does not match python project version"
59-
exit 1
58+
EXPECTED_TAG="v${{ steps.release.outputs.version }}"
59+
if [ "${{ github.event.release.tag_name }}" != "$EXPECTED_TAG" ]; then
60+
echo "Tag version does not match python project version"
61+
echo "Expected: $EXPECTED_TAG"
62+
echo "Got: ${{ github.event.release.tag_name }}"
63+
exit 1
64+
fi
6065
6166
- name: Check prerelease and project version
6267
if: github.event.release.prerelease == true && steps.release.outputs.is_prerelease == 0 && steps.release.outputs.is_devrelease == 0

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,13 @@ all = [
409409
{include-group = "types"},
410410
]
411411
dev = [
412+
{include-group = "ctl"},
412413
{include-group = "tests"},
413414
{include-group = "lint"},
414415
{include-group = "docs"},
415416
{include-group = "types"},
416417
"ipython",
417418
"requests",
418419
"pre-commit>=2.20.0",
420+
"codecov",
419421
]

uv.lock

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)