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

Mistyped package name causes infinite loop #3200

Closed
2 of 3 tasks
intgr opened this issue Oct 13, 2020 · 10 comments
Closed
2 of 3 tasks

Mistyped package name causes infinite loop #3200

intgr opened this issue Oct 13, 2020 · 10 comments
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@intgr
Copy link
Contributor

intgr commented Oct 13, 2020

  • 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: Tested on macOS & Arch Linux
  • Poetry version: 1.1.2
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I converted my dependencies file using DepHell from Pipfile to requirements.txt to Poetry pyproject.toml. Trying to use this converted file, Poetry for some reason got stuck in an infinite loop. I tracked it down to one bad line.

The PyPI package has a name ruamel.yaml (with a dot), but my dependencies had it with a hyphen: ruamel-yaml

[tool.poetry.dependencies]
ruamel-yaml = "*"

Running poetry lock on such a file reproduces the infinite loop.

This may be partially causing #2094 ("Poetry is extremely slow when resolving the dependencies").

image

I cannot trigger this issue by using the Poetry command, however. If I write poetry add ruamel-yaml, it adds dependency with the correct name "ruamel.yaml" = "^0.16.12" and poetry lock works fine with that.

@intgr intgr added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 13, 2020
@abn
Copy link
Member

abn commented Oct 13, 2020

Looks like there is a cyclic dependency involved here.

   1: selecting ruamel.yaml (0.16.12)
   1: fact: ruamel.yaml (0.16.12) depends on ruamel.yaml.clib (>=0.1.2)
   1: selecting ruamel.yaml (0.16.12)
   1: fact: ruamel.yaml (0.16.12) depends on ruamel.yaml.clib (>=0.1.2)

@intgr
Copy link
Contributor Author

intgr commented Oct 13, 2020

Note that if the dependency is added to pyproject.toml with a dot "ruamel.yaml" = "^0.16.12", it does not trigger the issue. It's somehow caused by the package name in pyproject.toml.

@abn
Copy link
Member

abn commented Oct 13, 2020

@intgr noticed that. Appreciate the details in your issue report, it is extremely helpful.

@abn abn added the area/solver Related to the dependency resolver label Oct 13, 2020
@abn
Copy link
Member

abn commented Oct 13, 2020

This seems to be the same as #3132.

@abn
Copy link
Member

abn commented Oct 13, 2020

The issue was in how we normalised the name of the package. This needs a fix in core. And another change in poetry itself.

@domdfcoding
Copy link

Wondering whether there has been any progress on this?

@intgr
Copy link
Contributor Author

intgr commented Jul 4, 2021

As I understand, commit python-poetry/poetry-core@b0d9086 was supposed to fix this?

@domdfcoding
Copy link

I have tested this out and there still seems to be an issue. I've installed the latest (prerelease) poetry and poetry-core from PyPI, but with the following pyproject.toml there's still and infinite loop:

[tool.poetry]
name = "demo"
version = "1"
description = "A Demo"
authors = []

[tool.poetry.dependencies]
python = ">= 3.6"
"ruamel-yaml" = "*"
$ poetry lock
Updating dependencies
Resolving dependencies... (138.2s)

(I'm not a poetry user, so I might have gone wrong somewhere)

@dimbleby
Copy link
Contributor

This was fixed at python-poetry/poetry-core#328

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/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

6 participants