Skip to content

Solve version discrepancy in release#142

Merged
TheGupta2012 merged 4 commits intomainfrom
change-version-handling
Feb 20, 2025
Merged

Solve version discrepancy in release#142
TheGupta2012 merged 4 commits intomainfrom
change-version-handling

Conversation

@TheGupta2012
Copy link
Copy Markdown
Member

@TheGupta2012 TheGupta2012 commented Feb 18, 2025

Issue

  • Releasing v0.2.0 resulted in a version discrepancy -
>> python3 --version
Python 3.11.6

>> pip install pyqasm==0.2.0
Collecting pyqasm==0.2.0
  Using cached pyqasm-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (5.8 kB)
Requirement already satisfied: numpy in /Users/thegupta/Desktop/qBraid/envs/pyqasm/lib/python3.11/site-packages (from pyqasm==0.2.0) (2.2.3)
Requirement already satisfied: openqasm3<2.0.0,>=1.0.0 in /Users/thegupta/Desktop/qBraid/envs/pyqasm/lib/python3.11/site-packages (from openqasm3[parser]<2.0.0,>=1.0.0->pyqasm==0.2.0) (1.0.0)
Requirement already satisfied: antlr4-python3-runtime<4.14,>=4.7 in /Users/thegupta/Desktop/qBraid/envs/pyqasm/lib/python3.11/site-packages (from openqasm3[parser]<2.0.0,>=1.0.0->pyqasm==0.2.0) (4.13.2)
Using cached pyqasm-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (171 kB)
Installing collected packages: pyqasm
Successfully installed pyqasm-0.2.0

>> python3 -c 'import importlib.metadata
print(importlib.metadata.version("pyqasm"))
import pyqasm
print(pyqasm.__version__)
'
0.2.0
0.2.1.dev0+g0fd2956.d20250214

It is unclear why this happened but one change might be the pip version used by cibuildwheel in GitHub runner. The release v0.2.0 used pip==25.0.1 whereas v0.1.0 used pip==24.3.1 on the runners.

Summary of changes

  • To get reproducible results, have added _version.py in the repo and used the dynamic attribute in .toml to get the version (as in the qBraid SDK).

  • This eliminates the dependency on setuptools_scm


Edit : 19 / 02 / 2025

  • The version 0.2.1.dev0+g0fd2956.d20250214 matches the [4th option of Default Versioning Scheme in the docs] (https://setuptools-scm.readthedocs.io/en/latest/usage/)
  • This implies that there were uncommited changes in the repository during the build process
  • Even though the commit 0fd2956 was tagged with v0.2.0, EOL changes might have happened due to the newly added .gitattributes file

Summary of changes

  • Added git reset in the pre-build script to ensure that no uncommitted changes are passed into the build process
  • Using no-guess-dev value for version_scheme to ensure that no dev suffixes are present in the version

@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 force-pushed the change-version-handling branch from bf479f4 to 8bbc663 Compare February 19, 2025 09:49
@TheGupta2012 TheGupta2012 changed the title Remove setuptools_scm and use _version.py for version Solve version discrepancy in release Feb 19, 2025
ryanhill1
ryanhill1 previously approved these changes Feb 19, 2025
@TheGupta2012 TheGupta2012 merged commit 6719abd into main Feb 20, 2025
@TheGupta2012 TheGupta2012 deleted the change-version-handling branch March 12, 2025 06:00
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.

3 participants