Skip to content

ci: fix pre-release versioning issues - #414

Merged
TheGupta2012 merged 1 commit into
mainfrom
ci/fix-pre-release-issues
Aug 25, 2026
Merged

ci: fix pre-release versioning issues#414
TheGupta2012 merged 1 commit into
mainfrom
ci/fix-pre-release-issues

Conversation

@TheGupta2012

Copy link
Copy Markdown
Member

The pre-release run failed its source distribution test:

+ IMPORTLIB_VERSION=1.1.0a0
+ VERSION_ATTRIBUTE=1.1.0-a.0
+ [[ 1.1.0a0 != 1.1.0-a.0 ]]
Versions do not match

Failing run: https://github.com/qBraid/pyqasm/actions/runs/32819763552/job/97715243458

One version, two spellings. pre_build.sh stamped qbraid-core's 1.1.0-a.0 into
pyproject.toml. setuptools normalized that to 1.1.0a0 for the package
metadata, while write_version_file.py copied the raw string into _version.py.
So importlib.metadata.version and pyqasm.__version__ disagreed, and the
RELEASE_BUILD check in test_sdist.sh compares them as plain strings.

The check was right to fail. On every pre-release, pip show pyqasm reported
1.1.0a0 while pyqasm.__version__ reported 1.1.0-a.0. #413 is what exposed
it: before that, the reset in build_sdist.sh discarded the stamp, so both sides
read the plain release version and the check never saw a pre-release.

This normalizes the stamped version to PEP 440 before writing it, so
pyproject.toml, _version.py and the package metadata all agree.
packaging is available at that point, because pre_build.sh installs
qbraid-core in the same block and qbraid-core requires it.

Verified locally

Ran the full sequence in a throwaway clone with its own venv:

pre_build.sh (PRE_RELEASE_BUILD=true)
  Deploying pre-release version '1.1.0-a.0'
  Setting version to 1.1.0a0
  pyproject.toml:  version = "1.1.0a0"
  _version.py:     __version__ = version = '1.1.0a0'

build_sdist.sh
  dist/pyqasm-1.1.0a0.tar.gz

test_sdist.sh (RELEASE_BUILD=true)
  Importlib version: 1.1.0a0
  Version attribute: 1.1.0a0
  802 passed, 3 skipped

Not addressed here

  • __version_tuple__ is still approximate: parse_version_tuple("1.1.0a0")
    yields (1, 1, '0a0'). That is better than the (1, 1, '0-a', '0') it produced
    before, but it is not a real PEP 440 parse.
  • The version collision is separate. [project] version is still 1.1.0, so the
    stamper keeps returning 1.1.0a0, and those wheels are already on PyPI. The
    publish step will keep failing with 400 File already exists until the base
    version moves to the next unreleased one, spelled with an -alpha suffix so
    that repeat pre-releases bump to a1, a2 and so on.

pre_build.sh wrote qbraid-core's spelling, 1.1.0-a.0, into pyproject.toml.
setuptools normalized it to 1.1.0a0 for the package metadata, while _version.py
kept the raw string, so pyqasm.__version__ disagreed with pip show and
test_sdist.sh failed its version check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@argus-eye

argus-eye Bot commented Aug 25, 2026

Copy link
Copy Markdown

Argus review

Auto-review is off for this repo. Tick the box below to run a review on this PR.

  • Trigger Argus review

Estimated cost

  • Files changed: 2
  • Diff lines (±): 6
  • Historical avg: ~243.6k tokens · ~$0.95 · across last 10 review(s)

Tip: you can also comment @argus-eye review at any time.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ee0f98e-a2ca-40b0-b66f-24d2aaa1fd62

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@TheGupta2012

Copy link
Copy Markdown
Member Author

Pre-release job for sdist worked, merging

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TheGupta2012
TheGupta2012 merged commit 5313d03 into main Aug 25, 2026
33 of 51 checks passed
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