Conversation
soxofaan
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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