def get_bentoml_requirement() -> str | None:
    """Returns the requirement string for BentoML."""
    dist = importlib.metadata.distribution("bentoml")
    direct_url_file = next(
        (f for f in (dist.files or []) if str(f).endswith("direct_url.json")), None
    )
    if direct_url_file is None:
        return f"bentoml=={BENTOML_VERSION}"
    direct_url_data = json.loads(direct_url_file.read_text())
    if direct_url_data.get("dir_info", {}).get("editable", False):
        return None
    if vcs_info := direct_url_data.get("vcs_info", None):
        # NOTE: uv 0.5.22 installs direct_url.json without commit_id key
        # This is a workaround to handle this case and should be removed in future
        commit_id = vcs_info.get("commit_id") or vcs_info.get("requested_revision")
        res = f"bentoml @ {vcs_info['vcs']}+{direct_url_data['url']}@{commit_id}"
    else:
        res = f"bentoml @ {direct_url_data['url']}"
    if subdirectory := direct_url_data.get("subdirectory", None):
        res += f"#subdirectory={subdirectory}"
    return res
Returns the requirement string for BentoML.
src/bentoml/_internal/configuration/__init__.py