Skip to content

Commit

Permalink
Add debug_old_commands back since it's actively use.
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Feb 5, 2024
1 parent d7d7a84 commit 081b422
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ As communicated in the 2.114.0 release notes, we've followed through on the remo

- Configuration settings
- `rtx_as_yaml`: No replacement. This functionality will be completely removed in the future.
- `debug_old_commands`: No replacement. This was a no-op.
- `warn_commands2`: No replacement. This was a no-op.
- `error_commands2`: No replacement. This was a no-op.
- `rez_1_cmake_variables`: You can use the `REZ_BUILD_TYPE` CMake variable instead of `CENTRAL`.
Expand Down
3 changes: 3 additions & 0 deletions src/rez/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,11 @@ def _parse_env_var(self, value):
"default_relocatable": Bool,
"set_prompt": Bool,
"prefix_prompt": Bool,
# Note that if you want to remove a warn_* or debug_* config, you will
# need to search for "config.warn(" or "config.debug(" to see if it's used.
"warn_old_commands": Bool,
"error_old_commands": Bool,
"debug_old_commands": Bool,
"rez_1_environment_variables": Bool,
"disable_rez_1_compatibility": Bool,
"make_package_temporarily_writable": Bool,
Expand Down
9 changes: 9 additions & 0 deletions src/rez/rezconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,15 @@
# Will be removed in a future release.
error_old_commands = False

# Print old commands and their converted rex equivalent. Note that this can
# cause very verbose output.
#
# This currently has no effect.
#
# .. deprecated:: 2.114.0
# Will be removed in a future version.
debug_old_commands = False

# If True, Rez will continue to generate the given environment variables in
# resolved environments, even though their use has been deprecated in Rez-2.
# The variables in question, and their Rez-2 equivalent (if any) are:
Expand Down
14 changes: 13 additions & 1 deletion src/rez/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from rez.utils.filesystem import canonical_path
import unittest
from rez.tests.util import TestBase
from rez.vendor.schema.schema import SchemaError
import os
import logging


class TestCommands(TestBase):
Expand Down Expand Up @@ -100,8 +102,18 @@ def _test_rextest_package(self, version):
# first prepend should still override
self._test_package(pkg, {"REXTEST_DIRS": "TEST"}, cmds)

def test_old_yaml(self):
def test_old_yaml_raises(self):
"""Resolve a yaml-based package with old-style bash commands."""
with self.assertRaises(SchemaError):
self._test_rextest_package("1.1")

def test_old_yaml_compatibility_enabled(self):
"""Resolve a yaml-based package with old-style bash commands."""
self.update_settings({"disable_rez_1_compatibility": False, "warn_old_commands": True})
with self.assertLogs(logger=logging.getLogger("rez.utils.logging_"), level=logging.WARNING):
self._test_rextest_package("1.1")

self.update_settings({"disable_rez_1_compatibility": False, "warn_old_commands": False})
self._test_rextest_package("1.1")

def test_new_yaml(self):
Expand Down

0 comments on commit 081b422

Please sign in to comment.