Skip to content

Commit ccae1b1

Browse files
committed
Move some non-core dependencies to the apache-airflow meta package
Some of the extras in `airflow-core` do not really belong there, they should be moved to the `apache-airflow` meta-package.
1 parent 0cba6fc commit ccae1b1

File tree

3 files changed

+59
-83
lines changed

3 files changed

+59
-83
lines changed

airflow-core/pyproject.toml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -145,35 +145,11 @@ dependencies = [
145145

146146

147147
[project.optional-dependencies]
148-
# Aiobotocore required for AWS deferrable operators.
149-
# There is conflict between boto3 and aiobotocore dependency botocore.
150-
# TODO: We can remove it once boto3 and aiobotocore both have compatible botocore version or
151-
# boto3 have native aync support and we move away from aio aiobotocore
152-
"aiobotocore" = [
153-
"apache-airflow-providers-amazon[aiobotocore]>=9.6.0",
154-
]
155148
"async" = [
156149
"eventlet>=0.37.0",
157150
"gevent>=24.2.1",
158151
"greenlet>=0.4.9",
159152
]
160-
"apache-atlas" = [
161-
"atlasclient>=0.1.2",
162-
]
163-
"apache-webhdfs" = [
164-
"apache-airflow-providers-apache-hdfs",
165-
]
166-
"cloudpickle" = [
167-
"cloudpickle>=2.2.1",
168-
]
169-
"github-enterprise" = [
170-
"apache-airflow-providers-fab",
171-
"authlib>=1.0.0",
172-
]
173-
"google-auth" = [
174-
"apache-airflow-providers-fab",
175-
"authlib>=1.0.0",
176-
]
177153
"graphviz" = [
178154
# The graphviz package creates friction when installing on MacOS as it needs graphviz system package to
179155
# be installed, and it's really only used for very obscure features of Airflow, so we can skip it on MacOS
@@ -185,27 +161,9 @@ dependencies = [
185161
"requests-kerberos>=0.14.0",
186162
"thrift-sasl>=0.4.2",
187163
]
188-
"ldap" = [
189-
"python-ldap>=3.4.4",
190-
]
191164
"otel" = [
192165
"opentelemetry-exporter-prometheus>=0.47b0",
193166
]
194-
195-
"pandas" = [
196-
# In pandas 2.2 minimal version of the sqlalchemy is 2.0
197-
# https://pandas.pydata.org/docs/whatsnew/v2.2.0.html#increased-minimum-versions-for-dependencies
198-
# However Airflow not fully supports it yet: https://github.com/apache/airflow/issues/28723
199-
"pandas>=2.1.2,<2.3",
200-
]
201-
"rabbitmq" = [
202-
"amqp>=5.2.0",
203-
]
204-
"s3fs" = [
205-
# This is required for support of S3 file system which uses aiobotocore
206-
# which can have a conflict with boto3 as mentioned in aiobotocore extra
207-
"apache-airflow-providers-amazon[s3fs]",
208-
]
209167
"sentry" = [
210168
"blinker>=1.1",
211169
# Sentry SDK 1.33 is broken when greenlets are installed and fails to import
@@ -215,11 +173,8 @@ dependencies = [
215173
"statsd" = [
216174
"statsd>=3.3.0",
217175
]
218-
"uv" = [
219-
"uv>=0.6.17",
220-
]
221176
"all" = [
222-
"apache-airflow-core[aiobotocore,apache-atlas,apache-webhdfs,cloudpickle,github-enterprise,google-auth,graphviz,kerberos,ldap,otel,pandas,rabbitmq,s3fs,sentry,statsd,uv]"
177+
"apache-airflow-core[graphviz,kerberos,otel,sentry,statsd]"
223178
]
224179

225180
[project.scripts]

pyproject.toml

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,60 +70,27 @@ packages = []
7070

7171
[project.optional-dependencies]
7272
# Automatically generated airflow optional dependencies
73-
"aiobotocore" = [
74-
"apache-airflow-core[aiobotocore]"
75-
]
7673
"all-core" = [
7774
"apache-airflow-core[all]"
7875
]
79-
"apache-atlas" = [
80-
"apache-airflow-core[apache-atlas]"
81-
]
82-
"apache-webhdfs" = [
83-
"apache-airflow-core[apache-webhdfs]"
84-
]
8576
"async" = [
8677
"apache-airflow-core[async]"
8778
]
88-
"cloudpickle" = [
89-
"apache-airflow-core[cloudpickle]"
90-
]
91-
"github-enterprise" = [
92-
"apache-airflow-core[github-enterprise]"
93-
]
94-
"google-auth" = [
95-
"apache-airflow-core[google-auth]"
96-
]
9779
"graphviz" = [
9880
"apache-airflow-core[graphviz]"
9981
]
10082
"kerberos" = [
10183
"apache-airflow-core[kerberos]"
10284
]
103-
"ldap" = [
104-
"apache-airflow-core[ldap]"
105-
]
10685
"otel" = [
10786
"apache-airflow-core[otel]"
10887
]
109-
"pandas" = [
110-
"apache-airflow-core[pandas]"
111-
]
112-
"rabbitmq" = [
113-
"apache-airflow-core[rabbitmq]"
114-
]
115-
"s3fs" = [
116-
"apache-airflow-core[s3fs]"
117-
]
11888
"sentry" = [
11989
"apache-airflow-core[sentry]"
12090
]
12191
"statsd" = [
12292
"apache-airflow-core[statsd]"
12393
]
124-
"uv" = [
125-
"apache-airflow-core[uv]"
126-
]
12794
"airbyte" = [
12895
"apache-airflow-providers-airbyte>=5.0.0"
12996
]
@@ -413,6 +380,7 @@ packages = []
413380
"apache-airflow-providers-zendesk>=4.9.0"
414381
]
415382
"all" = [
383+
"apache-airflow[aiobotocore,apache-atlas,apache-webhdfs,async,cloudpickle,github-enterprise,google-auth,graphviz,kerberos,ldap,otel,pandas,rabbitmq,s3fs,sentry,statsd,uv]",
416384
"apache-airflow-core[all]",
417385
"apache-airflow-providers-airbyte>=5.0.0",
418386
"apache-airflow-providers-alibaba>=3.0.0",
@@ -512,6 +480,51 @@ packages = []
512480
"apache-airflow-providers-zendesk>=4.9.0",
513481
]
514482
# End of automatically generated airflow optional dependencies
483+
# Aiobotocore required for AWS deferrable operators.
484+
# There is conflict between boto3 and aiobotocore dependency botocore.
485+
# TODO: We can remove it once boto3 and aiobotocore both have compatible botocore version or
486+
# boto3 have native aync support and we move away from aio aiobotocore
487+
"aiobotocore" = [
488+
"apache-airflow-providers-amazon[aiobotocore]>=9.6.0",
489+
]
490+
"apache-atlas" = [
491+
"atlasclient>=0.1.2",
492+
]
493+
"apache-webhdfs" = [
494+
"apache-airflow-providers-apache-hdfs",
495+
]
496+
"cloudpickle" = [
497+
"cloudpickle>=2.2.1",
498+
]
499+
"github-enterprise" = [
500+
"apache-airflow-providers-fab",
501+
"authlib>=1.0.0",
502+
]
503+
"google-auth" = [
504+
"apache-airflow-providers-fab",
505+
"authlib>=1.0.0",
506+
]
507+
"ldap" = [
508+
"python-ldap>=3.4.4",
509+
]
510+
"pandas" = [
511+
# In pandas 2.2 minimal version of the sqlalchemy is 2.0
512+
# https://pandas.pydata.org/docs/whatsnew/v2.2.0.html#increased-minimum-versions-for-dependencies
513+
# However Airflow not fully supports it yet: https://github.com/apache/airflow/issues/28723
514+
"pandas>=2.1.2,<2.3",
515+
]
516+
"rabbitmq" = [
517+
"amqp>=5.2.0",
518+
]
519+
"s3fs" = [
520+
# This is required for support of S3 file system which uses aiobotocore
521+
# which can have a conflict with boto3 as mentioned in aiobotocore extra
522+
"apache-airflow-providers-amazon[s3fs]",
523+
]
524+
"uv" = [
525+
"uv>=0.6.17",
526+
]
527+
515528

516529
[project.urls]
517530
"Bug Tracker" = "https://github.com/apache/airflow/issues"

scripts/ci/pre_commit/update_airflow_pyproject_toml.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
}
6464

6565

66-
def get_optional_dependencies_from_airflow_core() -> list[str]:
66+
def get_optional_dependencies(pyproject_toml_path: Path) -> list[str]:
6767
try:
6868
import tomllib
6969
except ImportError:
7070
import tomli as tomllib
71-
airflow_core_toml_dict = tomllib.loads(AIRFLOW_CORE_PYPROJECT_TOML_FILE.read_text())
71+
airflow_core_toml_dict = tomllib.loads(pyproject_toml_path.read_text())
7272
return airflow_core_toml_dict["project"]["optional-dependencies"].keys()
7373

7474

@@ -131,7 +131,7 @@ def find_min_provider_version(provider_id: str) -> Version | None:
131131

132132
if __name__ == "__main__":
133133
all_optional_dependencies = []
134-
optional_airflow_core_dependencies = get_optional_dependencies_from_airflow_core()
134+
optional_airflow_core_dependencies = get_optional_dependencies(AIRFLOW_CORE_PYPROJECT_TOML_FILE)
135135
for optional in sorted(optional_airflow_core_dependencies):
136136
if optional == "all":
137137
all_optional_dependencies.append('"all-core" = [\n "apache-airflow-core[all]"\n]\n')
@@ -150,7 +150,15 @@ def find_min_provider_version(provider_id: str) -> Version | None:
150150
else:
151151
all_optional_dependencies.append(f'"{provider_id}" = [\n "{distribution_name}"\n]\n')
152152
all_provider_lines.append(f' "{distribution_name}",\n')
153-
all_optional_dependencies.append('"all" = [\n "apache-airflow-core[all]",\n')
153+
all_optional_dependencies.append('"all" = [\n')
154+
optional_apache_airflow_dependencies = get_optional_dependencies(AIRFLOW_PYPROJECT_TOML_FILE)
155+
all_local_extras = [
156+
extra
157+
for extra in sorted(optional_apache_airflow_dependencies)
158+
if extra not in all_providers and not extra.startswith("all")
159+
]
160+
all_optional_dependencies.append(f' "apache-airflow[{",".join(all_local_extras)}]",\n')
161+
all_optional_dependencies.append(' "apache-airflow-core[all]",\n')
154162
all_optional_dependencies.extend(all_provider_lines)
155163
all_optional_dependencies.append("]\n")
156164
insert_documentation(

0 commit comments

Comments
 (0)