Skip to content

Commit

Permalink
Allow to configure when deprecated config settings will be removed on…
Browse files Browse the repository at this point in the history
… a per setting basis

Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Nov 4, 2023
1 parent b8a3350 commit aee5bf6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/rez/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aee5bf6

Please sign in to comment.