Skip to content

[poetry-core] Inconsistent state of Dependency after calling set_constraint() #4589

@radoering

Description

@radoering
  • 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: any
  • Poetry version: current master of poetry-core
  • Link of a Gist with the contents of your pyproject.toml file: not applicable

Issue

When calling set_constraint() on a Dependency object, the _pretty_constraint attribute is not changed. This leads to an inconsistent state of the Dependency object. Because pretty_constraint is used in base_pep_508_name and therefore indirectly in __str__, this issue probably can result in incorrect constraints being printed resp. written to a file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/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