Hope you are doing well and enjoying Streamlit. I wanted to let you know that I investigated GitPython, and was finally able to create a scenario requesting the credentials (although not in Streamlit). There’s one other thing to check that I’m curious if you can answer/try out.
What version of git are you are using? You can find this out using
Looking at git-python, there’s some interesting revelation here that I missed earlier: https://github.com/gitpython-developers/GitPython/blob/master/git/remote.py#L528 Essentially, it attempts to run
git remote get-url --all (remote_name). In this case
(remote_name) is likely origin for GitHub. However, a much older version of git didn’t have this, so it led to attempting to try
git remote show (remote_name). I am able to confirm that this command definitely requests credentials. This would explain why this problem is not affecting many users. The easy solution here would be to simply upgrade git.
To explain how I missed it, I missed one line in the test python test:
>>> import git
>>> repo = git.Repo(".", search_parent_directories=True)
>>> git_root = repo.git.rev_parse("--show-toplevel")
>>> tracking_branch = repo.active_branch.tracking_branch()
>>> remote_name, *branch = tracking_branch.name.split("/")
>>> remote = repo.remote(remote_name)
>>> urls = [url for url in remote.urls] # This line should trigger credentials as urls is a property
I’m feeling pretty confident that this is the underlying problem and would love to hear a confirmation. In any case, while upgrading git would be easy, we are looking into creating a config setting to disable even trying to check the git repo to avoid this matter all together.
Thanks again for working with me to help make Streamlit better. I really appreciate it!