def _xpkg_cmd(self, args, env_dir=None, use_var=True, should_fail=False):

        # Setup arguments
        if env_dir is None:
            env_dir = self.env_dir

        if use_var:
            env_args = []
            os.environ[core.xpkg_root_var] = env_dir
        else:
            # Clear variable
            if core.xpkg_root_var in os.environ:
                del os.environ[core.xpkg_root_var]

            # Set out args
            env_args = ['--root',env_dir]

        # Have the tool return the full stack trace in debug mode
        if not should_fail:
            args.insert(0, '--debug')

        # Run the command directly calling the python xpkg implementation
        cmd = [sys.executable, '-m', 'xpkg.main'] + args + env_args

        try:
            output = util.shellcmd(cmd, shell=False, stream=False)

            # If we got here but we should of failed error out
            if should_fail:
                args = ' '.join(cmd)
                msg = 'Command "%s" did not return a non-zero exit code' % args
                self.fail(msg)

        except subprocess.CalledProcessError as c:
            # Capture this error, and only re throw if we were not excepting
            # an exception
            output = c.output

            if not should_fail:
                raise c

        return output
Run Xpkg command and return the output.
dataset/ETHPy150Open jlisee/xpkg/python/tests/fulltests.py/TestBase._xpkg_cmd