diff --git a/Dockerfile.ci b/Dockerfile.ci index d6df23d2b4437..61fc11089a2fd 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 d36f6d1bcc03c..b4b287afb891f 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 50854799ca8a4..38332096a2fca 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-.txt`` and ``constraints-no-providers-.txt`` diff --git a/dev/README_RELEASE_AIRFLOW.md b/dev/README_RELEASE_AIRFLOW.md index 3439bbe4d59a2..c1602ea16521b 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==rc \ - --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-/constraints-3.8.txt"` + --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-/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 b73193fd8d0fe..077f820dfd498 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 6cb4543034232..40a1a7c23f7e6 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 48b979a920d13..0d8560de59fcc 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 321f646a2c265..981b8fd5115d2 100644 --- a/dev/check_files.py +++ b/dev/check_files.py @@ -33,7 +33,7 @@ """ 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 83c77e2fb4c64..7be368a2f8bdb 100644 --- a/docker_tests/constants.py +++ b/docker_tests/constants.py @@ -21,6 +21,6 @@ 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 87fa668daa4fc..13bf99d728d31 100644 --- a/kubernetes_tests/test_kubernetes_pod_operator.py +++ b/kubernetes_tests/test_kubernetes_pod_operator.py @@ -1346,7 +1346,7 @@ def __getattr__(self, name): 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 b63c7cf5fdd22..1d1bd2c310d59 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 59230f1b5b080..f3f77f253f57c 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 fde1bd855114a..f57818342d70b 100755 --- a/scripts/ci/pre_commit/mypy.py +++ b/scripts/ci/pre_commit/mypy.py @@ -63,6 +63,6 @@ "[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 d674d2c2462e2..0db271dd7858f 100755 --- a/scripts/ci/pre_commit/mypy_folder.py +++ b/scripts/ci/pre_commit/mypy_folder.py @@ -97,6 +97,6 @@ "[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 abd5017fe6ef0..cdeb19a7c33e9 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 e75246e8cc653..8ef07cd592117 100755 --- a/scripts/in_container/install_airflow_and_providers.py +++ b/scripts/in_container/install_airflow_and_providers.py @@ -404,7 +404,7 @@ def find_installation_spec( ) @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 1721279cb4c37..d5553e7a3e2db 100755 --- a/scripts/in_container/run_generate_constraints.py +++ b/scripts/in_container/run_generate_constraints.py @@ -33,7 +33,7 @@ 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 @@ # 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 b36aa728df02c..0497aafdbcf26 100644 --- a/tests/providers/google/cloud/operators/test_mlengine.py +++ b/tests/providers/google/cloud/operators/test_mlengine.py @@ -1425,7 +1425,7 @@ def test_templating(self, create_task_instance_of_operator, session): 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 9372ee0c38678..497793ed3cd0e 100644 --- a/tests/providers/google/cloud/triggers/test_mlengine.py +++ b/tests/providers/google/cloud/triggers/test_mlengine.py @@ -30,7 +30,7 @@ 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 3d989080d2012..20fd7d5f74fa7 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 @@ ) 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 @@ def execute_in_k8s_pod(): 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):