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 rangeStrategy=update-lockfile for poetry.lock #7358

Closed
rarkins opened this issue Sep 23, 2020 · 15 comments
Closed

Support rangeStrategy=update-lockfile for poetry.lock #7358

rarkins opened this issue Sep 23, 2020 · 15 comments
Labels
manager:poetry Poetry package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Sep 23, 2020

What would you like Renovate to be able to do?

Perform lockfile-only updates for Poetry

Did you already have any implementation ideas?

No. We'd need to work out if there's a Poetry command that lets us update a locked dependency version without updating all other dependencies unnecessarily.

Are there any workarounds or alternative ideas you've tried to avoid needing this feature?

Pinning package versions, but that's undesirable for libraries

Is this a feature you'd be interested in implementing yourself?

Probably not

@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 Sep 23, 2020
@shughes-uk
Copy link

shughes-uk commented Sep 23, 2020

Hiya, this should reproduce it, the pyproject.toml is "in date" but the lockfile is stale https://github.com/shughes-uk/renovate-repro

@rarkins
Copy link
Collaborator Author

rarkins commented Sep 23, 2020

Note for future: nomnomdata-cli is set to ^0.1.5 and has version 0.1.5 installed however currently 0.1.7 is available. Unless a perfect poetry command exists for surgically updating that version, it looks like we could maybe massage the value in pyproject.toml: https://github.com/shughes-uk/renovate-repro/blob/d97faafb04321a80f5064550ec917dc6d187ca22/pyproject.toml#L9 to a fixed version e.g. 0.1.7 before then massaging it back before committing, because the lock file does not contain the original range.

@viceice
Copy link
Member

viceice commented Sep 23, 2020

🤔 interesting idea, can work. Did you elaborate existing poetry commands?

@rarkins
Copy link
Collaborator Author

rarkins commented Sep 24, 2020

Haven't looked yet. I prefer to use a manager's commands whenever possible though

@shughes-uk
Copy link

shughes-uk commented Sep 28, 2020

poetry add package@latest is probably what you would want to do that, it does trigger a lock file update though.
poetry add --dry-run package@latest may work as it'll give you the latest version in the first line, without touching the lock file?

Using version ^1.1.2 for pandas

This ticket might also contain some useful info python-poetry/poetry#1614

@rarkins
Copy link
Collaborator Author

rarkins commented Sep 28, 2020

That doesn't sound like the right command because what we want is to keep the range in pyproject.toml the same and won't it get changed by that command?

@shughes-uk
Copy link

its not the perfect command but it would help you do this

maybe massage the value in pyproject.toml: https://github.com/shughes-uk/renovate-repro/blob/d97faafb04321a80f5064550ec917dc6d187ca22/pyproject.toml#L9 to a fixed version e.g. 0.1.7 before then massaging it back before committing

@viceice
Copy link
Member

viceice commented Sep 29, 2020

Checked the poetry issue above and saw, currently there is no command to do a minimal lockfile Update.

The suggested workaround there is to add and remove a dummy package. ☹️

@rarkins
Copy link
Collaborator Author

rarkins commented Sep 29, 2020

Maybe we should create our own dummy package for this purpose if it's the best way.

@rarkins
Copy link
Collaborator Author

rarkins commented Oct 2, 2020

Seems there will soon be a new poetry lock --no-update option: https://github.com/python-poetry/poetry/pull/3034/files

@cailloumajor
Copy link

🚀 python-poetry/poetry#3034 is merged and released since https://github.com/python-poetry/poetry/releases/tag/1.1.1

@shughes-uk
Copy link

This is on the roadmap for poetry and seems to be exactly what I want
python-poetry/poetry#461 (comment)

@rarkins
Copy link
Collaborator Author

rarkins commented Jan 13, 2022

Forked to https://github.com/renovate-reproductions/7358

I think we still need to work out which exact command(s) should be run

@rarkins rarkins added status:requirements Full requirements are not yet known, so implementation should not be started and removed status:ready labels Jan 13, 2022
@shughes-uk
Copy link

shughes-uk commented Jan 25, 2022

poetry update seems to be the command if you want to just update specific packages in the lockfile (within version constraints)

@koffie
Copy link

koffie commented Jul 20, 2022

Is this still an open issue? To quote from https://docs.renovatebot.com/configuration-options/#rangestrategy

update-lockfile = Update the lock file when in-range updates are available, otherwise replace for updates out of range. Works for bundler, composer, npm, yarn, terraform and poetry so far

So the documentation explicitly says this is supported!

@rarkins rarkins closed this as completed Oct 30, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:poetry Poetry package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

5 participants