Skip to content

CI: Fix TestPyPI "dev0" versions for master commits on tags#729

Merged
adrienverge merged 1 commit intomasterfrom
ci/fix-testpypi-version-if-on-latest-tag
Mar 23, 2025
Merged

CI: Fix TestPyPI "dev0" versions for master commits on tags#729
adrienverge merged 1 commit intomasterfrom
ci/fix-testpypi-version-if-on-latest-tag

Conversation

@adrienverge
Copy link
Copy Markdown
Owner

This fixes a problem in the custom versions v1.37.0.devN built for publishing on TestPyPI since commit 325fafa "Publish each master commit with a unique version on TestPyPI".

Such versions are constructed by suffixing .devN, where N is the number of commits since last tags. In the N = 0 case, we need to add --long to git describe --tags. Otherwise it yields v1.37.0 instead of v1.37.0-0-gbe92e15, and the CI fails, e.g. on https://github.com/adrienverge/yamllint/actions/runs/14017589005/job/39245225221

packaging.version.InvalidVersion: Invalid version: '1.37.0.devv1.37.0'

This fixes a problem in the custom versions `v1.37.0.devN` built for
publishing on TestPyPI since commit 325fafa "Publish each master commit
with a unique version on TestPyPI".

Such versions are constructed by suffixing `.devN`, where `N` is the
number of commits since last tags. In the `N = 0` case, we need to add
`--long` to `git describe --tags`. Otherwise it yields `v1.37.0` instead
of `v1.37.0-0-gbe92e15`, and the CI fails, e.g. on
https://github.com/adrienverge/yamllint/actions/runs/14017589005/job/39245225221

    packaging.version.InvalidVersion: Invalid version: '1.37.0.devv1.37.0'
@adrienverge adrienverge merged commit bce26d6 into master Mar 23, 2025
17 checks passed
@adrienverge adrienverge deleted the ci/fix-testpypi-version-if-on-latest-tag branch March 23, 2025 09:41
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.815%. remained the same
when pulling 44873f8 on ci/fix-testpypi-version-if-on-latest-tag
into be92e15 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants