mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
Merge pull request #2767 from apaz-cli/ap/suppress_streamlit
Disable streamlit email prompt
This commit is contained in:
commit
6d3dd5c484
1 changed files with 18 additions and 0 deletions
|
@ -215,6 +215,21 @@ def check_streamlit_install(io):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def write_streamlit_credentials():
|
||||||
|
from streamlit.file_util import get_streamlit_file_path
|
||||||
|
# See https://github.com/Aider-AI/aider/issues/772
|
||||||
|
|
||||||
|
credential_path = Path(get_streamlit_file_path()) / "credentials.toml"
|
||||||
|
if not os.path.exists(credential_path):
|
||||||
|
empty_creds = '[general]\nemail = ""\n'
|
||||||
|
|
||||||
|
os.makedirs(os.path.dirname(credential_path), exist_ok=True)
|
||||||
|
with open(credential_path, "w") as f:
|
||||||
|
f.write(empty_creds)
|
||||||
|
else:
|
||||||
|
print("Streamlit credentials already exist.")
|
||||||
|
|
||||||
|
|
||||||
def launch_gui(args):
|
def launch_gui(args):
|
||||||
from streamlit.web import cli
|
from streamlit.web import cli
|
||||||
|
|
||||||
|
@ -223,6 +238,9 @@ def launch_gui(args):
|
||||||
print()
|
print()
|
||||||
print("CONTROL-C to exit...")
|
print("CONTROL-C to exit...")
|
||||||
|
|
||||||
|
# Necessary so streamlit does not prompt the user for an email address.
|
||||||
|
write_streamlit_credentials()
|
||||||
|
|
||||||
target = gui.__file__
|
target = gui.__file__
|
||||||
|
|
||||||
st_args = ["run", target]
|
st_args = ["run", target]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue