From ae88357f6e332b6d5cc8480390593a174c07fad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 28 May 2025 13:51:28 +0200 Subject: [PATCH 1/3] :sparkles: add product base compatibility check function simple function to handle transitional period until product base types are implemented and current use of product types is switched completely. --- client/ayon_core/pipeline/compatibility.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 client/ayon_core/pipeline/compatibility.py diff --git a/client/ayon_core/pipeline/compatibility.py b/client/ayon_core/pipeline/compatibility.py new file mode 100644 index 0000000000..de8c8f39a6 --- /dev/null +++ b/client/ayon_core/pipeline/compatibility.py @@ -0,0 +1,16 @@ +"""Package to handle compatibility checks for pipeline components.""" + + +def is_supporting_product_base_type() -> bool: + """Check support for product base types. + + This function checks if the current pipeline supports product base types. + Once this feature is implemented, it will return True. This should be used + in places where some kind of backward compatibility is needed to avoid + breaking existing functionality that relies on the current behavior. + + Returns: + bool: True if product base types are supported, False otherwise. + + """ + return False From d082d4180bfc48fb49b05fafddf5b335b0a2e4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 28 May 2025 15:02:10 +0200 Subject: [PATCH 2/3] :recycle: add product base type feature detection to init --- client/ayon_core/pipeline/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_core/pipeline/__init__.py b/client/ayon_core/pipeline/__init__.py index 41bcd0dbd1..363e8a5218 100644 --- a/client/ayon_core/pipeline/__init__.py +++ b/client/ayon_core/pipeline/__init__.py @@ -100,6 +100,10 @@ from .context_tools import ( get_current_task_name ) +from .compatibility import ( + is_supporting_product_base_type, +) + from .workfile import ( discover_workfile_build_plugins, register_workfile_build_plugin, @@ -223,4 +227,7 @@ __all__ = ( # Backwards compatible function names "install", "uninstall", + + # Feature detection + "is_supporting_product_base_type", ) From 8cb71fdee4682ea81e2f3bff6358b5c9c78287a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 9 Jun 2025 13:49:31 +0200 Subject: [PATCH 3/3] :recycle: refactor function name --- client/ayon_core/pipeline/__init__.py | 4 ++-- client/ayon_core/pipeline/compatibility.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/__init__.py b/client/ayon_core/pipeline/__init__.py index 363e8a5218..137736c302 100644 --- a/client/ayon_core/pipeline/__init__.py +++ b/client/ayon_core/pipeline/__init__.py @@ -101,7 +101,7 @@ from .context_tools import ( ) from .compatibility import ( - is_supporting_product_base_type, + is_product_base_type_supported, ) from .workfile import ( @@ -229,5 +229,5 @@ __all__ = ( "uninstall", # Feature detection - "is_supporting_product_base_type", + "is_product_base_type_supported", ) diff --git a/client/ayon_core/pipeline/compatibility.py b/client/ayon_core/pipeline/compatibility.py index de8c8f39a6..f7d48526b7 100644 --- a/client/ayon_core/pipeline/compatibility.py +++ b/client/ayon_core/pipeline/compatibility.py @@ -1,7 +1,7 @@ """Package to handle compatibility checks for pipeline components.""" -def is_supporting_product_base_type() -> bool: +def is_product_base_type_supported() -> bool: """Check support for product base types. This function checks if the current pipeline supports product base types.