code: def generate_constraints_pypi_providers(
      config_params: ConfigParams,
  ) -> None:
      """
      Generates constraints with provider installed from PyPI. This is the default constraints file
      used in production/release builds when we install providers from PyPI and when tagged, those
      providers are used by our users to install Airflow in reproducible way.
      :return:
      """
      dist_dir = Path("/dist")
      all_provider_packages = get_all_active_provider_packages()
      chicken_egg_prefixes = []
      packages_to_install = []
      console.print(
          "[bright_blue]Installing Airflow with PyPI providers with eager upgrade"
      )
      if config_params.chicken_egg_providers:
          for (
              chicken_egg_provider
          ) in config_params.chicken_egg_providers.split(" "):
              chicken_egg_prefixes.append(
                  f"apache-airflow-providers-{chicken_egg_provider.replace('.','-')}"
              )
          console.print(
              f"[bright_blue]Checking if {chicken_egg_prefixes} are available in local dist folder "
              f"as chicken egg providers)"
          )
      for provider_package in all_provider_packages:
          if (
              config_params.chicken_egg_providers
              and provider_package.startswith(
                  tuple(chicken_egg_prefixes)
              )
          ):
              glob_pattern = (
                  f"{provider_package.replace('-','_')}-*.whl"
              )
              console.print(
                  f"[bright_blue]Checking if {provider_package} is available in local dist folder "
                  f"with {glob_pattern} pattern"
              )
              files = dist_dir.glob(glob_pattern)
              for file in files:
                  console.print(
                      f"[yellow]Installing {file.name} from local dist folder as it is "
                      f"a chicken egg provider"
                  )
                  packages_to_install.append(file.as_posix())
              else:
                  console.print(
                      f"[yellow]Skipping {provider_package} as it is not found in dist folder to install."
                  )
                  continue
          console.print(
              f"[bright_blue]Checking if {provider_package} is available in PyPI: ... ",
              end="",
          )
          r = requests.head(
              f"https://pypi.org/pypi/{provider_package}/json",
              timeout=60,
          )
          if r.status_code == 200:
              console.print("[green]OK")
              packages_to_install.append(provider_package)
          else:
              console.print("[yellow]NOK. Skipping.")
      run_command(
          cmd=[
              "pip",
              "install",
              "--root-user-action",
              "ignore",
              ".[all-core]",
              *packages_to_install,
              *config_params.eager_upgrade_additional_requirements.split(
                  " "
              ),
              "--upgrade",
              "--upgrade-strategy",
              "eager",
          ],
          github_actions=config_params.github_actions,
          check=True,
      )
      console.print(
          "[success]Installed airflow with PyPI providers with eager upgrade."
      )
      with config_params.current_constraints_file.open(
          "w"
      ) as constraints_file:
          constraints_file.write(PYPI_PROVIDERS_CONSTRAINTS_PREFIX)
          freeze_packages_to_file(config_params, constraints_file)
      download_latest_constraint_file(config_params)
      diff_constraints(config_params)
  
imports: from __future__ import annotations
  import json
  import os
  import sys
  from dataclasses import dataclass
  from datetime import datetime
  from functools import cached_property
  from pathlib import Path
  from typing import TextIO
  import requests
  from click import Choice
  from in_container_utils import click, console, run_command
label_desc: Use image node_id 8 for calling a global function with example usage: generate_constraints_pypi_providers(config_params) without return types