This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v2-11-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v2-11-test by this push:
new 1e069e6925e Drop support for Python 3.8 in more files (#50015)
1e069e6925e is described below
commit 1e069e6925e761f3e8f066e6471a9a43b35fbbb7
Author: Kaxil Naik <[email protected]>
AuthorDate: Wed Apr 30 17:19:26 2025 +0530
Drop support for Python 3.8 in more files (#50015)
Few were missed in https://github.com/apache/airflow/pull/49980
---
Dockerfile.ci | 2 +-
clients/python/test_python_client.py | 2 +-
contributing-docs/12_airflow_dependencies_and_extras.rst | 10 +++++-----
dev/README_RELEASE_AIRFLOW.md | 2 +-
dev/breeze/README.md | 2 +-
dev/breeze/pyproject.toml | 1 -
dev/breeze/tests/test_run_test_args.py | 2 +-
dev/check_files.py | 2 +-
docker_tests/constants.py | 2 +-
kubernetes_tests/test_kubernetes_pod_operator.py | 2 +-
scripts/ci/docker-compose/devcontainer.env | 4 ++--
scripts/ci/docker-compose/devcontainer.yml | 2 +-
scripts/ci/pre_commit/mypy.py | 2 +-
scripts/ci/pre_commit/mypy_folder.py | 2 +-
scripts/docker/entrypoint_ci.sh | 2 +-
scripts/in_container/install_airflow_and_providers.py | 2 +-
scripts/in_container/run_generate_constraints.py | 4 ++--
tests/providers/google/cloud/operators/test_mlengine.py | 2 +-
tests/providers/google/cloud/triggers/test_mlengine.py | 2 +-
.../providers/cncf/kubernetes/example_kubernetes_decorator.py | 4 ++--
20 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/Dockerfile.ci b/Dockerfile.ci
index d6df23d2b44..61fc11089a2 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -702,7 +702,7 @@ chmod 1777 /tmp
AIRFLOW_SOURCES=$(cd "${IN_CONTAINER_DIR}/../.." || exit 1; pwd)
-PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.8}
+PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.9}
export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}
diff --git a/clients/python/test_python_client.py
b/clients/python/test_python_client.py
index d36f6d1bcc0..b4b287afb89 100644
--- a/clients/python/test_python_client.py
+++ b/clients/python/test_python_client.py
@@ -17,7 +17,7 @@
#
# PEP 723 compliant inline script metadata (not yet widely supported)
# /// script
-# requires-python = ">=3.8"
+# requires-python = ">=3.9"
# dependencies = [
# "apache-airflow-client",
# "rich",
diff --git a/contributing-docs/12_airflow_dependencies_and_extras.rst
b/contributing-docs/12_airflow_dependencies_and_extras.rst
index 50854799ca8..38332096a2f 100644
--- a/contributing-docs/12_airflow_dependencies_and_extras.rst
+++ b/contributing-docs/12_airflow_dependencies_and_extras.rst
@@ -85,8 +85,8 @@ from the PyPI package:
.. code-block:: bash
- pip install "apache-airflow[google,amazon,async]==2.2.5" \
- --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-2.2.5/constraints-3.8.txt"
+ pip install "apache-airflow[google,amazon,async]==2.11.0." \
+ --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-2.11.0./constraints-3.9.txt"
The last one can be used to install Airflow in "minimal" mode - i.e when bare
Airflow is installed without
extras.
@@ -98,7 +98,7 @@ requirements).
.. code-block:: bash
pip install -e ".[devel]" \
- --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.8.txt"
+ --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.9.txt"
This also works with extras - for example:
@@ -106,7 +106,7 @@ This also works with extras - for example:
.. code-block:: bash
pip install ".[ssh]" \
- --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.8.txt"
+ --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.9.txt"
There are different set of fixed constraint files for different python
major/minor versions and you should
@@ -118,7 +118,7 @@ using ``constraints-no-providers`` constraint files as well.
.. code-block:: bash
pip install . --upgrade \
- --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.8.txt"
+ --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.9.txt"
The ``constraints-<PYTHON_MAJOR_MINOR_VERSION>.txt`` and
``constraints-no-providers-<PYTHON_MAJOR_MINOR_VERSION>.txt``
diff --git a/dev/README_RELEASE_AIRFLOW.md b/dev/README_RELEASE_AIRFLOW.md
index 3439bbe4d59..c1602ea1652 100644
--- a/dev/README_RELEASE_AIRFLOW.md
+++ b/dev/README_RELEASE_AIRFLOW.md
@@ -675,7 +675,7 @@ Optionally it can be followed with constraints
```shell script
pip install apache-airflow==<VERSION>rc<X> \
- --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-<VERSION>/constraints-3.8.txt"`
+ --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-<VERSION>/constraints-3.9.txt"`
```
Note that the constraints contain python version that you are installing it
with.
diff --git a/dev/breeze/README.md b/dev/breeze/README.md
index b73193fd8d0..077f820dfd4 100644
--- a/dev/breeze/README.md
+++ b/dev/breeze/README.md
@@ -128,6 +128,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY
UPDATED BY PRE-COMMIT.
---------------------------------------------------------------------------------------------------------
-Package config hash:
8ffea3f340132c8cbe5c5ee29e95563ba0bcb91aabf5ae792e6ac99326108abeb1e0d2c281c444a136c73557f4d1bbb00a6b41f1bf406f6cb2f23f48ffda7424
+Package config hash:
b3fa7a0a91cc5be74352789e326e72ef2bbe1c63f2b49b59d763a9c4eb8a218e39526a45fbd0d36c9ef9f18a1d3e166305273f32742f3f432342ae7ec506f94a
---------------------------------------------------------------------------------------------------------
diff --git a/dev/breeze/pyproject.toml b/dev/breeze/pyproject.toml
index 6cb45430342..40a1a7c23f7 100644
--- a/dev/breeze/pyproject.toml
+++ b/dev/breeze/pyproject.toml
@@ -36,7 +36,6 @@ classifiers = [
"Intended Audience :: Developers",
"Framework :: Apache Airflow",
"License :: OSI Approved :: Apache Software License",
- "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
diff --git a/dev/breeze/tests/test_run_test_args.py
b/dev/breeze/tests/test_run_test_args.py
index 48b979a920d..0d8560de59f 100644
--- a/dev/breeze/tests/test_run_test_args.py
+++ b/dev/breeze/tests/test_run_test_args.py
@@ -71,7 +71,7 @@ def
test_primary_test_arg_is_excluded_by_extra_pytest_arg(mock_run_command):
test_type=f"Providers[{test_provider},{test_provider_not_skipped}]",
),
extra_pytest_args=(f"--ignore=tests/providers/{test_provider}",),
- python_version="3.8",
+ python_version="3.9",
output=None,
test_timeout=60,
skip_docker_compose_down=True,
diff --git a/dev/check_files.py b/dev/check_files.py
index 321f646a2c2..981b8fd5115 100644
--- a/dev/check_files.py
+++ b/dev/check_files.py
@@ -33,7 +33,7 @@ RUN rm -rf /opt/airflow/airflow/providers
"""
AIRFLOW_DOCKER = """\
-FROM python:3.8
+FROM python:3.9
# Upgrade
RUN pip install "apache-airflow=={}"
diff --git a/docker_tests/constants.py b/docker_tests/constants.py
index 83c77e2fb4c..7be368a2f8b 100644
--- a/docker_tests/constants.py
+++ b/docker_tests/constants.py
@@ -21,6 +21,6 @@ from pathlib import Path
SOURCE_ROOT = Path(__file__).resolve().parents[1]
-DEFAULT_PYTHON_MAJOR_MINOR_VERSION = "3.8"
+DEFAULT_PYTHON_MAJOR_MINOR_VERSION = "3.9"
DEFAULT_DOCKER_IMAGE =
f"ghcr.io/apache/airflow/main/prod/python{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}:latest"
DOCKER_IMAGE = os.environ.get("DOCKER_IMAGE") or DEFAULT_DOCKER_IMAGE
diff --git a/kubernetes_tests/test_kubernetes_pod_operator.py
b/kubernetes_tests/test_kubernetes_pod_operator.py
index 87fa668daa4..13bf99d728d 100644
--- a/kubernetes_tests/test_kubernetes_pod_operator.py
+++ b/kubernetes_tests/test_kubernetes_pod_operator.py
@@ -1346,7 +1346,7 @@ def
test_hide_sensitive_field_in_templated_fields_on_error(caplog, monkeypatch):
task = KubernetesPodOperator(
task_id="dry_run_demo",
name="hello-dry-run",
- image="python:3.8-slim-buster",
+ image="python:3.9-slim-buster",
cmds=["printenv"],
env_vars=[
V1EnvVar(name="password", value="{{ password }}"),
diff --git a/scripts/ci/docker-compose/devcontainer.env
b/scripts/ci/docker-compose/devcontainer.env
index b63c7cf5fdd..1d1bd2c310d 100644
--- a/scripts/ci/docker-compose/devcontainer.env
+++ b/scripts/ci/docker-compose/devcontainer.env
@@ -15,10 +15,10 @@
# specific language governing permissions and limitations
# under the License.
HOME=
-AIRFLOW_CI_IMAGE="ghcr.io/apache/airflow/main/ci/python3.8:latest"
+AIRFLOW_CI_IMAGE="ghcr.io/apache/airflow/main/ci/python3.9:latest"
ANSWER=
AIRFLOW_ENV="development"
-PYTHON_MAJOR_MINOR_VERSION="3.8"
+PYTHON_MAJOR_MINOR_VERSION="3.9"
AIRFLOW_EXTRAS=
BASE_BRANCH="main"
BREEZE="true"
diff --git a/scripts/ci/docker-compose/devcontainer.yml
b/scripts/ci/docker-compose/devcontainer.yml
index 59230f1b5b0..f3f77f253f5 100644
--- a/scripts/ci/docker-compose/devcontainer.yml
+++ b/scripts/ci/docker-compose/devcontainer.yml
@@ -19,7 +19,7 @@ services:
airflow:
stdin_open: true # docker run -i
tty: true # docker run -t
- image: ghcr.io/apache/airflow/main/ci/python3.8
+ image: ghcr.io/apache/airflow/main/ci/python3.9
env_file: devcontainer.env
ports:
- "22:22"
diff --git a/scripts/ci/pre_commit/mypy.py b/scripts/ci/pre_commit/mypy.py
index fde1bd85511..f57818342d7 100755
--- a/scripts/ci/pre_commit/mypy.py
+++ b/scripts/ci/pre_commit/mypy.py
@@ -63,6 +63,6 @@ if res.returncode != 0:
"[yellow]If you see strange stacktraces above, and can't reproduce it,
please run"
" this command and try again:\n"
)
- console.print(f"breeze ci-image build --python 3.8{flag}\n")
+ console.print(f"breeze ci-image build --python 3.9{flag}\n")
console.print("[yellow]You can also run `breeze down --cleanup-mypy-cache`
to clean up the cache used.\n")
sys.exit(res.returncode)
diff --git a/scripts/ci/pre_commit/mypy_folder.py
b/scripts/ci/pre_commit/mypy_folder.py
index d674d2c2462..0db271dd785 100755
--- a/scripts/ci/pre_commit/mypy_folder.py
+++ b/scripts/ci/pre_commit/mypy_folder.py
@@ -97,6 +97,6 @@ if res.returncode != 0:
"[yellow]If you see strange stacktraces above, and can't reproduce it,
please run"
" this command and try again:\n"
)
- console.print(f"breeze ci-image build --python 3.8{flag}\n")
+ console.print(f"breeze ci-image build --python 3.9{flag}\n")
console.print("[yellow]You can also run `breeze down --cleanup-mypy-cache`
to clean up the cache used.\n")
sys.exit(res.returncode)
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index abd5017fe6e..cdeb19a7c33 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -40,7 +40,7 @@ chmod 1777 /tmp
AIRFLOW_SOURCES=$(cd "${IN_CONTAINER_DIR}/../.." || exit 1; pwd)
-PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.8}
+PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.9}
export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}
diff --git a/scripts/in_container/install_airflow_and_providers.py
b/scripts/in_container/install_airflow_and_providers.py
index e75246e8cc6..8ef07cd5921 100755
--- a/scripts/in_container/install_airflow_and_providers.py
+++ b/scripts/in_container/install_airflow_and_providers.py
@@ -404,7 +404,7 @@ ALLOWED_MOUNT_SOURCES = ["remove", "tests",
"providers-and-tests"]
)
@click.option(
"--python-version",
- default="3.8",
+ default="3.9",
envvar="PYTHON_MAJOR_MINOR_VERSION",
show_default=True,
help="Python version to use",
diff --git a/scripts/in_container/run_generate_constraints.py
b/scripts/in_container/run_generate_constraints.py
index 1721279cb4c..d5553e7a3e2 100755
--- a/scripts/in_container/run_generate_constraints.py
+++ b/scripts/in_container/run_generate_constraints.py
@@ -33,7 +33,7 @@ from in_container_utils import click, console, run_command
AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[2]
DEFAULT_BRANCH = os.environ.get("DEFAULT_BRANCH", "main")
-PYTHON_VERSION = os.environ.get("PYTHON_MAJOR_MINOR_VERSION", "3.8")
+PYTHON_VERSION = os.environ.get("PYTHON_MAJOR_MINOR_VERSION", "3.9")
GENERATED_PROVIDER_DEPENDENCIES_FILE = AIRFLOW_SOURCE_DIR / "generated" /
"provider_dependencies.json"
ALL_PROVIDER_DEPENDENCIES =
json.loads(GENERATED_PROVIDER_DEPENDENCIES_FILE.read_text())
@@ -83,7 +83,7 @@ PYPI_PROVIDERS_CONSTRAINTS_PREFIX = f"""
# commands that might change the installed version of apache-airflow should
include "apache-airflow==X.Y.Z"
# in the list of install targets to prevent Airflow accidental upgrade or
downgrade.
#
-# Typical installation process of airflow for Python 3.8 is (with random
selection of extras and custom
+# Typical installation process of airflow for Python 3.9 is (with random
selection of extras and custom
# dependencies added), usually consists of two steps:
#
# 1. Reproducible installation of airflow with selected providers (note
constraints are used):
diff --git a/tests/providers/google/cloud/operators/test_mlengine.py
b/tests/providers/google/cloud/operators/test_mlengine.py
index b36aa728df0..0497aafdbcf 100644
--- a/tests/providers/google/cloud/operators/test_mlengine.py
+++ b/tests/providers/google/cloud/operators/test_mlengine.py
@@ -1425,7 +1425,7 @@ TEST_JOB_ID = "1234"
TEST_GCP_PROJECT_ID = "test-project"
TEST_REGION = "us-central1"
TEST_RUNTIME_VERSION = "1.15"
-TEST_PYTHON_VERSION = "3.8"
+TEST_PYTHON_VERSION = "3.9"
TEST_JOB_DIR = "gs://example_mlengine_bucket/job-dir"
TEST_PACKAGE_URIS =
["gs://system-tests-resources/example_gcp_mlengine/trainer-0.1.tar.gz"]
TEST_TRAINING_PYTHON_MODULE = "trainer.task"
diff --git a/tests/providers/google/cloud/triggers/test_mlengine.py
b/tests/providers/google/cloud/triggers/test_mlengine.py
index 9372ee0c386..497793ed3cd 100644
--- a/tests/providers/google/cloud/triggers/test_mlengine.py
+++ b/tests/providers/google/cloud/triggers/test_mlengine.py
@@ -30,7 +30,7 @@ TEST_JOB_ID = "1234"
TEST_GCP_PROJECT_ID = "test-project"
TEST_REGION = "us-central1"
TEST_RUNTIME_VERSION = "1.15"
-TEST_PYTHON_VERSION = "3.8"
+TEST_PYTHON_VERSION = "3.9"
TEST_JOB_DIR = "gs://example_mlengine_bucket/job-dir"
TEST_PACKAGE_URIS =
["gs://system-tests-resources/example_gcp_mlengine/trainer-0.1.tar.gz"]
TEST_TRAINING_PYTHON_MODULE = "trainer.task"
diff --git
a/tests/system/providers/cncf/kubernetes/example_kubernetes_decorator.py
b/tests/system/providers/cncf/kubernetes/example_kubernetes_decorator.py
index 3d989080d20..20fd7d5f74f 100644
--- a/tests/system/providers/cncf/kubernetes/example_kubernetes_decorator.py
+++ b/tests/system/providers/cncf/kubernetes/example_kubernetes_decorator.py
@@ -31,7 +31,7 @@ with DAG(
) as dag:
# [START howto_operator_kubernetes]
@task.kubernetes(
- image="python:3.8-slim-buster",
+ image="python:3.9-slim-buster",
name="k8s_test",
namespace="default",
in_cluster=False,
@@ -43,7 +43,7 @@ with DAG(
print("Hello from k8s pod")
time.sleep(2)
- @task.kubernetes(image="python:3.8-slim-buster", namespace="default",
in_cluster=False)
+ @task.kubernetes(image="python:3.9-slim-buster", namespace="default",
in_cluster=False)
def print_pattern():
n = 5
for i in range(n):