Skip to content
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

Credentials missing in pip when resolving deps #5649

Closed
3 tasks done
RoloffMatek opened this issue May 19, 2022 · 6 comments
Closed
3 tasks done

Credentials missing in pip when resolving deps #5649

RoloffMatek opened this issue May 19, 2022 · 6 comments
Labels
area/error-handling Bad error messages/insufficient error handling kind/bug Something isn't working as expected

Comments

@RoloffMatek
Copy link

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Win10

  • Poetry version: 1.1.13

  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Hi all,

today I was finally able to figure out why my poetry add/install/update commands got stuck. I am using poetry behind a proxy and therefore configured poetry to use a private pypi repo. For this repo I also configured the credentials. When I add/install pypi packages that consist of simple whl files everything is fine. However when I install big packages like numpy or scipy that consist of zipped src files poetry gets stuck. At the beginning I thought it was a credentials/network problem. However today I stepped with a debugger through the process of adding for example numpy and I could see that the download worked. Poetry got stuck when it tried to install numpy into a venv in a temp folder, I guess it makes it to figure out the dependencies. The problem is that the process gets stuck in poetry/inspection/info.py in line 467. Due to the debugger I saw the arguments that were used to execute pip and I ran them in a cmd in the tempfolder by myself. And tada - this pip was asking to enter username and password. This is why it got stuck infinetely. As a workaround I added a global pip.ini file where the username and password of the private pypi is specified. Now it runs like a charm. My question ist is that behavior intended? Did I make a mistake in my setup?

@RoloffMatek RoloffMatek added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 19, 2022
@Secrus
Copy link
Member

Secrus commented May 19, 2022

Hi. Have you configured your credentials as in docs: https://python-poetry.org/docs/repositories/#configuring-credentials ?

@RoloffMatek
Copy link
Author

RoloffMatek commented May 19, 2022

Hi,

yes I used poetry config http-basic.my-private-pypi username password. Like I said the credentials work when I installed/added simple whl files that didn't depend on complex other packages like numpy etc.

@Secrus Secrus removed the status/triage This issue needs to be triaged label May 19, 2022
@Secrus
Copy link
Member

Secrus commented May 19, 2022

Ok, could you try master branch please? Easiest way is to use pipx (so you won't break your stable poetry installation).

Install Poetry from VCS

pipx install --force --suffix=@git 'poetry @ git+https://github.com/python-poetry/poetry.git'

Install Poetry Core from VCS

pipx inject --force poetry@git 'poetry-core @ git+https://github.com/python-poetry/poetry-core.git'

Note poetry@git refers to the vcs version of Poetry installed above.

@Secrus Secrus added the status/waiting-on-response Waiting on response from author label May 19, 2022
@RoloffMatek
Copy link
Author

It seems like I am unable to connect to GitHub due to my proxy restrictions. I think somebody who knwos really well what's going on inside poetry's dependency resolution should check whether the credentials of private repos are forwarded correctly to the temporary pip in the venv where packages are installed in order to resolve their dependencies. Otherwise this fresh pip doesn't have the credentials for the private repo and asks for them. Since this happens in a subprocess the process gets stuck forever.

@neersighted neersighted added area/error-handling Bad error messages/insufficient error handling and removed status/waiting-on-response Waiting on response from author labels Oct 10, 2022
@neersighted
Copy link
Member

Addressed by #6724 (that is to say, we now will error out instead of hanging).

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/error-handling Bad error messages/insufficient error handling kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants