From 1ec9106f0124d6d69ed7a90429d791b5ad46267d Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 4 Mar 2025 16:06:07 +0100 Subject: [PATCH 01/10] Support `list[str]` for leaf entries in `core/project_folder_structure` settings to define folder names instead of requiring dicts with empty values --- client/ayon_core/pipeline/project_folders.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index 902b969457..df4353c503 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -82,6 +82,14 @@ def create_project_folders(project_name, basic_paths=None): def _list_path_items(folder_structure): output = [] + + # Allow leaf folders of the `project_folder_structure` to use a list of + # strings instead of a dictionary of keys with empty values. + if isinstance(folder_structure, list): + assert all(isinstance(item, str) for item in folder_structure) + return [folder_structure] + + # Process key, value as key for folder names and value its subfolders for key, value in folder_structure.items(): if not value: output.append(key) From b9adc29be190e9c2ecada1f64278669c53cf38ed Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 4 Mar 2025 16:06:45 +0100 Subject: [PATCH 02/10] Add some type hints --- client/ayon_core/pipeline/project_folders.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index df4353c503..a6f903701f 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -1,6 +1,7 @@ import os import re import json +from typing import Dict, Any, List, Union from ayon_core.settings import get_project_settings from ayon_core.lib import Logger @@ -9,7 +10,7 @@ from .anatomy import Anatomy from .template_data import get_project_template_data -def concatenate_splitted_paths(split_paths, anatomy): +def concatenate_splitted_paths(split_paths, anatomy: Anatomy): log = Logger.get_logger("concatenate_splitted_paths") pattern_array = re.compile(r"\[.*\]") output = [] @@ -47,7 +48,7 @@ def concatenate_splitted_paths(split_paths, anatomy): return output -def fill_paths(path_list, anatomy): +def fill_paths(path_list: List[str], anatomy: Anatomy): format_data = get_project_template_data(project_name=anatomy.project_name) format_data["root"] = anatomy.roots filled_paths = [] @@ -59,7 +60,7 @@ def fill_paths(path_list, anatomy): return filled_paths -def create_project_folders(project_name, basic_paths=None): +def create_project_folders(project_name: str, basic_paths=None): log = Logger.get_logger("create_project_folders") anatomy = Anatomy(project_name) if basic_paths is None: @@ -80,7 +81,8 @@ def create_project_folders(project_name, basic_paths=None): os.makedirs(path) -def _list_path_items(folder_structure): +def _list_path_items( + folder_structure: Union[Dict[str, Any], List[str]]): output = [] # Allow leaf folders of the `project_folder_structure` to use a list of @@ -107,7 +109,7 @@ def _list_path_items(folder_structure): return output -def get_project_basic_paths(project_name): +def get_project_basic_paths(project_name: str): project_settings = get_project_settings(project_name) folder_structure = ( project_settings["core"]["project_folder_structure"] From 7baf208c61f992a30de62f29a3aef484207ac542 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 5 Mar 2025 14:51:12 +0100 Subject: [PATCH 03/10] Fix `List[str]` entries --- client/ayon_core/pipeline/project_folders.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index a6f903701f..37197495f9 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -89,7 +89,7 @@ def _list_path_items( # strings instead of a dictionary of keys with empty values. if isinstance(folder_structure, list): assert all(isinstance(item, str) for item in folder_structure) - return [folder_structure] + return [[path] for path in folder_structure] # Process key, value as key for folder names and value its subfolders for key, value in folder_structure.items(): @@ -119,4 +119,6 @@ def get_project_basic_paths(project_name: str): if isinstance(folder_structure, str): folder_structure = json.loads(folder_structure) - return _list_path_items(folder_structure) + result = _list_path_items(folder_structure) + print(result) + return [] From 1b4f6bea20b2c6e7abac4eb5b57b9377ae78db90 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 5 Mar 2025 15:05:50 +0100 Subject: [PATCH 04/10] Revert debug code --- client/ayon_core/pipeline/project_folders.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index 37197495f9..570442ff0c 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -119,6 +119,4 @@ def get_project_basic_paths(project_name: str): if isinstance(folder_structure, str): folder_structure = json.loads(folder_structure) - result = _list_path_items(folder_structure) - print(result) - return [] + return _list_path_items(folder_structure) From ab682da2b83b1e405ed776d6b18ca8234e83d302 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 10 Mar 2025 11:51:29 +0100 Subject: [PATCH 05/10] Raise ValueError instead of using assertion --- client/ayon_core/pipeline/project_folders.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index 570442ff0c..7386382d56 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -88,7 +88,9 @@ def _list_path_items( # Allow leaf folders of the `project_folder_structure` to use a list of # strings instead of a dictionary of keys with empty values. if isinstance(folder_structure, list): - assert all(isinstance(item, str) for item in folder_structure) + if not all(isinstance(item, str) for item in folder_structure): + raise ValueError( + f"List items must all be strings. Got: {folder_structure}") return [[path] for path in folder_structure] # Process key, value as key for folder names and value its subfolders From eb17eebb99460963ef4888c039975ede350596b5 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 10 Mar 2025 12:28:49 +0100 Subject: [PATCH 06/10] Update client/ayon_core/pipeline/project_folders.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/pipeline/project_folders.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index 7386382d56..1e4d807c49 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -1,3 +1,4 @@ +from __future__ import annotations import os import re import json From 8008ab02b543b2d42a0dfbb91bd6afca315d28cf Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 10 Mar 2025 12:29:45 +0100 Subject: [PATCH 07/10] Use future annotations style --- client/ayon_core/pipeline/project_folders.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/project_folders.py b/client/ayon_core/pipeline/project_folders.py index 1e4d807c49..def2af9ba1 100644 --- a/client/ayon_core/pipeline/project_folders.py +++ b/client/ayon_core/pipeline/project_folders.py @@ -2,7 +2,7 @@ from __future__ import annotations import os import re import json -from typing import Dict, Any, List, Union +from typing import Any, Union from ayon_core.settings import get_project_settings from ayon_core.lib import Logger @@ -49,7 +49,7 @@ def concatenate_splitted_paths(split_paths, anatomy: Anatomy): return output -def fill_paths(path_list: List[str], anatomy: Anatomy): +def fill_paths(path_list: list[str], anatomy: Anatomy): format_data = get_project_template_data(project_name=anatomy.project_name) format_data["root"] = anatomy.roots filled_paths = [] @@ -83,7 +83,7 @@ def create_project_folders(project_name: str, basic_paths=None): def _list_path_items( - folder_structure: Union[Dict[str, Any], List[str]]): + folder_structure: Union[dict[str, Any], list[str]]): output = [] # Allow leaf folders of the `project_folder_structure` to use a list of From 60c9229f41a604243a71c4ffe65bf6e5b0b7e686 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 13 Mar 2025 16:47:08 +0100 Subject: [PATCH 08/10] use differnt varible name for aov frames --- client/ayon_core/pipeline/farm/pyblish_functions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/farm/pyblish_functions.py b/client/ayon_core/pipeline/farm/pyblish_functions.py index 0261a0c2b5..c6f3ae7115 100644 --- a/client/ayon_core/pipeline/farm/pyblish_functions.py +++ b/client/ayon_core/pipeline/farm/pyblish_functions.py @@ -808,14 +808,14 @@ def _create_instances_for_aov( frames_to_render is not None and isinstance(collected_files, (list, tuple)) # not single file ): - frames_to_render = convert_frames_str_to_list(frames_to_render) + aov_frames_to_render = convert_frames_str_to_list(frames_to_render) collections, _ = clique.assemble(collected_files) collected_files = _get_real_files_to_render( - collections[0], frames_to_render) + collections[0], aov_frames_to_render) else: frame_start = int(skeleton.get("frameStartHandle")) frame_end = int(skeleton.get("frameEndHandle")) - frames_to_render = list(range(frame_start, frame_end + 1)) + aov_frames_to_render = list(range(frame_start, frame_end + 1)) dynamic_data = { "aov": aov, @@ -937,8 +937,8 @@ def _create_instances_for_aov( "name": ext, "ext": ext, "files": collected_files, - "frameStart": frames_to_render[0], - "frameEnd": frames_to_render[-1], + "frameStart": aov_frames_to_render[0], + "frameEnd": aov_frames_to_render[-1], # If expectedFile are absolute, we need only filenames "stagingDir": staging_dir, "fps": new_instance.get("fps"), From 4a7f79a7bad5b533eb9112ab3ea0ada70a243566 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Thu, 13 Mar 2025 16:06:47 +0000 Subject: [PATCH 09/10] [Automated] Add generated package files from main --- client/ayon_core/version.py | 2 +- package.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 332001aef7..7717a7a215 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'core' version.""" -__version__ = "1.1.4+dev" +__version__ = "1.1.5" diff --git a/package.py b/package.py index 2c9072d443..69e4b85ef2 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "1.1.4+dev" +version = "1.1.5" client_dir = "ayon_core" diff --git a/pyproject.toml b/pyproject.toml index 0bbe0f90e1..eca50f349d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "ayon-core" -version = "1.1.4+dev" +version = "1.1.5" description = "" authors = ["Ynput Team "] readme = "README.md" From 7c4fb2d2e2f317a3f63c475fee6d4018e5ced990 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Thu, 13 Mar 2025 16:07:28 +0000 Subject: [PATCH 10/10] [Automated] Update version in package.py for develop --- client/ayon_core/version.py | 2 +- package.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 7717a7a215..de5c199428 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'core' version.""" -__version__ = "1.1.5" +__version__ = "1.1.5+dev" diff --git a/package.py b/package.py index 69e4b85ef2..250b77fe52 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "1.1.5" +version = "1.1.5+dev" client_dir = "ayon_core" diff --git a/pyproject.toml b/pyproject.toml index eca50f349d..94badd2f1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "ayon-core" -version = "1.1.5" +version = "1.1.5+dev" description = "" authors = ["Ynput Team "] readme = "README.md"