-
Notifications
You must be signed in to change notification settings - Fork 278
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 version_checker refactor #6018
Conversation
medariox
commented
Jan 16, 2019
- PR is based on the DEVELOP branch
- Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
- Read the contribution guide
DeepCode analyzed this pull request. |
DeepCode analyzed this pull request. |
Fixes #5726 |
Docker installs will compare the current installed version with the latest release on GitHub. I think that is what you meant @p0psicles |
medusa/updater/update_manager.py
Outdated
|
||
|
||
class UpdateManager(object): | ||
def __init__(self): |
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.
Init is not required here right? It's not doing anything.
|
||
def is_latest_version(self): | ||
"""Compare the current installed version with the remote version.""" | ||
if LooseVersion(self.newest_version) > LooseVersion(self.current_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.
newest_version and current_version don't refer to anything in this class. Imo it's cleanest to add them in UpdateManager, as methods and raise exception when not implemented subclassed. Like:
def newest_version(self):
"""Docstring"""
raise NotImplmentedError
def current_version(self):
raise NotImplmentedError
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.
The way it's done with raising NotImplementedError is to enforce subclasses to implement the required methods.
@labrys That's right, it's what we want. |
@medariox lol I was agreeing with you. I'm saying its a good design choice. |