code: def test_build(template, virtualenv):
      # Copy pnpm-lock.yaml to not cause unintended changes tracked by git
      pnpm_lock = Path(__file__).parent / ".." / "pnpm-lock.yaml"
      pnpm_copy = Path(__file__).parent / ".." / "pnpm-lock-copy.yaml"
      shutil.copy(str(pnpm_lock), str(pnpm_copy))
  
      # Using the js/preview/test directory will use the workspace code
      dir_ = (
          Path(__file__).parent
          / ".."
          / "js"
          / "preview"
          / "test"
          / "testtextbox"
      ).resolve()
      shutil.rmtree(str(dir_), ignore_errors=True)
  
      try:
          # Local installs of gradio and gradio-client
          gradio_dir = Path(__file__).parent / ".."
          client = Path(__file__).parent / ".." / "client" / "python"
          virtualenv.run("pip install build")
          virtualenv.run(f"pip install -e {str(gradio_dir)}")
          virtualenv.run(f"pip install -e {str(client)}")
  
          virtualenv.run(
              f"{shutil.which('gradio')} cc create TestTextbox --template {template} --no-configure-metadata --directory {str(dir_)}",
          )
          assert (dir_ / "frontend" / "node_modules").exists()
  
          # need to reinstall local client because installing the custom component
          # will pull latest stable version from pypi
          virtualenv.run(f"pip install -e {str(client)}")
          virtualenv.run(
              f"{shutil.which('gradio')} cc build {str(dir_)}"
          )
  
          template_dir: Path = (
              dir_ / "backend" / "gradio_testtextbox" / "templates"
          )
          assert template_dir.exists() and template_dir.is_dir()
          assert list(template_dir.glob("**/index.js"))
          assert (dir_ / "dist").exists() and list(
              (dir_ / "dist").glob("*.whl")
          )
      finally:
          shutil.move(str(pnpm_copy), str(pnpm_lock))
          shutil.rmtree(str(dir_), ignore_errors=True)
  
file_path: gradio/test/test_gradio_component_cli.py
imports: import shutil
  import textwrap
  from pathlib import Path
  import pytest
  from gradio.cli.commands.components._create_utils import OVERRIDES
  from gradio.cli.commands.components.create import _create
  from gradio.cli.commands.components.publish import _get_version_from_file
  from gradio.cli.commands.components.show import _show
label_desc: Use image node_id 6 for calling a global function with example usage: test_build(template, virtualenv) without return types