-
Notifications
You must be signed in to change notification settings - Fork 5
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
Initial attempt to create base GUI classes #113
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #113 +/- ##
==========================================
- Coverage 93.54% 92.38% -1.16%
==========================================
Files 10 11 +1
Lines 1813 1931 +118
==========================================
+ Hits 1696 1784 +88
- Misses 117 147 +30 ☔ View full report in Codecov by Sentry. |
PYPI = 'PyPI' | ||
|
||
|
||
class BasePackageMetadata(Protocol): |
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.
Is this just for the types? Should it be guarded behind TYPE_CHECKING
? Not saying that's the best practice, I honestly don't know, but it was weird to see the same schema in this protocol class and also in the named tuple below.
author, source, version, and buttons to update, install/uninstall, etc. | ||
""" | ||
|
||
BASE_PACKAGE_NAME = '' |
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.
What is this for? I think the base class should be very well documented so downstream users know what to subclass.
self.install_info_button.addWidget(self.info_choice_wdg) | ||
self.info_choice_wdg.show() | ||
|
||
def _handle_plugin_api_version(self, plugin_api_version): |
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.
As a rule of thumb, if the base class method is raising NotImplementedError
, I think we should explain what's the expected behavior of this method with a docstring.
CONDA = 'Conda' | ||
PYPI = 'PyPI' |
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.
These two globals are also available in the base module. Shall we delete here?
I like it a lot @dalthviz. Just added some comments about documenting the pieces that are meant to be subclassed. The base class docstring should detail how to get to a functional plugin manager in the subclass; e.g. "make sure to subclass all the methods that raise |
Co-authored-by: jaimergp <[email protected]>
Description
Create a set of base GUI classes so the logic implement can be reused while also keeping an implementation for napari
Part of #59
Notes