Example #1
0
    def test_8(self):
        """Ensure that include modules are copied."""
        self._reset_dest_repository()

        src_pkg = self._get_src_pkg("foo", "1.1.0")
        copy_package(
            package=src_pkg,
            dest_repository=self.dest_install_root,
        )

        dest_pkg = self._get_dest_pkg("foo", "1.1.0")
        dest_variant = dest_pkg.iter_variants().next()

        # do a resolve
        ctxt = ResolvedContext(
            ["foo==1.1.0"],
            package_paths=[self.dest_install_root, self.install_root]
        )

        resolved_variant = ctxt.get_resolved_package("foo")
        self.assertEqual(dest_variant.handle, resolved_variant.handle)

        # this can only match if the include module was copied with the package
        environ = ctxt.get_environ(parent_environ={})
        self.assertEqual(environ.get("EEK"), "2")
Example #2
0
    def test_8(self):
        """Ensure that include modules are copied."""
        self._reset_dest_repository()

        src_pkg = self._get_src_pkg("foo", "1.1.0")
        copy_package(
            package=src_pkg,
            dest_repository=self.dest_install_root,
        )

        dest_pkg = self._get_dest_pkg("foo", "1.1.0")
        dest_variant = next(dest_pkg.iter_variants())

        # do a resolve
        ctxt = ResolvedContext(
            ["foo==1.1.0"],
            package_paths=[self.dest_install_root, self.install_root]
        )

        resolved_variant = ctxt.get_resolved_package("foo")
        self.assertEqual(dest_variant.handle, resolved_variant.handle)

        # this can only match if the include module was copied with the package
        environ = ctxt.get_environ(parent_environ={})
        self.assertEqual(environ.get("EEK"), "2")
Example #3
0
def action_resolve(requests_or_rxt):
    from rez.resolved_context import ResolvedContext  # noqa

    if os.path.isfile(requests_or_rxt):
        context = ResolvedContext.load(requests_or_rxt)
    else:
        context = ResolvedContext(requests_or_rxt.split(" "))

    resolved_env = context.get_environ()
    resolved_env_str = json.dumps(resolved_env)
    _flush(resolved_env_str)