Skip to content

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
@codecov
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     

except ImportError: # Python < 3.10 (backport)
import importlib_metadata as importlib_metadata

__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
@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.

3 participants