Skip to content

Commit

Permalink
Bump min version of amazon-provider related dependencies (#36660)
Browse files Browse the repository at this point in the history
This is a regular bump of Amazon-provider related dependencies.
The way how botocore releases are done, they are putting a lot of
strain on `pip` to resolve the right set of dependencies, including
long backtracking, when there are too man versions available.

Therefore, from time to time, we are bumping minimum version of
Amazon-related dependencies to limit the impact frequent releases
of boto and botocore has. Also it is generally fine to update min
version of dependencies for providers because at the very least
users can still use previously released providers in case they
have problem with those dependencies, also many of the updated
dependencies contain fixes and feature we implicitly depend on and
bumping them regulary is a good way to make sure all the functionalities
of the Amazon provider are working as expected.

Another reason for the bump is that as of 1.33 version botocore and
boto version stopped being shifted by 3 (previously boto3 1.28 was
the version corresponding to botocore 1.31). As of version 1.33 this
problem has been solved. See boto/boto3#2702

Watchtower min version is bumped to version 3 (which is 12 months old
even if before we opted for much older (more than 2 years old) and again
if users want to use older version of watchtower, they can opt for
previous provider version.

This change saves 5-6 minutes of backtracking when `pip` try to
find the right version of dependencies when upgrading to newer version.

Extracted from #36537
  • Loading branch information
potiuk committed Jan 8, 2024
1 parent 43afb2f commit 298c37d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
18 changes: 5 additions & 13 deletions airflow/providers/amazon/provider.yaml
Expand Up @@ -81,23 +81,15 @@ dependencies:
- apache-airflow-providers-common-sql>=1.3.1
- apache-airflow-providers-http
# We should update minimum version of boto3 and here regularly to avoid `pip` backtracking with the number
# of candidates to consider. We should also make sure that all the below related packages have also the
# same minimum version specified. Boto3 1.28.0 has been released on July 6 2023. We should also make sure we
# set it to the version that `aiobotocore` supports (see `aiobotocore` optional dependency at the end
# of this file). Currently we set aiobotocore as minimum 2.5.3 - as this is was the first version
# that supported boto3 1.28.
# NOTE!!! BEFORE botocore 1.33 BOTOCORE VERSIONS ARE SHIFTED BY 3 MINOR VERSIONS
# NOTE!!! Make sure to update _MIN_BOTO3_VERSION in setup.py when you update it here
- boto3>=1.28.0
# NOTE!!! BEFORE botocore 1.33 version is always shifted by 3 MINOR VERSIONS from boto3, see:
# - https://github.com/boto/boto3/issues/2702
# - https://github.com/boto/boto3/blob/a3e710df58676c2567b8023dbe09025ad5e0e50f/.changes/1.33.0.json#L13-L15
- botocore>=1.31.0
# of candidates to consider. Make sure to configure boto3 version here as well as in all the tools below
# in the `devel-dependencies` section to be the same minimum version.
- boto3>=1.33.0
- botocore>=1.33.0
- inflection>=0.5.1
# Allow a wider range of watchtower versions for flexibility among users
- watchtower>=2.0.1,<4
- jsonpath_ng>=1.5.3
- redshift_connector>=2.0.888
- redshift_connector>=2.0.918
- sqlalchemy_redshift>=0.8.6
- asgiref

Expand Down
6 changes: 3 additions & 3 deletions generated/provider_dependencies.json
Expand Up @@ -27,11 +27,11 @@
"apache-airflow-providers-http",
"apache-airflow>=2.6.0",
"asgiref",
"boto3>=1.28.0",
"botocore>=1.31.0",
"boto3>=1.33.0",
"botocore>=1.33.0",
"inflection>=0.5.1",
"jsonpath_ng>=1.5.3",
"redshift_connector>=2.0.888",
"redshift_connector>=2.0.918",
"sqlalchemy_redshift>=0.8.6",
"watchtower>=2.0.1,<4"
],
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -411,15 +411,15 @@ def write_version(filename: str = str(AIRFLOW_SOURCES_ROOT / "airflow" / "git_ve
]

# make sure to update providers/amazon/provider.yaml botocore min version when you update it here
_MIN_BOTO3_VERSION = "1.28.0"
_MIN_BOTO3_VERSION = "1.33.0"

_devel_only_amazon = [
"aws_xray_sdk",
"moto[cloudformation,glue]>=4.2.9",
"aws_xray_sdk>=2.12.0",
"moto[cloudformation,glue]>=4.2.12",
f"mypy-boto3-appflow>={_MIN_BOTO3_VERSION}",
f"mypy-boto3-rds>={_MIN_BOTO3_VERSION}",
f"mypy-boto3-redshift-data>={_MIN_BOTO3_VERSION}",
f"mypy-boto3-s3>={_MIN_BOTO3_VERSION}",
f"mypy-boto3-appflow>={_MIN_BOTO3_VERSION}",
]

_devel_only_azure = [
Expand Down

0 comments on commit 298c37d

Please sign in to comment.