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

Initial version_checker refactor #6018

Merged
merged 15 commits into from
Jan 24, 2019
Merged

Conversation

medariox
Copy link
Contributor

  • 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

@ghost
Copy link

ghost commented Jan 16, 2019

DeepCode analyzed this pull request.
There are no new issues.

@ghost
Copy link

ghost commented Jan 18, 2019

DeepCode analyzed this pull request.
There are no new issues.

@medariox medariox added this to the 0.3.0 milestone Jan 18, 2019
@medariox medariox mentioned this pull request Jan 19, 2019
@medariox
Copy link
Contributor Author

Fixes #5726

@medariox
Copy link
Contributor Author

Docker installs will compare the current installed version with the latest release on GitHub. I think that is what you meant @p0psicles



class UpdateManager(object):
def __init__(self):
Copy link
Contributor

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):
Copy link
Contributor

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

Copy link
Contributor

@labrys labrys left a 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.

@medariox
Copy link
Contributor Author

@labrys That's right, it's what we want.

@medariox medariox merged commit 64c35d7 into develop Jan 24, 2019
@medariox medariox deleted the feature/refactor-version-checker branch January 24, 2019 13:52
@labrys
Copy link
Contributor

labrys commented Jan 24, 2019

@medariox lol I was agreeing with you. I'm saying its a good design choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants