You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user types streamlit run foo.py, check whether a new version of Streamlit is available in PyPI and, if so, print the following message to the terminal:
A new version of Streamlit is available. [in bold white]
See what's new at https://streamlit.trydiscourse.com/c/announcements
Enter the following command to upgrade:
$ pip install streamlit --upgrade [in green]
Notes:
Use the click package to print in color.
Add a blank line at the end of the print block, so anything we print after that will be spaced out properly.
We don't want to ping PyPI every time, so a simple solution would be to only look for updates with a 5% probability.
Alternately, we could check for updates just once a day by using st.cache with persist to cache the update-checking function to disk, and add a max_age parameter to st.cache that lets you set an age at which the cache becomes invalid.
If the user is offline, don't show any errors.
A logicat place to put the update check is in cli.py inside _main_run().
The text was updated successfully, but these errors were encountered:
@tvst should the styling on this text be flipped? That is, should the "new version" notice at the top be green, and the command prompt be bold white? This would fit the pattern of, e.g., the
You can now view your Streamlit report in your browser. (green)
Local URL: http://localhost:3000 (bold white)
Network URL: http://10.0.1.128:3000 (bold white)
@tvst should the styling on this text be flipped? That is, should the "new version" notice at the top be green, and the command prompt be bold white? This would fit the pattern of, e.g., the
You can now view your Streamlit report in your browser. (green)
Local URL: http://localhost:3000 (bold white)
Network URL: http://10.0.1.128:3000 (bold white)
Occasionally check the installed streamlit version against the latest in PyPI, and show a notice if there's a new version available.
The check runs randomly with a 5% chance, so that we're not spamming the user frequently.
I used `requests` (instead of urllib) for this, which entailed adding it as an explicit dependency in our Pipfile. All the other places in streamlit that used urllib for fetching over HTTP have been replaced with requests. (And there are some additional tests that didn't previously exist.)
Fixes#65
When the user types
streamlit run foo.py
, check whether a new version of Streamlit is available in PyPI and, if so, print the following message to the terminal:Notes:
click
package to print in color.Implementation details
Alternately, we could check for updates just once a day by using
st.cache
withpersist
to cache the update-checking function to disk, and add amax_age
parameter tost.cache
that lets you set an age at which the cache becomes invalid.cli.py
inside_main_run()
.The text was updated successfully, but these errors were encountered: