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

Support Poetry v2 dependency format #33509

Open
rarkins opened this issue Jan 10, 2025 Discussed in #33455 · 5 comments
Open

Support Poetry v2 dependency format #33509

rarkins opened this issue Jan 10, 2025 Discussed in #33455 · 5 comments
Labels
manager:poetry Poetry package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jan 10, 2025

Discussed in #33455

Originally posted by ryancausey January 7, 2025

Tell us more.

Poetry v2 has updated their pyproject.toml specification to support the "project" section in the pyproject.toml specification.

This means that there are now more potential locations where dependencies can be defined within a pyproject.toml file:

  1. project.dependencies
  2. project.optional-dependencies
  3. tool.poetry.dependencies
  4. tool.poetry.group.< name >.dependencies

The other rub is that the project.dependencies list doesn't support all of the dependency specifiers that one of the dependency locations under too.poetry does: https://python-poetry.org/docs/dependency-specification/

It would be nice to have renovate support this new dependency location and formats under the project heading.

Minimal reproduction: https://github.com/ryancausey/poetry-v2-support-reproduction

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:poetry Poetry package manager labels Jan 10, 2025
@finswimmer

This comment was marked as resolved.

@finswimmer

This comment was marked as resolved.

@rarkins
Copy link
Collaborator Author

rarkins commented Jan 13, 2025

the project section is defined by PEP 621. So shouldn't it be already supported? docs.renovatebot.com/modules/manager/pep621

Renovate has separate "managers" for poetry and pep621. If Poetry v2's behavior is now fully aligned with pep621 then we can consider if it's possible to merge these managers and remove the poetry-specific one. Each different lock file variant of pep621 needs separate work, i.e. when Renovate docs say it supports pep621 it doesn't mean "and every possible implementation of lock file now and in the future" - work needs to be done for each different lock file.

@ryancausey
Copy link

ryancausey commented Jan 13, 2025

The poetry docs still indicate there are scenarios where the dependencies under the tool.poetry section should be used, so I don't believe its behavior is fully aligned with pep621 in all cases. https://python-poetry.org/docs/dependency-specification/

In either case, the poetry.lock file is not listed as a supported lock file format under the pep621 manager.

@ryancausey
Copy link

It should also be noted, you can ignore the new pep621 syntax and continue to place all dependencies in the tool.poetry section by adding "dependencies" to the project.dynamic list.

@rarkins rarkins added type:feature Feature (new functionality) and removed type:feature Feature (new functionality) labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:poetry Poetry package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

3 participants