python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.7k stars 2.27k forks source link

Poetry add/update fails to ask for git user/password again if not running in -vv #3492

Open houfu opened 3 years ago

houfu commented 3 years ago

Issue

I use Poetry to install a python package on a git repository in my private gitea server, which requires user and password authentication.

If I install normally (without -vv option), poetry asks for my user and password first, then enters into resolve dependency hell.

If I install with -vv, poetry now asks for my user and password multiple times, but installs as expected.

Steps to reproduce.

  1. Create a new python project with clean pyproject.toml
  2. CMD poetry add git+https://[git URL]
  3. poetry asks for username and password for [git URL]
  4. poetry outputs Updating dependencies, then Resolving dependencies... (xxx.s).
  5. poetry never stops resolving dependencies. Press Ctrl-C
  6. This time with -vv option -- CMD poetry add -vv git+https://[git URL]
  7. poetry asks for username and password for [git URL]
  8. poetry outputs Updating dependencies, then Resolving dependencies...
  9. poetry asks for username and password for [git URL] for the second time
  10. poetry resolves dependencies, writes lock file
  11. poetry outputs Finding the necessary packages for the current system
  12. poetry asks for username and password for [git URL] for the third time
  13. poetry outputs Package operations: ...
  14. package install as per normal.

My guess

Poetry was supposed to ask for my user name and password multiple times in normal mode but did not.

As a user, I expected poetry not to ask me to repeatedly enter my credentials during the same run.

hakanyi commented 3 years ago

Same issue here - duplicate of #3409

artinnok commented 3 years ago

Same issue with adding package from private GitHub repo :(

miohtama commented 2 years ago

I also encountered this issue, but my context is different. If you misspell the Github repository name, the Poetry installation will never finish.

If you use dependency like:

web3-ethereum-defi = { git = "https://github.com/tradingstrategy-ai/web3-ethereum-defi.git", rev = "bbf7827b82738b8870bd5f892aca4f0c9325c751" }

... but you misspell the repository name:

web3-ethereum-defi = { git = "https://github.com/tradingstrategy-ai/notexist.git", rev = "bbf7827b82738b8870bd5f892aca4f0c9325c751" }

... and you are not running -vv.

Poetry will try to install forever and does not fail with an error.

image