Skip to content

Add config option to disable email prompt #11395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

wyattscarpenter
Copy link
Contributor

@wyattscarpenter wyattscarpenter commented May 18, 2025

Describe your changes

This creates a new configuration option, server.prompt, which controls if the "Welcome to Streamlit!" prompt is shown (and email is asked for and ~/.streamlit folder is created).

This is distinct from server.headless because the server is not run in headless mode (eg: the browser opens automatically).

Nota bene: because no .streamlit folder is created, the telemetry warning displays every time, which I think is fine. I assume it's better to inform the user of this (for the purposes of informed implicit consent) than the slight annoyance it presumably will cause some.

GitHub Issue Link (if applicable)

Closes #8098

Testing Plan

  • Unit Tests: a python unit test analogous to the one for server.headless

I'd like to test to ensure ~/.streamlit is not created if prompt is false, but I found it too difficult to figure out the right way to do this.

Side note

As I was doing this on Windows 10, in cmd, I got many pre-commit errors of the form Failed to open the file: lib/streamlit/elements/arrow.py. Is it binary file?, which I believe is an encoding error probably stemming from the fact that until https://peps.python.org/pep-0686/ goes through the default encoding on Windows is some random windows garbage, so files with emoji are detected as binary. However, I couldn't see anything obviously wrong with the relevant pre-commit hook (which doesn't even have that error message in its source code?) https://github.com/Lucas-C/pre-commit-hooks/blob/master/pre_commit_hooks/insert_license.py, so I decided not to investigate further. Just mentioning in case this helps someone somehow.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

Copy link
Contributor

snyk-io bot commented May 18, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@wyattscarpenter wyattscarpenter marked this pull request as ready for review May 18, 2025 19:56
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@lukasmasuch lukasmasuch added change:feature impact:users status:needs-product-approval PR requires an approval from product before merging. labels May 19, 2025
@jrieke
Copy link
Collaborator

jrieke commented May 22, 2025

I can understand the reasoning for not showing the email prompt, but what's the reason for not creating the ~/.streamlit folder? I'm also not sure if we should do both things in one config options, seems a bit confusing to me.

@wyattscarpenter
Copy link
Contributor Author

The ~/.streamlit folder is only created here to house the user's answer to the prompt, as I understand it; so if there is no prompt, there is no cause to create the folder.

@jrieke
Copy link
Collaborator

jrieke commented May 22, 2025

Oh, got it! I think we also started using the ~/.streamlit folder for telemetry recently, but I'll let the engineers figure out in which situations we can avoid generating it.

For this config option, I'm fine with merging it, but:

  • Let's change the name to server.showEmailPrompt to make it a bit easier to understand.
  • Let's leave out details about creating the ~/.streamlit folder from the description of the config option, since that's an implementation detail (and we might change that at any point, regardless of this config option). Maybe something like "Show a prompt asking the user for their email when they start Streamlit for the first time. If server.headless is set to True, that prompt will not be shown regardless of this config option". (cc @sfc-gh-dmatthews if you want to refine).

@jrieke jrieke changed the title add prompt mode and test Add config option to disable email prompt May 23, 2025
@jrieke
Copy link
Collaborator

jrieke commented May 28, 2025

Hey @wyattscarpenter, one more question for understanding: how do you actually plan to use this config option?

From the issue description, it seems like the use case here is preventing people (e.g., within your company) from leaking their email, which I assume would mean you somehow set a global config file for every user in ~/.streamlit, which contains this config option. That's a fair use case, but then above in your PR, you mention that you also want to avoid creating the ~/.streamlit folder, so I'm a bit confused :D

@jrieke jrieke self-assigned this May 28, 2025
@wyattscarpenter
Copy link
Contributor Author

@jrieke I suppose the most apropos answer to your question is thus: the GitHub repo in which our project lives has a .streamlit folder in it with a local config file, in which the option is set. (Currently server.headless, but later it will be server.showEmailPrompt.) And therefore the option is applied to the project without the creation of a ~/.streamlit folder 🙂

@wyattscarpenter
Copy link
Contributor Author

Alright, thanks; I've now incorporated those changes you mentioned two weeks ago, and fixed the merge conflict that arose in the interim. Should be good to go now.

Co-authored-by: Debbie Matthews <debbie.matthews@snowflake.com>
@jrieke
Copy link
Collaborator

jrieke commented Jun 6, 2025

the GitHub repo in which our project lives has a .streamlit folder in it with a local config file, in which the option is set. (Currently server.headless, but later it will be server.showEmailPrompt.) And therefore the option is applied to the project without the creation of a ~/.streamlit folder 🙂

Ok yeah, that seems like a fair use case. Approved from product side, I'll ping our engineers to give the code another look.

@jrieke jrieke removed the status:needs-product-approval PR requires an approval from product before merging. label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to disable prompts when running streamlit for the first time
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy