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 can't add any package anymore in a reasonable amount of time #4855

Closed
2 tasks done
floatingpurr opened this issue Nov 30, 2021 · 11 comments
Closed
2 tasks done

Comments

@floatingpurr
Copy link
Contributor

floatingpurr commented Nov 30, 2021

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

Issue

Here's my env:

  • macOS Big Sur
  • pyenv (Python 3.10)
  • Poetry version 1.1.12 (installed with pipx)
  • My config
$ poetry config --list
cache-dir = "/myPath"
experimental.new-installer = true
installer.parallel = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.path = "{cache-dir}/virtualenvs"  # /myPath/virtualenvs

I have worked with poetry smoothly so far. Suddenly, it looks like poetry can't resolve dependencies anymore in a reasonable amount of time. It happens, for example, with pytest. This is my starting pyproject.toml

click to expand my pyproject.toml
[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Foo <foo@example.org>"]

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

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

if I run $ poetry add pytest --dev -vvv

I get this output (ie: poetry stuck in Resolving dependencies... )

click to expand command output
Using virtualenv: /projectPath/foo/.venv
PyPI: 147 packages found for pytest *
Using version ^6.2.5 for pytest

Updating dependencies
Resolving dependencies...
   1: fact: foo is 0.1.0
   1: derived: foo
   1: fact: foo depends on pytest (^6.2.5)
   1: fact: foo depends on pytest (^6.2.5)
   1: selecting foo (0.1.0)
   1: derived: pytest (>=6.2.5,<7.0.0)
PyPI: 1 packages found for pytest >=6.2.5,<7.0.0
   1: fact: pytest (6.2.5) depends on attrs (>=19.2.0)
   1: fact: pytest (6.2.5) depends on iniconfig (*)
   1: fact: pytest (6.2.5) depends on packaging (*)
   1: fact: pytest (6.2.5) depends on pluggy (>=0.12,<2.0)
   1: fact: pytest (6.2.5) depends on py (>=1.8.2)
   1: fact: pytest (6.2.5) depends on toml (*)
   1: fact: pytest (6.2.5) depends on atomicwrites (>=1.0)
   1: fact: pytest (6.2.5) depends on colorama (*)
   1: selecting pytest (6.2.5)
   1: derived: colorama
   1: derived: atomicwrites (>=1.0)
   1: derived: toml
   1: derived: py (>=1.8.2)
   1: derived: pluggy (>=0.12,<2.0)
   1: derived: packaging
   1: derived: iniconfig
   1: derived: attrs (>=19.2.0)
PyPI: 42 packages found for colorama *
^C   1: Version solving took 93.503 seconds.
   1: Tried 1 solutions.

As you can see, I stopped the process after 96s. I can't understand what is going on and why it suddenly started taking so long for installing just pytest. How can I fix it up?

PS: this issue started after installing ruamel.yaml with poetry. I'm quite sure it was just a coincidence. But that is what happened.

PPS: the issue persists also after clearing cache with $ poetry cache clear --all pypi

@floatingpurr floatingpurr changed the title Poetry can't add pytest anymore in a reasonable amount of time Poetry can't add any package anymore in a reasonable amount of time Dec 1, 2021
@floatingpurr
Copy link
Contributor Author

Edit: Looks like I can't even start a new project from scratch

$ poetry new foo
$ cd foo
foo$ poetry install
Creating virtualenv foo in /mypath/foo/.venv
Updating dependencies
Resolving dependencies... (210.8s) 

...still hanging

@clintonroy
Copy link
Contributor

Can you truss it? see what it's hanging on

@floatingpurr
Copy link
Contributor Author

floatingpurr commented Dec 13, 2021

It depends on the run. It looks like it could be related to networking problems #2094 (comment).

Still investigating on it. Hints welcome.

@theoturner
Copy link

By opening a devcontainer in VSCode and running poetry update in it, I cut a 4000+ second update into a ~200 second update. My lockfile was then up to date and I continue dev as normal.

@floatingpurr
Copy link
Contributor Author

Any updates about it?

@Alfro
Copy link

Alfro commented Apr 19, 2022

Hey @floatingpurr are you still reproducing this issue consistently on 1.1.13? I gave it a try with your toml and had no issues, but the command output is very different as of now. Did you discard network issues on your environment?

@floatingpurr
Copy link
Contributor Author

Unfortunately this issue doesn't happen programmatically. Read #2094 for more.

@Alfro
Copy link

Alfro commented Apr 21, 2022

Ah, it indeed seems quite the non-deterministic issue. Would this count as duplicated of #2094? Might be worth closing in favor of that one.

@floatingpurr
Copy link
Contributor Author

Yep, sure. Pls, reference #2094 for further details

@floatingpurr
Copy link
Contributor Author

See also #2094 (comment) as a possible solution

Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants