Skip to content

Commit 5f504e9

Browse files
authored
Upgrade botocore/aiobotocore minimum requirements (#33649)
Botocore has a very peculiar process of releasing new version every day, which means that it gives `pip` hard time to figure what will be the non-conflicting set of packages when we have too low of a minium version set as requirement. Since we had > 1.24 that means that `pip` had to consider more than 340 versions for botocore, but also for related mypy packages and also a number of aiobotocore packages when resolving eager-upgrade. We limit all the relevant packages to 1.28 as minimum version now, and we should continue doing that regularly in the future.
1 parent 5544c8b commit 5f504e9

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

Dockerfile.ci

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,11 +1393,10 @@ ENV AIRFLOW_REPO=${AIRFLOW_REPO}\
13931393
RUN echo "Airflow version: ${AIRFLOW_VERSION}"
13941394

13951395
# Those are additional constraints that are needed for some extras but we do not want to
1396-
# force them on the main Airflow package.
1397-
# Recent aiobotocore (2.6.0+) requires this specific botocore version, while
1398-
# boto3 1.28.17 is the last version supporting that, so we pin them to help pip
1399-
# avoid extra work. Revisit this when a new aiobotocore version is released.
1400-
ARG EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS="botocore==1.31.17 boto3<=1.28.17"
1396+
# force them on the main Airflow package. Currently we need no extra limits as PIP 23.1+ has much better
1397+
# dependency resolution and we do not need to limit the versions of the dependencies
1398+
# aiobotocore is limited temporarily until it stops backtracking pip
1399+
ARG EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS=""
14011400
ARG UPGRADE_TO_NEWER_DEPENDENCIES="false"
14021401
ARG VERSION_SUFFIX_FOR_PYPI=""
14031402

airflow/providers/amazon/provider.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,19 @@ dependencies:
6767
- apache-airflow>=2.4.0
6868
- apache-airflow-providers-common-sql>=1.3.1
6969
- apache-airflow-providers-http
70-
- boto3>=1.24.0
70+
# We should update minimum version of boto3 and here regularly to avoid `pip` backtracking with the number
71+
# of candidates to consider. We should also make sure that all the below related packages have also the
72+
# same minimum version specified. Boto3 1.28.0 has been released on July 6 2023. We should also make sure we
73+
# set it to the version that `aiobotocore` supports (see `aiobotocore` optional dependency at the end
74+
# of this file). Currently we set aiobotocore as minimum 2.5.3 - as this is was the first version
75+
# that supported boto3 1.28. NOTE!!! BOTOCORE VERSIONS ARE SHIFTED BY 3 MINOR VERSIONS
76+
- boto3>=1.28.0
77+
- mypy-boto3-rds>=1.28.0
78+
- mypy-boto3-redshift-data>=1.28.0
79+
- mypy-boto3-s3>=1.28.0
80+
- mypy-boto3-appflow>=1.28.0
81+
# NOTE!!! BOTOCORE VERSIONS ARE SHIFTED BY 3 MINOR VERSIONS
82+
- botocore>=1.31.0
7183
- asgiref
7284
# watchtower 3 has been released end Jan and introduced breaking change across the board that might
7385
# change logging behaviour:
@@ -77,11 +89,7 @@ dependencies:
7789
- jsonpath_ng>=1.5.3
7890
- redshift_connector>=2.0.888
7991
- sqlalchemy_redshift>=0.8.6
80-
- mypy-boto3-rds>=1.24.0
81-
- mypy-boto3-redshift-data>=1.24.0
82-
- mypy-boto3-appflow>=1.28.16
8392
- asgiref
84-
- mypy-boto3-s3>=1.24.0
8593

8694
integrations:
8795
- integration-name: Amazon Athena
@@ -699,7 +707,7 @@ additional-extras:
699707
# boto3 have native async support and we move away from aio aiobotocore
700708
- name: aiobotocore
701709
dependencies:
702-
- aiobotocore[boto3]>=2.2.0
710+
- aiobotocore[boto3]>=2.5.3
703711
- name: cncf.kubernetes
704712
dependencies:
705713
- apache-airflow-providers-cncf-kubernetes>=7.2.0

generated/provider_dependencies.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
"apache-airflow>=2.4.0",
2727
"asgiref",
2828
"asgiref",
29-
"boto3>=1.24.0",
29+
"boto3>=1.28.0",
30+
"botocore>=1.31.0",
3031
"jsonpath_ng>=1.5.3",
31-
"mypy-boto3-appflow>=1.28.16",
32-
"mypy-boto3-rds>=1.24.0",
33-
"mypy-boto3-redshift-data>=1.24.0",
34-
"mypy-boto3-s3>=1.24.0",
32+
"mypy-boto3-appflow>=1.28.0",
33+
"mypy-boto3-rds>=1.28.0",
34+
"mypy-boto3-redshift-data>=1.28.0",
35+
"mypy-boto3-s3>=1.28.0",
3536
"redshift_connector>=2.0.888",
3637
"sqlalchemy_redshift>=0.8.6",
3738
"watchtower~=2.0.1"

scripts/in_container/_in_container_utils.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ function install_all_providers_from_pypi_with_eager_upgrade() {
297297
local res
298298
for provider_package in ${ALL_PROVIDERS_PACKAGES}
299299
do
300+
# Until we release "yandex" provider with protobuf support we need to remove it from the list of providers
301+
# to install, because it is impossible to find common requirements for already released yandex provider
302+
# and current airflow
303+
if [[ ${provider_package} == "apache-airflow-providers-yandex" ]]; then
304+
continue
305+
fi
300306
echo -n "Checking if ${provider_package} is available in PyPI: "
301307
res=$(curl --head -s -o /dev/null -w "%{http_code}" "https://pypi.org/project/${provider_package}/")
302308
if [[ ${res} == "200" ]]; then
@@ -306,7 +312,11 @@ function install_all_providers_from_pypi_with_eager_upgrade() {
306312
echo "${COLOR_YELLOW}Skipped${COLOR_RESET}"
307313
fi
308314
done
315+
316+
309317
echo "Installing provider packages: ${packages_to_install[*]}"
318+
319+
310320
# we add eager requirements to make sure to take into account limitations that will allow us to
311321
# install all providers. We install only those packages that are available in PyPI - we might
312322
# Have some new providers in the works and they might not yet be simply available in PyPI

0 commit comments

Comments
 (0)