widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.91k stars 141 forks source link

Add timeout to pypi version request, preventing undue hangups on startup #855

Open ntjess opened 2 weeks ago

ntjess commented 2 weeks ago

Fixes #853

maartenbreddels commented 1 week ago

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.

ntjess commented 1 week ago

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:

ntjess commented 1 week ago

Another thought: We may also want to read the pip conf (through an approach like pip config list -> check if index-url is overwritten) to see which URL should be hit instead of defaulting to pypi.

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.