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

Use importlib.metadata rather than pkg_resources for version metadata #97

Merged
merged 6 commits into from
Oct 6, 2022

Conversation

norlandrhagen
Copy link
Contributor

Description of proposed changes

PR for Issue #89

Fixes #89

cc @maxrjones

Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Thanks @norlandrhagen!

What's the motivation for placing the code in a new module rather than __init__.py?

@norlandrhagen
Copy link
Contributor Author

No strong motivation for separating out version from __init__. Just decided to mirror Pandas and cmip6. Will gladly move it back into __init__.py if you think that's best.

@maxrjones
Copy link
Member

No strong motivation for separating out version from __init__. Just decided to mirror Pandas and cmip6. Will gladly move it back into __init__.py if you think that's best.

Thanks for the explanation! I think since this is a small amount of code relative to those examples we could minimize the number of modules and keep it in __init__. After that it'll be great to merge this in!

xbatcher/_version.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2022

Codecov Report

Merging #97 (266edf0) into main (f13b125) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          182       182           
  Branches        37        33    -4     
=========================================
  Hits           182       182           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Not too familiar with pkg_resources/importlib, but looks ok to me!

Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

A couple suggestions so that the metadata imports aren't included in xbatcher's list of public objects.

xbatcher/__init__.py Outdated Show resolved Hide resolved
xbatcher/__init__.py Outdated Show resolved Hide resolved
norlandrhagen and others added 2 commits October 6, 2022 10:03
Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Thanks @norlandrhagen!

@maxrjones maxrjones merged commit c92e7d5 into xarray-contrib:main Oct 6, 2022
@norlandrhagen norlandrhagen deleted the version_switch branch October 6, 2022 21:09
@maxrjones maxrjones added the maintenance Maintenance tasks label Oct 6, 2022
@maxrjones maxrjones changed the title issue #89. Use importlib.metadata rather than pkg_resources Use importlib.metadata rather than pkg_resources for version metadata Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use importlib.metadata rather than pkg_resources
4 participants