code: def build_package(cfg: Config, pkg_path: str, build_dir: str) -> None:
      try:
          prev = os.getcwd()
          os.chdir(pkg_path)
          log.info(f"Building {get_package_info('.').name}")
          shutil.rmtree("dist", ignore_errors=True)
          cmd = ["-m", "build", "-o", build_dir, *cfg.build_targets]
          run_python_script(
              cmd=cmd,
              allow_warnings=False,
          )
      finally:
          os.chdir(prev)
  
imports: import logging
  import os
  import re
  import shutil
  from dataclasses import dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import Dict, List, Tuple
  import hydra
  import requests
  from hydra.core.config_store import ConfigStore
  from hydra.test_utils.test_utils import find_parent_dir_containing, run_python_script
  from omegaconf import II, MISSING, SI, DictConfig, OmegaConf
  from packaging.version import Version, parse
label_desc: Use image node_id 5 for calling a global function with example usage: build_package(cfg, pkg_path, build_dir) without return types