Skip to content

Fix astral-test-pypa-gh-action publish test bug in patch version retrieval#18174

Merged
zanieb merged 1 commit intomainfrom
zb/fix-jq
Feb 24, 2026
Merged

Fix astral-test-pypa-gh-action publish test bug in patch version retrieval#18174
zanieb merged 1 commit intomainfrom
zb/fix-jq

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Feb 23, 2026

The jq filter used .files[-1].filename to get the latest published version then uses sed to extract the version from a sdist filename, but the last file in the list can be a wheel rather than an sdist in the middle of an upload. When it's a wheel, the filename passes through unchanged and bash complains trying to evaluate it as arithmetic.

e.g.:

astral_test_pypa_gh_action-0.1.1650-py3-none-any.whl: syntax error: invalid arithmetic operator (error token is ".1.1650-py3-none-any.whl")

Surprisingly, this does not fail the job — sed -i "s/0.1.0/0.1.$((patch_version + 1))/g fails silently in its subshell, leaving the version as 0.1.0, test.pypi.org returns 400 File already exists, and the test succeeds because we use skip-existing: true.

@zanieb zanieb changed the title Fix test uv publish CI failure caused by .whl file appearing last in test.pypi.org file list Fix test uv publish bug in patch version retrieval Feb 23, 2026
… in test.pypi.org file list

The jq filter used `.files[-1].filename` to get the latest published version, but the last file in the list can be a `.whl` rather than a `.tar.gz`. The sed regex only matches `.tar.gz` filenames, so the wheel filename passes through unchanged and bash fails trying to evaluate it as arithmetic. Filter to `.tar.gz` files before picking the last entry.
@zanieb zanieb temporarily deployed to uv-test-publish February 23, 2026 23:49 — with GitHub Actions Inactive
@zanieb zanieb changed the title Fix test uv publish bug in patch version retrieval Fix astral-test-pypa-gh-action publish test bug in patch version retrieval Feb 23, 2026
@zanieb zanieb added the testing Internal testing of behavior label Feb 23, 2026
@zanieb zanieb requested a review from woodruffw February 23, 2026 23:58
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@zanieb zanieb marked this pull request as ready for review February 24, 2026 10:35
@zanieb zanieb merged commit f5e00a3 into main Feb 24, 2026
50 checks passed
@zanieb zanieb deleted the zb/fix-jq branch February 24, 2026 10:35
zanieb added a commit that referenced this pull request Mar 2, 2026
#18175)

Per #18174 this should fail but it
depends on hitting the simple API in the middle of a release being
uploaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Internal testing of behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants