From edcb48a5f91141daedf7dea04c1e39e9163acd9b Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 14 Nov 2024 01:33:50 +0100 Subject: [PATCH] Fix parsing of development dependencies for airflow version (#43995) The script to install development dependencies asumed development dependencies are always `>=` this might not be true in case we limit the depdencies to be < or provide other requirements for them. This PR fixes it by using "packaging.requirements.Requirement" to parse the specifier, which should handle all cases nicely. --- scripts/in_container/install_devel_deps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/in_container/install_devel_deps.py b/scripts/in_container/install_devel_deps.py index 971e11725dd8d..621863d03f64e 100755 --- a/scripts/in_container/install_devel_deps.py +++ b/scripts/in_container/install_devel_deps.py @@ -22,6 +22,7 @@ from pathlib import Path from in_container_utils import click, run_command +from packaging.requirements import Requirement AIRFLOW_SOURCES_DIR = Path(__file__).resolve().parents[2] @@ -46,7 +47,7 @@ def get_devel_deps_from_providers(): devel_deps_from_providers = [] deps = json.loads((AIRFLOW_SOURCES_DIR / "generated" / "provider_dependencies.json").read_text()) for dep in deps: - devel_deps = [short_dep.split(">=")[0] for short_dep in deps[dep]["devel-deps"]] + devel_deps = [Requirement(short_dep).name for short_dep in deps[dep]["devel-deps"]] if devel_deps: devel_deps_from_providers.extend(devel_deps) return devel_deps_from_providers