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

Poetry add takes forever #8790

Closed
xtfocus opened this issue Dec 14, 2023 · 5 comments
Closed

Poetry add takes forever #8790

xtfocus opened this issue Dec 14, 2023 · 5 comments
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues

Comments

@xtfocus
Copy link

xtfocus commented Dec 14, 2023

Hi,
I'm a Linux user, new to poetry. Installed Poetry (1.7.1) with

curl -sSL https://install.python-poetry.org | python3 -

then I created a virtual environtment with

mkvirtualenv myenv -p  ~/.pyenv/versions/3.9.16/bin/python3.9

Then after poetry init, I got pyproject.toml:

[tool.poetry]
name = "faraday"
version = "0.1.0"
description = ""
authors = ["john <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
  1. When I do poetry add any packages, the command just hang for several minutes until I hit Ctrl C to kill it.

  2. Poetry self update stuck on Updating Poetry version ... forever (10min until I turn it off).

Please tell me if you need any information to demystify this.

@xtfocus xtfocus added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 14, 2023
@dimbleby
Copy link
Contributor

obviously this doesn't happen for everyone else

unless you can provide a reproducible example it's unlikely that anyone but you can debug what's happening.

A dockerfile is a particularly convenient way of sharing such an example, ensuring that it really does reproduce not only on your machine

@clintonroy
Copy link
Contributor

As the bug template asks for, what happens when you add -vvv to the add command? Have you tried disabling the keyring? Possibly it's building a package, are there any processes kicked off?

@smurfix
Copy link

smurfix commented Dec 16, 2023

Happens for me too.

poetry install -vvv does not enlighten.

In my case, the reason is in fact that it tries to access the keyring and doesn't get a DBus reply. I found this by judicious use of strace and pdb since poetry doesn't tell us what it's doing. This should be fixed.

Have you tried disabling the keyring?

Have you tried teaching poetry to tell us (a) that this might be necessary (b) how to do it? poetry --help or poetry install --help do not enlighten. I had to hack poetry/utils/password_manager.py:PoetryKerring.is_available to return False to get past this point.

Adding a breakpoint to this classes' _check method in line 120 reveals that this method is hammered from multiple threads, which might be part of the problem.

Finally, (c), I have to admit that I fail to understand why poetry even tries to do any keyring operations when it clearly doesn't need to. And no in my case it's not building anything (and there is no reason why it should need any privileges even if it did), just pulling stuff from pypi and unpacking it into a venv; in fact, the aforementioned hack results in a perfectly working poetry installation.

@radoering
Copy link
Member

Have you tried teaching poetry to tell us (a) that this might be necessary (b) how to do it? poetry --help or poetry install --help do not enlighten. I had to hack poetry/utils/password_manager.py:PoetryKerring.is_available to return False to get past this point.

IMO, this is too much of an edge case to put into poetry --help and maybe even poetry install --help. Maybe, it's something for the FAQ.

Finally, (c), I have to admit that I fail to understand why poetry even tries to do any keyring operations when it clearly doesn't need to.

I'm not that deep into this keyring topic, but I suppose #7038 (comment) might be a reason why we are trying to use keyring even if it's not necessary.

Nevertheless, closing as duplicate of #8623 or #8761.

@radoering radoering closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2023
@radoering radoering added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged labels Dec 16, 2023
Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

5 participants