We have a number of "in_container" scripts written in Bash, They are doing a number of houseekeeping stuff but since we already have Python 3.7+ inside the CI image, we could modularise them more and make them run from external and simplify entrypoint_ci (for example separate script for tests).
packages = [f.as_posix() for f in DIST_FOLDER.glob(f"apache_airflow-[0-9]*.{extension}")]
    if len(packages) > 1:
        console.print(f"\n[red]Found multiple airflow packages: {packages}\n")
        sys.exit(1)
    elif len(packages) == 0:
        console.print("\n[red]No airflow package found\n")
        sys.exit(1)
    airflow_package = packages[0] if packages else None
    if airflow_package:
        console.print(f"\n[bright_blue]Found airflow package: {airflow_package}\n")
    else:
        console.print("\n[yellow]No airflow package found.\n")
    return airflow_package
def find_provider_packages(extension: str, selected_providers: list[str]) -> list[str]:
    candidates = list(DIST_FOLDER.glob(f"apache_airflow_providers_*.{extension}"))
    console.print("\n[bright_blue]Found the following provider packages: ")
    for candidate in sorted(candidates):
        console.print(f"  {candidate.as_posix()}")
    console.print()
    if selected_providers:
        candidates = [
            candidate for candidate in candidates if get_provider_name(candidate.name) in selected_providers
        ]
        console.print("[bright_blue]Selected provider packages:")
        for candidate in sorted(candidates):
            console.print(f"  {candidate.as_posix()}")
        console.print()
    return [candidate.as_posix() for candidate in candidates]
def calculate_constraints_location(