### Body

Same as https://github.com/apache/airflow/issues/33876 but for `publish-docs` command.

### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.
metadata_dict: dict[str, dict[str, dict[str, str]]] = {}
    if python is None:
        python = DEFAULT_PYTHON_MAJOR_MINOR_VERSION
    get_all_constraint_files(refresh_constraints=refresh_constraints, python_version=python)
    constraints = load_constraints(python_version=python)
    for package_id in DEPENDENCIES.keys():
        with ci_group(f"Generating metadata for {package_id}"):
            metadata = generate_providers_metadata_for_package(package_id, constraints)
            if metadata:
                metadata_dict[package_id] = metadata
    import json
    PROVIDER_METADATA_JSON_FILE_PATH.write_text(json.dumps(metadata_dict, indent=4, sort_keys=True))
def fetch_remote(constraints_repo: Path, remote_name: str) -> None: