Add timeout to pypi version request, preventing undue hangups on startup#855
Conversation
|
We thought a bit about it. What do you think of this solution? Where we only show it if we found a new version on time. |
|
Have you tested the timing between the browser opening and the message being printed in the console? My only concern with this new approach is the following scenario:
|
|
Another thought: We may also want to read the pip conf (through an approach like This is a more robust solution than just a timeout, and would work for e.g. private pypi setups like artifactory. However, it is nontrivial to know ahead of time where pip will fetch from (overloads at global/user level, even per-pip command). So maybe the complexity outweighs the benefits. |
|
I revered to your original idea, but we now execute it in a thread, so it is never delaying on the terminal. We still add a timeout, so the thread doesn't hang around (500ms should be enough, overwise indeed, focus is probably shifted). Using a Lock/mutex, we make sure the printing of text does not mix. |
41c73c8 to
95cd603
Compare
|
Thanks @ntjess ! |
Fixes #853