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

Feat/version notification #198

Merged
merged 8 commits into from Jun 1, 2020
Merged

Feat/version notification #198

merged 8 commits into from Jun 1, 2020

Conversation

asfakianakis
Copy link
Contributor

@asfakianakis asfakianakis commented May 27, 2020

Raise a warning when a user is using an old SDK version. The user would see something like this:

user_warning

This closes #126.

Comment on lines 200 to 216
latest_version, _ = get_latest_package_version(pkg_name)
try:
version_mask = StrictVersion(__version__) < StrictVersion(
latest_version
)
except ValueError as e:
if "invalid version number" in str(e):
version_mask = LooseVersion(__version__) < LooseVersion(
latest_version
)
else:
raise e
if version_mask:
logger.warning(
f"You are using vortexasdk version {__version__}, however version {latest_version} is available.\n"
f"You should consider upgrading via the 'pip install vortexasdk --upgrade' command."
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the warning at the point where we are creating the client. Not sure if that's the best place to do so. Also open to any comments on whether we could do this code more robust, i.e. that's a 'nice-to-have' check, we don't want this to be the cause of failing to create the client.

tests/test_utils.py Outdated Show resolved Hide resolved
vortexasdk/utils.py Outdated Show resolved Hide resolved
@asfakianakis asfakianakis linked an issue May 27, 2020 that may be closed by this pull request
vortexasdk/client.py Outdated Show resolved Hide resolved
vortexasdk/utils.py Outdated Show resolved Hide resolved
vortexasdk/client.py Outdated Show resolved Hide resolved
vortexasdk/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@KitBurgess KitBurgess left a comment

Choose a reason for hiding this comment

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

This will be helpful functionality. Just added a couple of comments.

vortexasdk/client.py Outdated Show resolved Hide resolved
vortexasdk/client.py Outdated Show resolved Hide resolved
@KitBurgess KitBurgess merged commit 02a5d2e into master Jun 1, 2020
@KitBurgess KitBurgess deleted the feat/version_notification branch June 1, 2020 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert users of SDK if they're using an outdated version
2 participants