Skip to content

Commit ae14b02

Browse files
committed
Fix dependencies for celery and opentelemetry for Python 3.8
We used to have problems with `pip` backtracking when we relaxed too much open-telemetry dependencies. It turned out that the backtracting was only happening on Python 3.8 and that it was ultimately caused by conflict between importlib_metadata between Airflow and newer versions of opentelemetry (we had <5 for Python 3.8, they had >6 for all versions. The reason for limiting it in Airflow was Celery that was not working well with importlib 5. Since Celery 5.3 solved the problems (released 6th of June) we can now relax the importlib_metadata limit and set Celery to version >= 5.3.0) which nicely resolves the conflict and there is no more backtracking when trying to install newer versions of opentelemetry for Python 3.8. Fixes: #33577
1 parent 86423b4 commit ae14b02

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

airflow/providers/celery/provider.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dependencies:
4545
# Uses Celery for CeleryExecutor, and we also know that Kubernetes Python client follows SemVer
4646
# (https://docs.celeryq.dev/en/stable/contributing.html?highlight=semver#versions).
4747
# Make sure that the limit here is synchronized with [celery] extra in the airflow core
48-
- celery>=5.2.3,<6
48+
- celery>=5.3.0,<6
4949
- flower>=1.0.0
5050
- google-re2>=1.0
5151

dev/breeze/src/airflow_breeze/utils/path_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_package_setup_metadata_hash() -> str:
8787
try:
8888
from importlib.metadata import distribution # type: ignore[attr-defined]
8989
except ImportError:
90-
from importlib_metadata import distribution # type: ignore[no-redef]
90+
from importlib_metadata import distribution # type: ignore[no-redef, assignment]
9191

9292
prefix = "Package config hash: "
9393

generated/provider_dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
"celery": {
246246
"deps": [
247247
"apache-airflow>=2.4.0",
248-
"celery>=5.2.3,<6",
248+
"celery>=5.3.0,<6",
249249
"flower>=1.0.0",
250250
"google-re2>=1.0"
251251
],

setup.cfg

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ install_requires =
102102
graphviz>=0.12
103103
gunicorn>=20.1.0
104104
httpx
105-
# Importlib-metadata 5 is breaking Celery import due to regression it introduced
106-
# This was tracked and fixed in https://github.com/celery/celery/pull/7785 but it is not released yet
107-
# We can remove the < 5.0.0 limitation when Celery 5.3.0 gets released and we bump celery to >= 5.3.0
108-
importlib_metadata>=1.7,<5.0.0;python_version<"3.9"
105+
importlib_metadata>=1.7;python_version<"3.9"
109106
importlib_resources>=5.2;python_version<"3.9"
110107
itsdangerous>=2.0
111108
jinja2>=3.0.0
@@ -118,8 +115,7 @@ install_requires =
118115
markupsafe>=1.1.1
119116
marshmallow-oneofschema>=2.0.1
120117
mdit-py-plugins>=0.3.0
121-
# Pip can not find a version that satisfies constraints if opentelemetry-api is not pinned.
122-
opentelemetry-api==1.15.0
118+
opentelemetry-api>=1.15.0
123119
opentelemetry-exporter-otlp
124120
packaging>=14.0
125121
pathspec>=0.9.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def write_version(filename: str = str(AIRFLOW_SOURCES_ROOT / "airflow" / "git_ve
281281
# limiting minimum airflow version supported in celery provider due to the
282282
# potential breaking changes in Airflow Core as well (celery is added as extra, so Airflow
283283
# core is not hard-limited via install-requires, only by extra).
284-
"celery>=5.2.3,<6"
284+
"celery>=5.3.0,<6"
285285
]
286286
cgroups = [
287287
# Cgroupspy 0.2.2 added Python 3.10 compatibility

0 commit comments

Comments
 (0)