Skip to content

Poetry 2: restore the set_poetry method on poetry.console.command.Command #9980

@DavidVujic

Description

@DavidVujic

Issue Kind

Other

Description

The API of the Command class was changed in Poetry v2: the set_poetry instance method on the class has been removed. I think this method is useful for plugins, the Multiproject in specific where a build process is triggered based on Python code in temporary directories.

Impact

By restoring the set_poetry, plugins like Multiproject will not have to rely on the internals of the Command instance. (see workarounds)

Workarounds

Current workaround is implemented, to support Poetry before and after v2.

if hasattr(self, "set_poetry"):
    self.set_poetry(project_poetry)
elif hasattr(self, "_poetry"):
    self._poetry = project_poetry

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions