From 06fa2eb817fa3b01c36c9ab81a79f15db1bd81a7 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 20 Mar 2025 10:09:45 +0100 Subject: [PATCH] Add lower-binding for microsoft azure/winrm providers For Python 3.12 removal of distutils causes older versions of microsoft libraries to fail when trying to import it when lowest bound versions of msal-extensions and pywirm are used. Adding lower binding for msal-extensions and pywinrm should avoid that. --- generated/provider_dependencies.json | 5 +++-- providers/microsoft/azure/README.rst | 1 + providers/microsoft/azure/pyproject.toml | 3 ++- .../airflow/providers/microsoft/azure/get_provider_info.py | 3 ++- providers/microsoft/winrm/README.rst | 2 +- providers/microsoft/winrm/pyproject.toml | 2 +- .../airflow/providers/microsoft/winrm/get_provider_info.py | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index 4e94396271757..6c6218d7ee925 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -854,10 +854,11 @@ "microsoft-kiota-http>=1.3.0,!=1.3.4", "microsoft-kiota-serialization-json==1.0.0", "microsoft-kiota-serialization-text==1.0.0", + "msal-extensions>=1.1.0", "msgraph-core>=1.0.0,!=1.1.8" ], "devel-deps": [ - "pywinrm>=0.4" + "pywinrm>=0.5.0" ], "plugins": [], "cross-providers-deps": [ @@ -899,7 +900,7 @@ "microsoft.winrm": { "deps": [ "apache-airflow>=2.9.0", - "pywinrm>=0.4" + "pywinrm>=0.5.0" ], "devel-deps": [], "plugins": [], diff --git a/providers/microsoft/azure/README.rst b/providers/microsoft/azure/README.rst index 6d7f34885d133..6f0f3ee17d1be 100644 --- a/providers/microsoft/azure/README.rst +++ b/providers/microsoft/azure/README.rst @@ -80,6 +80,7 @@ PIP package Version required ``microsoft-kiota-serialization-json`` ``==1.0.0`` ``microsoft-kiota-serialization-text`` ``==1.0.0`` ``microsoft-kiota-abstractions`` ``<1.4.0`` +``msal-extensions`` ``>=1.1.0`` ====================================== =================== Cross provider package dependencies diff --git a/providers/microsoft/azure/pyproject.toml b/providers/microsoft/azure/pyproject.toml index 5fc53385797d6..aa51beb4d4c3b 100644 --- a/providers/microsoft/azure/pyproject.toml +++ b/providers/microsoft/azure/pyproject.toml @@ -91,6 +91,7 @@ dependencies = [ # microsoft-kiota-abstractions 1.4.0 breaks MyPy static checks on main # see https://github.com/apache/airflow/issues/43036 "microsoft-kiota-abstractions<1.4.0", + "msal-extensions>=1.1.0", ] # The optional dependencies should be modified in place in the generated file @@ -119,7 +120,7 @@ dev = [ "apache-airflow-providers-oracle", "apache-airflow-providers-sftp", # Additional devel dependencies (do not remove this line and add extra development dependencies) - "pywinrm>=0.4", + "pywinrm>=0.5.0", ] [tool.uv.sources] diff --git a/providers/microsoft/azure/src/airflow/providers/microsoft/azure/get_provider_info.py b/providers/microsoft/azure/src/airflow/providers/microsoft/azure/get_provider_info.py index d74d5dcf8d929..f66850078b9e1 100644 --- a/providers/microsoft/azure/src/airflow/providers/microsoft/azure/get_provider_info.py +++ b/providers/microsoft/azure/src/airflow/providers/microsoft/azure/get_provider_info.py @@ -486,6 +486,7 @@ def get_provider_info(): "microsoft-kiota-serialization-json==1.0.0", "microsoft-kiota-serialization-text==1.0.0", "microsoft-kiota-abstractions<1.4.0", + "msal-extensions>=1.1.0", ], "optional-dependencies": { "amazon": ["apache-airflow-providers-amazon"], @@ -493,5 +494,5 @@ def get_provider_info(): "oracle": ["apache-airflow-providers-oracle"], "sftp": ["apache-airflow-providers-sftp"], }, - "devel-dependencies": ["pywinrm>=0.4"], + "devel-dependencies": ["pywinrm>=0.5.0"], } diff --git a/providers/microsoft/winrm/README.rst b/providers/microsoft/winrm/README.rst index 097f9db773559..3145387466bea 100644 --- a/providers/microsoft/winrm/README.rst +++ b/providers/microsoft/winrm/README.rst @@ -54,7 +54,7 @@ Requirements PIP package Version required ================== ================== ``apache-airflow`` ``>=2.9.0`` -``pywinrm`` ``>=0.4`` +``pywinrm`` ``>=0.5.0`` ================== ================== The changelog for the provider package can be found in the diff --git a/providers/microsoft/winrm/pyproject.toml b/providers/microsoft/winrm/pyproject.toml index 585d7afd836a8..6b019bd723abc 100644 --- a/providers/microsoft/winrm/pyproject.toml +++ b/providers/microsoft/winrm/pyproject.toml @@ -58,7 +58,7 @@ requires-python = "~=3.9" # After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build`` dependencies = [ "apache-airflow>=2.9.0", - "pywinrm>=0.4", + "pywinrm>=0.5.0", ] [dependency-groups] diff --git a/providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/get_provider_info.py b/providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/get_provider_info.py index 33d26a217fefe..56517f27b0a36 100644 --- a/providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/get_provider_info.py +++ b/providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/get_provider_info.py @@ -76,6 +76,6 @@ def get_provider_info(): "python-modules": ["airflow.providers.microsoft.winrm.hooks.winrm"], } ], - "dependencies": ["apache-airflow>=2.9.0", "pywinrm>=0.4"], + "dependencies": ["apache-airflow>=2.9.0", "pywinrm>=0.5.0"], "devel-dependencies": [], }