From 8dc85c2c4e337ba47f0856bcc61539fae309ca1e Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Sat, 25 Jul 2026 09:45:15 -0700 Subject: [PATCH 1/2] Fix AttributeError in Wrapper.print_package_versions `rez-tool ++versions` crashed with: AttributeError: Package instance has no attribute 'path' `print_package_versions` builds its output rows from `pkg.path`, but `Package` has no `path` attribute; the filesystem location of a package is exposed as `uri` (as used by rez-view, rez-help and rez-cp). Any use of `++versions` on a suite tool therefore raised instead of printing the version table. Use `pkg.uri` and add a regression test that runs `Wrapper.print_package_versions` against a saved suite. --- src/rez/tests/test_suites.py | 13 +++++++++++++ src/rez/wrapper.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rez/tests/test_suites.py b/src/rez/tests/test_suites.py index 8b4b20351b..fcd343453f 100644 --- a/src/rez/tests/test_suites.py +++ b/src/rez/tests/test_suites.py @@ -9,6 +9,7 @@ per_available_shell, install_dependent from rez.resolved_context import ResolvedContext from rez.suite import Suite +from rez.wrapper import Wrapper from rez.config import config from rez.system import system import subprocess @@ -141,6 +142,18 @@ def test_3(self) -> None: self._test_serialization(s) + def test_print_package_versions(self) -> None: + """Test that a wrapper can print the versions of its package.""" + c_foo = ResolvedContext(["foo"]) + s = Suite() + s.add_context("foo", c_foo) + + suite_path = os.path.join(self.root, uuid.uuid4().hex) + s.save(suite_path) + + w = Wrapper(os.path.join(suite_path, "bin", "fooer")) + self.assertEqual(w.print_package_versions(), 0) + @per_available_shell() @install_dependent() def test_executable(self, shell) -> None: diff --git a/src/rez/wrapper.py b/src/rez/wrapper.py index 75e401e636..a48cd4817a 100644 --- a/src/rez/wrapper.py +++ b/src/rez/wrapper.py @@ -248,7 +248,7 @@ def print_package_versions(self) -> int: col = local if pkg.is_local else None label = "(local)" if pkg.is_local else "" - rows.append((name, pkg.path, label)) + rows.append((name, pkg.uri, label)) colors.append(col) _pr = Printer() From b5385bb1f77dda80289d39a68973170a7da41c06 Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Sat, 1 Aug 2026 23:17:32 -0700 Subject: [PATCH 2/2] chore: re-trigger CLA check