I have created and deployed a Cypress tested streamlit app across three sites. I thought some people here might be interested in some of the implementation details.
To run it yourself type the following in a terminal:
Very cool! Just to get an understanding of this. Does this mean that nothing in the front-end is changed until the full computation is completed or what is the result of this?
Thanks for sharing @SimonBiggs, and welcome to the community! I don’t have the background to evaluate the actual content, but it looks like a great example of a Streamlit app
While building it by the way, I greatly desired for there to be a way to flag an import as “please watch for changes within this package also”. Either that or an option to say “please watch all files in this git repo that are not found within gitignore, and then update if anything in this repo changes”.
Also, another item hoped for, is a way to host multiple Streamlit apps from the one server. My thought is one could point to a directory then the landing page would be a neat index of all nested files that are both .py and have an import streamlit within them. Clicking on each of those can then take one to a url named after the file itself (but without the .py extension) as well as the url being nested if the file is found nested within the directory tree.
By default, Streamlit monitors for changes within the current working directory. So as long as the code in your app resides in that directory, we should be picking it up.
If you’re talking about other packages that are imported, we intentionally do not monitor those, because of the performance implications of walking the entire tree of packages.
We’ve heard this feedback from many users, and it’s my guess that we’ll find a solution for this somewhat soonish. Unfortunately, I don’t have a timeline on when at this moment.
Do you think it might be neat to have some sort of functionality to auto-reload just one package by choice of the user? I do this within Jupyter notebooks by using the following tool:
If you don’t implement it, I’ll just implement it myself by adding a watchdog watcher to the git repo filtered by the git ignore, and then on file change running the standard library’s deepreload method and then running Streamlit’s rerun execution method.
I think that’s probably the best way to go for now. If you implement it and then show that it’s really valuable, then perhaps that’s a good candidate for a future community-supported custom component.
@SimonBiggs@randyzwitch Hosting multiple apps on one server natively in Streamlit would be great! In the meantime, I built streamlit-launchpad which can carry this out for you:
Thanks, I’ve tried using cypress-file-upload and following exactly how you do it. It seems to be a little better, but I still got some fails, my script need sometimes 3 retries to get all to pass…
Can you describe how your compute function works ? particularly the ReportStatus bit
Thanks a lot
Update : This flakiness happens only on remote server. On a local machine, all tests pass (it did before using your method, and still do). I’ve temporarily used timeouts everywhere, they do the job for now, but it would be nice to have your solution adapted to this case ^^.