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

feat(cli): add option to migrate outdated configs #9830

Merged
merged 8 commits into from
Nov 18, 2024

Conversation

finswimmer
Copy link
Member

@finswimmer finswimmer commented Nov 5, 2024

This PR add a new option --migrate to poetry config. This option enables users to migrate explicit set configs that have been renamed or changed in other ways in new Poetry versions.

image

Some question:

Only FileConfigSource has been updated in that way, that if a property is removed, it is checked whether the section to which this property belongs is now empty and should be removed from the file. Do we want the same behavior for DictConfigSource?

It's probably possible to detect on runtime if the Config contains outdated options. Should we inform users, that they should run poetry config --migrate to fix it? (I thinks if yes, I will do it in a separate PR.)

  • Added tests for changed code.
  • Updated documentation for changed code.

@finswimmer finswimmer added the impact/docs Contains or requires documentation changes label Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Deploy preview for website ready!

✅ Preview
https://website-hz4cmaakz-python-poetry.vercel.app

Built with commit 99ea24b.
This pull request is being automatically deployed with vercel-action

@finswimmer finswimmer requested a review from a team November 5, 2024 20:22
@finswimmer finswimmer force-pushed the config-migration branch 2 times, most recently from 643add9 to 7e6db62 Compare November 7, 2024 07:25
@finswimmer finswimmer marked this pull request as ready for review November 7, 2024 07:27
@finswimmer finswimmer added this to the Poetry 2.0 milestone Nov 15, 2024
@abn
Copy link
Member

abn commented Nov 15, 2024

@finswimmer can/should we add a confirmation step? Alternatively, preserve the old file with a new suffix (.old)?

@finswimmer
Copy link
Member Author

@abn I've added a confirmation step.

@abn abn merged commit b59d9ab into python-poetry:main Nov 18, 2024
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/docs Contains or requires documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants