This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 33afa8f51b6 Workaround Pydantic 2.10.0/2.10.1 for compatibility tests 
(#44317)
33afa8f51b6 is described below

commit 33afa8f51b669e9f21856ccfb5b383472a108524
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Nov 24 09:35:13 2024 +0000

    Workaround Pydantic 2.10.0/2.10.1 for compatibility tests (#44317)
    
    Our compatibility tests started to fail after Pydantic 2.10.0/2.10.1
    have been released due to change in the way they are handling base
    classes for Pydantic classes and their protected members, when
    the base class uses PEP 563 ('from __future__ import annotations`)
    on Python 3.8 / 3.9.
    
    This is tracked in https://github.com/pydantic/pydantic/issues/10958
    and hopefully will be solved by adding eval-type-backport as
    required Pydantic 2.10.2+ dependency, but until it is released,
    manually installing `eval-type-backport` in compatibility tests
    should workaround the failing canary tests.
---
 Dockerfile.ci                   | 9 +++++++++
 scripts/docker/entrypoint_ci.sh | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index 8fb36054eed..30aa33f9e5a 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -1004,6 +1004,15 @@ function determine_airflow_to_use() {
            --constraint 
https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-${PYTHON_MAJOR_MINOR_VERSION}.txt
         # Some packages might leave legacy typing module which causes test 
issues
         pip uninstall -y typing || true
+        # We need to install `eval-type-backport` to avoid problems with 
Pydantic 2.10.0/2.10.1 released in
+        # November 2024 for python 3.8 and 3.9. Hopefully this is only a 
temporary measure that will be
+        # solved in Pydantic 2.10.2 by addressing 
https://github.com/pydantic/pydantic/issues/10958
+        if [[ ${PYTHON_MAJOR_MINOR_VERSION} == "3.8" || 
${PYTHON_MAJOR_MINOR_VERSION} == "3.9" ]]; then
+            echo
+            echo "${COLOR_BLUE}Installing eval-type-backport for Python 
${PYTHON_MAJOR_MINOR_VERSION} to workaround Pydantic 2.10.0/2.10.1 issue with 
new typing style.${COLOR_RESET}"
+            echo
+            pip install eval-type-backport>=0.2.0
+        fi
         if [[ ${LINK_PROVIDERS_TO_AIRFLOW_PACKAGE=} == "true" ]]; then
             echo
             echo "${COLOR_BLUE}Linking providers to airflow package as we are 
using them from mounted sources.${COLOR_RESET}"
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index 956b18a666b..b24e89a8474 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -236,6 +236,15 @@ function determine_airflow_to_use() {
            --constraint 
https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-${PYTHON_MAJOR_MINOR_VERSION}.txt
         # Some packages might leave legacy typing module which causes test 
issues
         pip uninstall -y typing || true
+        # We need to install `eval-type-backport` to avoid problems with 
Pydantic 2.10.0/2.10.1 released in
+        # November 2024 for python 3.8 and 3.9. Hopefully this is only a 
temporary measure that will be
+        # solved in Pydantic 2.10.2 by addressing 
https://github.com/pydantic/pydantic/issues/10958
+        if [[ ${PYTHON_MAJOR_MINOR_VERSION} == "3.8" || 
${PYTHON_MAJOR_MINOR_VERSION} == "3.9" ]]; then
+            echo
+            echo "${COLOR_BLUE}Installing eval-type-backport for Python 
${PYTHON_MAJOR_MINOR_VERSION} to workaround Pydantic 2.10.0/2.10.1 issue with 
new typing style.${COLOR_RESET}"
+            echo
+            pip install eval-type-backport>=0.2.0
+        fi
         if [[ ${LINK_PROVIDERS_TO_AIRFLOW_PACKAGE=} == "true" ]]; then
             echo
             echo "${COLOR_BLUE}Linking providers to airflow package as we are 
using them from mounted sources.${COLOR_RESET}"

Reply via email to