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

Get package version from library metadata #1608

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

PProfizi
Copy link
Contributor

@PProfizi PProfizi commented Jun 4, 2024

This PR implements retrieval of the package's version from its metadata, as defined in the pyproject.toml, as is shown in the PyAnsys best practices.

@PProfizi PProfizi added the maintenance Repository structure maintenance label Jun 4, 2024
@PProfizi PProfizi self-assigned this Jun 4, 2024
@PProfizi PProfizi added this to the v0.12.3 milestone Jun 4, 2024
@PProfizi PProfizi requested a review from BClappe June 4, 2024 14:03
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.29%. Comparing base (311f012) to head (44139a7).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1608      +/-   ##
==========================================
- Coverage   85.55%   81.29%   -4.27%     
==========================================
  Files          83       83              
  Lines        9823     9825       +2     
==========================================
- Hits         8404     7987     -417     
- Misses       1419     1838     +419     


__version__ = importlib_metadata.version("ansys-dpf-core")
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does it get the version from exactly? @PProfizi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BClappe from the pyproject.toml, meaning we have only one source of truth, and it is in the package metadata file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is part of the work to adhere to PyAnsys best practices.

@PProfizi PProfizi merged commit 14397e5 into master Jun 4, 2024
43 of 44 checks passed
@PProfizi PProfizi deleted the maint/get_version_from_metadata branch June 4, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Repository structure maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants