code: def build_editable(
      wheel_directory: str,
      config_settings: Optional[Dict[str, Any]] = None,
      metadata_directory: Optional[str] = None,
  ) -> str:
      """Build an editable installation. We mostly delegate to Hatchling."""
      logger = logging.getLogger("xgboost.packager.build_editable")
  
      if config_settings:
          raise NotImplementedError(
              "XGBoost's custom build backend doesn't support config_settings option "
              f"when building editable installation. {config_settings=}"
          )
  
      if locate_local_libxgboost(TOPLEVEL_DIR, logger=logger) is None:
          raise RuntimeError(
              "To use the editable installation, first build libxgboost with CMake. "
              "See https://xgboost.readthedocs.io/en/latest/build.html for detailed instructions."
          )
  
      return hatchling.build.build_editable(
          wheel_directory, config_settings, metadata_directory
      )
  
file_path: xgboost/python-package/packager/pep517.py
imports: import dataclasses
  import logging
  import os
  import pathlib
  import tempfile
  from contextlib import contextmanager
  from typing import Any, Dict, Iterator, Optional, Union
  import hatchling.build
  from .build_config import BuildConfiguration
  from .nativelib import locate_local_libxgboost, locate_or_build_libxgboost
  from .sdist import copy_cpp_src_tree
  from .util import copy_with_logging, copytree_with_logging
label_desc: Use image node_id 4 for calling a global function with example usage: build_editable(wheel_directory, config_settings, metadata_directory) and returns: hatchling