Skip to content

Commit

Permalink
Fix parsing of development dependencies for airflow version (apache#4…
Browse files Browse the repository at this point in the history
…3995)

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.
  • Loading branch information
potiuk authored Nov 14, 2024
1 parent a7137d7 commit edcb48a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/in_container/install_devel_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
Expand Down

0 comments on commit edcb48a

Please sign in to comment.