-
Notifications
You must be signed in to change notification settings - Fork 41
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
Version warning #327
base: master
Are you sure you want to change the base?
Version warning #327
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.
cool, thanks for starting this PR
openeo/__init__.py
Outdated
def check_if_latest_version(): | ||
try: | ||
package = 'openeo' | ||
response = requests.get(f'https://pypi.org/pypi/{package}/json') |
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 think we should put a timeout here of just a couple of seconds so that users are not blocked to do import openeo
when pypi is slow
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 also think we should do this check like once a day, or cache the pypi.org response
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.
for example, the pip implementation is roughly contained here: https://github.com/pypa/pip/blob/main/src/pip/_internal/self_outdated_check.py
apparently the check frequency is once a week there
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've added the timeout. The pip implementation using the cache would require some more time to be ported over.
quick note: with #176 the conda package is now also distributed through conda, which makes this "version warning" feature a bit more complex: you don't want to push users to |
Trying to solve this issue: #296