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

Add __version__ attribute #49

Merged
merged 7 commits into from
Oct 30, 2024
Merged

Add __version__ attribute #49

merged 7 commits into from
Oct 30, 2024

Conversation

mehmetcanay
Copy link
Member

@mehmetcanay mehmetcanay commented Oct 29, 2024

  • Added _version.py to hold version value in __version__
  • Changed the publish action to substitute the version in _version.py instead of setup.py (the regex needs to be checked).
  • Imported __version__ from _version.py to __init__.py to expose the attribute. The user should be able to print the version of the package with the command datastew.__version__.

closes #38

@mehmetcanay mehmetcanay added enhancement New feature or request ci/cd labels Oct 29, 2024
@mehmetcanay mehmetcanay self-assigned this Oct 29, 2024
Copy link
Member

@tiadams tiadams left a comment

Choose a reason for hiding this comment

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

Can you add a unit test that simply checks if datastew.__version__ is in the fornat x.y.z?

@mehmetcanay
Copy link
Member Author

Can you add a unit test that simply checks if datastew.__version__ is in the fornat x.y.z?

I can also extend this unique test if you'd like to check if the version retrieved is in the canonical format, if in the future you would like to use prefixes like a, b, rc. PEP already provides a function for it in https://packaging.python.org/en/latest/specifications/version-specifiers/#appendix-parsing-version-strings-with-regular-expressions

@tiadams tiadams merged commit 6307836 into main Oct 30, 2024
4 checks passed
@tiadams tiadams deleted the add-version-fn branch October 30, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'version' function to retrieve current package version
2 participants