feat(cli): add option to migrate outdated configs#9830
Merged
abn merged 8 commits intopython-poetry:mainfrom Nov 18, 2024
Merged
feat(cli): add option to migrate outdated configs#9830abn merged 8 commits intopython-poetry:mainfrom
abn merged 8 commits intopython-poetry:mainfrom
Conversation
7cddf77 to
52ea929
Compare
|
Deploy preview for website ready! ✅ Preview Built with commit 99ea24b. |
643add9 to
7e6db62
Compare
Member
|
@finswimmer can/should we add a confirmation step? Alternatively, preserve the old file with a new suffix ( |
3a05279 to
9836cda
Compare
Member
Author
|
@abn I've added a confirmation step. |
9836cda to
5928db8
Compare
Secrus
approved these changes
Nov 17, 2024
For now only applied to FileConfigSource on remove_property
Rename or delete keys from ConfigSource. Migrate existing values including unset them.
5928db8 to
99ea24b
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR add a new option
--migratetopoetry config. This option enables users to migrate explicit set configs that have been renamed or changed in other ways in new Poetry versions.Some question:
Only
FileConfigSourcehas 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 forDictConfigSource?It's probably possible to detect on runtime if the Config contains outdated options. Should we inform users, that they should run
poetry config --migrateto fix it? (I thinks if yes, I will do it in a separate PR.)