Skip to content

Commit 7ddbb27

Browse files
potiukCloud Composer Team
authored andcommitted
Bring back min-airflow-version for preinstalled providers (#31469)
In the last wave of providers #31416 we bumped min-airlfow-version to 2.4 and added mechanism to verify min-airflow version is ok while importing, but it turned out that there are cases where installing just old version of airflow (with no constraints) brings the latest version of those providers and causes new installation of airflow to fail. This is far too common to ignore or require to use constraints, unfortunately  We do not have min-airlfow-version in the preinstalled providers for one reason only. For some tools that are NOT conforming to standards (such as bazel), having min-airflow-version for those providers causes circular dependency (even though technically dependencies in PyPI can - and often are - circular, because dependencies in Python are not DAG and can contain cycles. This was in response to this issue in 2021 #17795. However, this is really bazel issue, and on top of it - it's recognized as such and being fixed very recently in bazel-contrib/rules_python#1188 because there are other packages that have similar problems (pytorch and triton being popular couple). Also Bazel is not that popular in the Python world.  Therefore, rather than trying to workaround the problem of bazel, we encourage them to merge and release the fix bazel-contrib/rules_python#1166 (comment) and call it out in our installation instructions, that bazel installation might lead to problems like that. If bazel does not fix it, this will only be a problem for Future installations of airflow in a few months most likely. It will not impact current bazel users installing old versions of Airflow (actually they might start having problems now if we do not fix it and yank the 5 providers released yesterday) GitOrigin-RevId: 547e352578fac92f072b269dc257d21cdc279d97
1 parent 625ef35 commit 7ddbb27

16 files changed

Lines changed: 88 additions & 35 deletions

File tree

CONTRIBUTING.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,11 @@ Airflow dependencies
593593
``pip`` - especially when it comes to constraint vs. requirements management.
594594
Installing via ``Poetry`` or ``pip-tools`` is not currently supported.
595595

596+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
597+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
598+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
599+
newer versions of ``bazel`` will handle it.
600+
596601
If you wish to install airflow using those tools you should use the constraint files and convert
597602
them to appropriate format and workflow that your tool requires.
598603

@@ -796,6 +801,11 @@ Pinned constraint files
796801
``pip`` - especially when it comes to constraint vs. requirements management.
797802
Installing via ``Poetry`` or ``pip-tools`` is not currently supported.
798803

804+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
805+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
806+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
807+
newer versions of ``bazel`` will handle it.
808+
799809
If you wish to install airflow using those tools you should use the constraint files and convert
800810
them to appropriate format and workflow that your tool requires.
801811

IMAGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ This will build the image using command similar to:
147147
``pip`` - especially when it comes to constraint vs. requirements management.
148148
Installing via ``Poetry`` or ``pip-tools`` is not currently supported.
149149

150+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
151+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
152+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
153+
newer versions of ``bazel`` will handle it.
154+
150155
If you wish to install airflow using those tools you should use the constraint files and convert
151156
them to appropriate format and workflow that your tool requires.
152157

LOCAL_VIRTUALENV.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ Extra Packages
7070
``pip`` - especially when it comes to constraint vs. requirements management.
7171
Installing via ``Poetry`` or ``pip-tools`` is not currently supported.
7272

73+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
74+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
75+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
76+
n ewer versions of ``bazel`` will handle it.
77+
7378
If you wish to install airflow using those tools you should use the constraint files and convert
7479
them to appropriate format and workflow that your tool requires.
7580

@@ -136,6 +141,11 @@ To create and initialize the local virtualenv:
136141
``pip`` - especially when it comes to constraint vs. requirements management.
137142
Installing via ``Poetry`` or ``pip-tools`` is not currently supported.
138143

144+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
145+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
146+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
147+
newer versions of ``bazel`` will handle it.
148+
139149
If you wish to install airflow using those tools you should use the constraint files and convert
140150
them to appropriate format and workflow that your tool requires.
141151

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ While it is possible to install Airflow with tools like [Poetry](https://python-
153153
`pip` - especially when it comes to constraint vs. requirements management.
154154
Installing via `Poetry` or `pip-tools` is not currently supported.
155155

156+
There are known issues with ``bazel`` that might lead to circular dependencies when using it to install
157+
Airflow. Please switch to ``pip`` if you encounter such problems. ``Bazel`` community works on fixing
158+
the problem in `this PR <https://github.com/bazelbuild/rules_python/pull/1166>`_ so it might be that
159+
newer versions of ``bazel`` will handle it.
160+
156161
If you wish to install Airflow using those tools, you should use the constraint files and convert
157162
them to the appropriate format and workflow that your tool requires.
158163

airflow/providers/common/sql/provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ versions:
3535
- 1.0.0
3636

3737
dependencies:
38+
- apache-airflow>=2.4.0
3839
- sqlparse>=0.4.2
3940

4041
additional-extras:

airflow/providers/ftp/provider.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ versions:
3838
- 1.0.1
3939
- 1.0.0
4040

41-
dependencies: []
41+
dependencies:
42+
- apache-airflow>=2.4.0
4243

4344
integrations:
4445
- integration-name: File Transfer Protocol (FTP)

airflow/providers/http/provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ versions:
4242
- 1.0.0
4343

4444
dependencies:
45+
- apache-airflow>=2.4.0
4546
# The 2.26.0 release of requests got rid of the chardet LGPL mandatory dependency, allowing us to
4647
# release it as a requirement for airflow
4748
- requests>=2.26.0

airflow/providers/imap/provider.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ versions:
3838
- 1.0.1
3939
- 1.0.0
4040

41-
dependencies: []
41+
dependencies:
42+
- apache-airflow>=2.4.0
4243

4344
integrations:
4445
- integration-name: Internet Message Access Protocol (IMAP)

airflow/providers/sqlite/provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ versions:
4242
- 1.0.0
4343

4444
dependencies:
45+
- apache-airflow>=2.4.0
4546
- apache-airflow-providers-common-sql>=1.3.1
4647

4748
integrations:

dev/provider_packages/PROVIDER_INDEX_TEMPLATE.rst.jinja2

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,6 @@ Requirements
5656

5757
The minimum Apache Airflow version supported by this provider package is ``{{ MIN_AIRFLOW_VERSION }}``.
5858

59-
{%- if PREINSTALLED_PROVIDER %}
60-
61-
This provider package is preinstalled by default when Apache Airflow is installed. You do not need to
62-
install it separately. You can upgrade and downgrade it independently of Apache Airflow package though.
63-
64-
.. note::
65-
66-
The minimum Apache Airflow version for this package is {{ MIN_AIRFLOW_VERSION }} and it will fail
67-
import at runtime if the version of Airflow is lower even if there is no requirement specified in
68-
the dependencies - this is because the provider is preinstalled and specifying minimum Apache
69-
Airflow version would create a dependency cycle, which confuses dependency tools.
70-
71-
{%- endif %}
72-
7359
{%- if PIP_REQUIREMENTS %}
7460

7561
{{ PIP_REQUIREMENTS_TABLE_RST | safe}}

0 commit comments

Comments
 (0)