-
Notifications
You must be signed in to change notification settings - Fork 307
Update check_satpy
to use new show_version
to display package versions
#2913
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how I feel about these changes and I haven't felt great about the discussion since it was restarted in the related issue. This may mean that I'm just missing something from the feature request, but overall it feels like a lot of flexibility is being added and things changed for something that I consider rather static and single-use.
- Why does
show_versions
need to have apackages
keyword argument? In my opinion (others can feel free to disagree) this should just be a hardcoded list. This function is for us, the maintainers, not for users. Users run it to tell us what we need to know. - Why should
check_satpy
callshow_versions
? It feels like they should be separate. There are times when duplicated code is acceptable and if these changes were done to reduce duplication I'm not sure it is worth it. - Why did
extras
need to be renamed?
It seems like both check_satpy
and show_versions
were implemented/re-implemented to be even more flexible and to be a generic "check this import for me" and I'm just not sure that task is complicated enough that Satpy needs to be providing a generic utility for users to use. What I tried to say above is that I think of these types of functions as tools to assist maintainers in helping users, not as generic tools for the user.
dbfcd55
to
66712e8
Compare
Thanks for the feedback! I figured that From there:
rounding up I think we should either:
|
Good point with it being in the issue template. We wouldn't want users to have to run multiple things to show similar information. In that case I agree that the versions after the readers/writers in |
satpy/utils.py
Outdated
try: | ||
return importlib.metadata.version(package_name) | ||
except importlib.metadata.PackageNotFoundError: | ||
return None | ||
|
||
def _check_import(module_names): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to tell from github's diff display, but is this function used anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! I've removed the now unused _check_imports
.
66712e8
to
fd5749d
Compare
I guess it's ready for review? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2913 +/- ##
==========================================
- Coverage 96.06% 96.05% -0.01%
==========================================
Files 373 373
Lines 54465 54479 +14
==========================================
+ Hits 52321 52330 +9
- Misses 2144 2149 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Test Coverage Report for Build 11236933264Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just couple of styling issues that I think linter should have caught.
Co-authored-by: Panu Lahtinen <pnuu+git@iki.fi>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks! I have one wish for the tests.
check_satpy
to use new show_version
to display package versions
MR to add
show_versions
tosatpy.utils
to allow for use insatpy.utils.check_satpy
.Use case is to help in figuring out run-time environment factors while debugging issues.