From aee5bf64dacbdb69be54309d7f5f38f8ba76b2df Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 4 Nov 2023 13:20:46 -0400 Subject: [PATCH] Allow to configure when deprecated config settings will be removed on a per setting basis Signed-off-by: Jean-Christophe Morin --- src/rez/config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rez/config.py b/src/rez/config.py index e22c95766..0a592322f 100644 --- a/src/rez/config.py +++ b/src/rez/config.py @@ -34,12 +34,13 @@ def _warn_deprecated_settings(data, filepath, envvar=None): if key in _deprecated_settings: message = ( "config setting named {0!r} {1}is " - "deprecated and will be removed in 3.0.0." + "deprecated and will be removed in {2}." ).format( key, "(configured through the {0} environment variable) ".format(envvar) if envvar else "", + _deprecated_settings[key]["removed_in"], ) rez.deprecations.warn( @@ -502,12 +503,12 @@ def _parse_env_var(self, value): # List of settings that are deprecated and should raise # deprecation warnings if referenced in config files. -_deprecated_settings = [ - "warn_old_commands", - "debug_old_commands", - "warn_commads2", - "error_commands2", -] +_deprecated_settings = { + "warn_old_commands": {"removed_in": "3.0.0"}, + "debug_old_commands": {"removed_in": "3.0.0"}, + "warn_commads2": {"removed_in": "3.0.0"}, + "error_commands2": {"removed_in": "3.0.0"}, +} # settings common to each plugin type