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

vincbeck 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 3e1b02a1a1a Migrate remaining providers to common.compat compatibility 
layer in singularity (#57077)
3e1b02a1a1a is described below

commit 3e1b02a1a1ad7993667f22fa56801e3f95fc0327
Author: rich7420 <[email protected]>
AuthorDate: Thu Oct 23 04:00:36 2025 +0800

    Migrate remaining providers to common.compat compatibility layer in 
singularity (#57077)
    
    * Migrate remaining providers to common.compat compatibility layer
    
    * remove extra modification
---
 providers/singularity/pyproject.toml                             | 2 ++
 .../src/airflow/providers/singularity/operators/singularity.py   | 4 ++--
 .../src/airflow/providers/singularity/version_compat.py          | 9 +--------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/providers/singularity/pyproject.toml 
b/providers/singularity/pyproject.toml
index d818114e2aa..d1be1dc5c1d 100644
--- a/providers/singularity/pyproject.toml
+++ b/providers/singularity/pyproject.toml
@@ -58,6 +58,7 @@ requires-python = ">=3.10"
 # After you modify the dependencies, and rebuild your Breeze CI image with 
``breeze ci-image build``
 dependencies = [
     "apache-airflow>=2.10.0",
+    "apache-airflow-providers-common-compat>=1.7.4",  # + TODO: bump to next 
version
     "spython>=0.0.56",
 ]
 
@@ -66,6 +67,7 @@ dev = [
     "apache-airflow",
     "apache-airflow-task-sdk",
     "apache-airflow-devel-common",
+    "apache-airflow-providers-common-compat",
     # Additional devel dependencies (do not remove this line and add extra 
development dependencies)
 ]
 
diff --git 
a/providers/singularity/src/airflow/providers/singularity/operators/singularity.py
 
b/providers/singularity/src/airflow/providers/singularity/operators/singularity.py
index b527e61a5bd..fcb71b5cf1b 100644
--- 
a/providers/singularity/src/airflow/providers/singularity/operators/singularity.py
+++ 
b/providers/singularity/src/airflow/providers/singularity/operators/singularity.py
@@ -26,10 +26,10 @@ from typing import TYPE_CHECKING, Any
 from spython.main import Client
 
 from airflow.exceptions import AirflowException
-from airflow.providers.singularity.version_compat import BaseOperator
+from airflow.providers.common.compat.sdk import BaseOperator
 
 if TYPE_CHECKING:
-    from airflow.providers.singularity.version_compat import Context
+    from airflow.providers.common.compat.sdk import Context
 
 
 class SingularityOperator(BaseOperator):
diff --git 
a/providers/singularity/src/airflow/providers/singularity/version_compat.py 
b/providers/singularity/src/airflow/providers/singularity/version_compat.py
index 2b5c813d224..fe5ec311885 100644
--- a/providers/singularity/src/airflow/providers/singularity/version_compat.py
+++ b/providers/singularity/src/airflow/providers/singularity/version_compat.py
@@ -29,11 +29,4 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
 
 AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
 
-if AIRFLOW_V_3_0_PLUS:
-    from airflow.sdk import BaseOperator
-    from airflow.sdk.definitions.context import Context
-else:
-    from airflow.models import BaseOperator
-    from airflow.utils.context import Context
-
-__all__ = ["AIRFLOW_V_3_0_PLUS", "BaseOperator", "Context"]
+__all__ = ["AIRFLOW_V_3_0_PLUS"]

Reply via email to