Skip to content

Mistyped package name causes infinite loop #3200

Closed

Description

@intgr
  • 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.

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Oct 13, 2020
  2. abn commented on Oct 13, 2020

    @abn
    Member

    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)
    
  3. intgr commented on Oct 13, 2020

    @intgr
    ContributorAuthor

    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.

  4. abn commented on Oct 13, 2020

    @abn
    Member

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

  5. abn commented on Oct 13, 2020

    @abn
    Member

    This seems to be the same as #3132.

  6. added a commit that references this issue on Oct 13, 2020
  7. abn commented on Oct 13, 2020

    @abn
    Member

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

  8. domdfcoding commented on Jul 4, 2021

    @domdfcoding

    Wondering whether there has been any progress on this?

  9. intgr commented on Jul 4, 2021

    @intgr
    ContributorAuthor

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

  10. domdfcoding commented on Dec 2, 2021

    @domdfcoding

    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)

  11. dimbleby commented on May 31, 2022

    @dimbleby
    Contributor
  12. github-actions commented on Mar 1, 2024

    @github-actions

    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.

  13. locked as resolved and limited conversation to collaborators on Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/solverRelated to the dependency resolverkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions