-
Notifications
You must be signed in to change notification settings - Fork 279
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
Migration script: warn and do not migrate #3046
Migration script: warn and do not migrate #3046
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remark: it is not clear from the warning message wether the deprecated config file is being loaded or ignored in the CLI call case. Otherwise, LGTM
removal="4.1.0", | ||
) | ||
raise SystemExit | ||
issue_deprecation_warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we can simplify this is that there is no circular import issue any more AND no SystemExit
being raised. The slight caveat is that now yt config migrate
will advise users ... to use yt config migrate
!
$ yt config migrate
[…]/yt/yt/utilities/logger.py:4: VisibleDeprecationWarning: The configuration file […]/.config/yt/ytrc is deprecated. Please migrate your config to […]/.config/yt/yt.toml by running: 'yt config migrate'
Deprecated since v4.0.0 . This feature will be removed in v4.1.0
from yt.config import ytcfg
INFO: using configuration file: […]/.config/yt/yt.toml.
Writing a new config file to: […]/.config/yt/yt.toml
Backing up the old config file: […]/.config/yt/ytrc.bak
Note that this shouldn't be an issue as an subsequent calls to yt config migrate
won't show the warning and won't do anything (as the config has already been migrated).
Related to #3044.
Here is the behaviour
yt.toml
andytcfg
are present: raise a warningyt.toml
does not exist,ytcfg
exists: raise another warning and do not migrateyt.toml
will be created (see Unnecessary config file creation #3045)