Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement package versioning #158

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

richardesp
Copy link

Summary

This PR adds version retrieval to qiskit_ibm_transpiler by:

  • Creating a version.py module to obtain the package version using importlib.metadata.version().
  • Exposing __version__ in __init__.py to provide a standardized way to access the version.
  • Ensuring compatibility with Git repositories by appending the commit hash if no release tag is present.
  • Following PEP 8 and Qiskit’s contribution guidelines.

Details and Comments

  • The versioning logic follows the same approach as used in Qiskit.
  • If the package is installed, it retrieves the version from importlib.metadata.version().
  • If running from a Git repository without a release tag, the commit hash is appended (e.g., 0.10.1.dev0+a1b2c3d).
  • The implementation has been formatted using black and checked with ruff to ensure compliance with the project's CI/CD.

Related Issue

Fixes #18

@CLAassistant
Copy link

CLAassistant commented Feb 21, 2025

CLA assistant check
All committers have signed the CLA.

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.

Add a method to get the package version
3 participants