Skip to content

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented Mar 4, 2022

As the title.

@germa89 germa89 added the Bug label Mar 4, 2022
@germa89 germa89 self-assigned this Mar 4, 2022
@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #940 (c180826) into main (4aa4afd) will increase coverage by 0.26%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #940      +/-   ##
==========================================
+ Coverage   72.79%   73.06%   +0.26%     
==========================================
  Files          39       39              
  Lines        5675     5713      +38     
==========================================
+ Hits         4131     4174      +43     
+ Misses       1544     1539       -5     


# major, minor, patch
version_info = 0, 60, "dev0"
version_info = 0, 61, "dev0"
Copy link
Contributor

Choose a reason for hiding this comment

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

You might consider fetching this from the package info using importlib_metadata

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

try:
    import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
    import importlib_metadata

# Read from the pyproject.toml
# major, minor, patch
__version__ = importlib_metadata.version('ansys-mapdl-core')

This does not work if you change pyproject.toml version locally and restart python. It seems it is directly linked to the version installed. I wonder who this will behave after we do a release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems it is directly linked to the version installed.

That's correct as the metadata is modified when installing with pip.

Single source versioning is going to have drawbacks no matter what we choose to implement I think. Developers will be smart enough to work around this I think, but we can always revert if necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I felt we should have relied in directly reading the pyproject.toml file and grabbing the version directly from there. But I didn't see any good method to reliable open that file. And everybody seems to be using this for some reason.

Copy link
Collaborator

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

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

LGTM.

@akaszynski akaszynski merged commit 8160b80 into main Mar 11, 2022
@akaszynski akaszynski deleted the fix/Bumping-version-file-to-0.61 branch March 11, 2022 10:12
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