renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
16.87k stars 2.21k forks source link

Support Poetry 1.2 groups #17501

Closed KotlinIsland closed 1 year ago

KotlinIsland commented 2 years ago

What would you like Renovate to be able to do?

When you are using Poetry 1.2 and you have a dependency group configured, I would like renovate to work with it,

If this is already implemented then I guess the docs should be updated.

If you have any ideas on how this should be implemented, please tell us here.

no

Is this a feature you are interested in implementing yourself?

Maybe

github-actions[bot] commented 2 years ago

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

jorgebodega commented 1 year ago

I can make a reproducible repository, if no one else can. But probably two or three days since I cannot work on this today.

jorgebodega commented 1 year ago

I have been working on this, not much time, and I've encountered a problem with how poetry handles update.

Basically, poetry update only updates lock file and only if a previous version is installed, not like yarn that updates package.json and yarn.lock. I will open a PR asking that.

By the moment, I have a repository with dependencies on main, dev and test groups and here you can check how only main package is detected.

KotlinIsland commented 1 year ago

poetry add will update the pyproject.toml file. This is probably what you want here.

jorgebodega commented 1 year ago

Yes but poetry add does not check for pending updates. I asked the poetry team and I discover that poetry show -o list the packages outdated but list all, not only the pyproject.toml specified ones.

BradenM commented 1 year ago

@jorgebodega Maybe a separate issue is warranted here, but thought it may help to point out that in my project on poetry v1.2.0 w/ dependency groups, renovate onboarding just completely ignores the pyproject file...

See https://github.com/BradenM/micropy-cli/pull/308

rarkins commented 1 year ago

If Renovate doesn't support groups, and you have only groups, I guess it would be expected. Has anyone created a minimal reproduction? (see definition above)

mkniewallner commented 1 year ago

If Renovate doesn't support groups, and you have only groups, I guess it would be expected. Has anyone created a minimal reproduction? (see definition above)

Just created https://github.com/mkniewallner/renovate-poetry-dependency-groups.

We can see in the dependency dashboard issue that for the project not using dependency groups, all dependencies (dependencies + dev-dependencies) are detected, whereas for the project using dependency groups, Renovate only detects dependencies, and not group.dev.dependencies nor group.typing.dependencies:

poetry_with_dependency_groups/pyproject.toml
 - `orjson 3.8.0`
 - `redis 4.3.3`
 - `SQLAlchemy 1.4.40`
 - `starlette 0.20.0`

poetry_without_dependency_groups/pyproject.toml
 - `orjson 3.8.0`
 - `redis 4.3.3`
 - `SQLAlchemy 1.4.40`
 - `starlette 0.20.0`
 - `mypy 0.961`
 - `pytest 7.1.0`
 - `sqlalchemy2-stubs 0.0.2a27`
 - `types-redis 4.3.19`
rarkins commented 1 year ago

Optimistically, this can be solved with some small changes to the poetry manager extract function

renovate-release commented 1 year ago

:tada: This issue has been resolved in version 32.219.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: