From 698aca8656a6dbd3404a37106b728aa0344f6b9b Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 24 Jun 2025 15:42:32 +0200 Subject: [PATCH 01/14] Extract source_resolution_* fields on representation Comes from requirement for sources from freelancers uploaded from TP or WP. --- client/ayon_core/plugins/publish/extract_review.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/ayon_core/plugins/publish/extract_review.py b/client/ayon_core/plugins/publish/extract_review.py index 89bc56c670..d650ff7688 100644 --- a/client/ayon_core/plugins/publish/extract_review.py +++ b/client/ayon_core/plugins/publish/extract_review.py @@ -1598,6 +1598,10 @@ class ExtractReview(pyblish.api.InstancePlugin): "FFprobe couldn't read resolution from input file: \"{}\"" ).format(full_input_path_single_file)) + # collect source values to be potentially used in burnins later + new_repre["source_resolution_width"] = input_width + new_repre["source_resolution_height"] = input_height + # NOTE Setting only one of `width` or `height` is not allowed # - settings value can't have None but has value of 0 output_width = output_def["width"] or output_width or None From 3daa7263ada61b883d805b266f78d91d08fe31d8 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 24 Jun 2025 15:43:10 +0200 Subject: [PATCH 02/14] Provide new templates source_resolution_* for burnin text --- client/ayon_core/plugins/publish/extract_burnin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/ayon_core/plugins/publish/extract_burnin.py b/client/ayon_core/plugins/publish/extract_burnin.py index 3f7c2f4cba..fa7fd4e504 100644 --- a/client/ayon_core/plugins/publish/extract_burnin.py +++ b/client/ayon_core/plugins/publish/extract_burnin.py @@ -757,6 +757,15 @@ class ExtractBurnin(publish.Extractor): ) }) + # burnin source resolution which might be different than on review + repre_source_resolution_width = repre.get("source_resolution_width") + repre_source_resolution_height = repre.get("source_resolution_height") + if repre_source_resolution_width and repre_source_resolution_height: + burnin_data.update({ + "source_resolution_width": repre_source_resolution_width, + "source_resolution_height": repre_source_resolution_height + }) + def filter_burnins_defs(self, profile, instance): """Filter outputs by their values from settings. From e9bc6e07f487d688bbd066f74b430a6b4036e928 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 25 Jun 2025 11:40:58 +0200 Subject: [PATCH 03/14] Do not overwrite if previously collected Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/publish/extract_review.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/plugins/publish/extract_review.py b/client/ayon_core/plugins/publish/extract_review.py index d650ff7688..0ee4cbff07 100644 --- a/client/ayon_core/plugins/publish/extract_review.py +++ b/client/ayon_core/plugins/publish/extract_review.py @@ -1599,8 +1599,10 @@ class ExtractReview(pyblish.api.InstancePlugin): ).format(full_input_path_single_file)) # collect source values to be potentially used in burnins later - new_repre["source_resolution_width"] = input_width - new_repre["source_resolution_height"] = input_height + if "source_resolution_width" not in new_repre: + new_repre["source_resolution_width"] = input_width + if "source_resolution_height" not in new_repre: + new_repre["source_resolution_height"] = input_height # NOTE Setting only one of `width` or `height` is not allowed # - settings value can't have None but has value of 0 From cd344e671068c4374352309c8847baffedef6114 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 10:37:58 +0200 Subject: [PATCH 04/14] don't use 'annotations' import in pyblish plugins --- .../plugins/publish/extract_review.py | 15 +++--- .../plugins/publish/integrate_traits.py | 47 +++++++++---------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/client/ayon_core/plugins/publish/extract_review.py b/client/ayon_core/plugins/publish/extract_review.py index 89bc56c670..9864e3a320 100644 --- a/client/ayon_core/plugins/publish/extract_review.py +++ b/client/ayon_core/plugins/publish/extract_review.py @@ -1,4 +1,3 @@ -from __future__ import annotations import os import re import copy @@ -52,7 +51,7 @@ class TempData: pixel_aspect: float resolution_width: int resolution_height: int - origin_repre: dict[str, Any] + origin_repre: "dict[str, Any]" input_is_sequence: bool first_sequence_frame: int input_allow_bg: bool @@ -60,12 +59,12 @@ class TempData: without_handles: bool handles_are_set: bool input_ext: str - explicit_input_paths: list[str] - paths_to_remove: list[str] + explicit_input_paths: "list[str]" + paths_to_remove: "list[str]" # Set later full_output_path: str = "" - filled_files: dict[int, str] = field(default_factory=dict) + filled_files: "dict[int, str]" = field(default_factory=dict) output_ext_is_image: bool = True output_is_sequence: bool = True @@ -1020,7 +1019,7 @@ class ExtractReview(pyblish.api.InstancePlugin): current_repre_name: str, start_frame: int, end_frame: int - ) -> Optional[dict[int, str]]: + ) -> Optional["dict[int, str]"]: """Tries to replace missing frames from ones from last version""" repre_file_paths = self._get_last_version_files( instance, current_repre_name) @@ -1108,7 +1107,7 @@ class ExtractReview(pyblish.api.InstancePlugin): resolution_height: int, extension: str, temp_data: TempData - ) -> Optional[dict[int, str]]: + ) -> Optional["dict[int, str]"]: """Fills missing files by blank frame.""" blank_frame_path = None @@ -1164,7 +1163,7 @@ class ExtractReview(pyblish.api.InstancePlugin): staging_dir: str, start_frame: int, end_frame: int - ) -> dict[int, str]: + ) -> "dict[int, str]": """Fill missing files in sequence by duplicating existing ones. This will take nearest frame file and copy it with so as to fill diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 38c9ecdeb4..5829510bdb 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -1,6 +1,4 @@ """Integrate representations with traits.""" -from __future__ import annotations - import contextlib import copy import hashlib @@ -87,7 +85,7 @@ class TransferItem: size: int checksum: str template: str - template_data: dict[str, Any] + template_data: "dict[str, Any]" representation: Representation related_trait: FileLocation @@ -134,7 +132,7 @@ class TemplateItem: """ anatomy: Anatomy template: str - template_data: dict[str, Any] + template_data: "dict[str, Any]" template_object: AnatomyTemplateItem @@ -144,14 +142,14 @@ class RepresentationEntity: id: str versionId: str # noqa: N815 name: str - files: dict[str, Any] - attrib: dict[str, Any] + files: "dict[str, Any]" + attrib: "dict[str, Any]" data: str - tags: list[str] + tags: "list[str]" status: str -def get_instance_families(instance: pyblish.api.Instance) -> list[str]: +def get_instance_families(instance: pyblish.api.Instance) -> "list[str]": """Get all families of the instance. Todo: @@ -177,7 +175,7 @@ def get_instance_families(instance: pyblish.api.Instance) -> list[str]: def get_changed_attributes( - old_entity: dict, new_entity: dict) -> (dict[str, Any]): + old_entity: dict, new_entity: dict) -> ("dict[str, Any]"): """Prepare changes for entity update. Todo: @@ -212,7 +210,7 @@ def get_changed_attributes( return changes -def prepare_for_json(data: dict[str, Any]) -> dict[str, Any]: +def prepare_for_json(data: "dict[str, Any]") -> "dict[str, Any]": """Prepare data for JSON serialization. If there are values that json cannot serialize, this function will @@ -354,7 +352,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_representations( self, instance: pyblish.api.Instance, - representations: list[Representation]) -> list[TransferItem]: + representations: "list[Representation]") -> "list[TransferItem]": """Get transfers from representations. This method will go through all representations and prepare transfers @@ -376,7 +374,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): """ template: str = self.get_publish_template(instance) instance_template_data: dict[str, str] = {} - transfers: list[TransferItem] = [] + transfers: "list[TransferItem]" = [] # prepare template and data to format it for representation in representations: @@ -471,7 +469,8 @@ class IntegrateTraits(pyblish.api.InstancePlugin): @staticmethod def filter_lifecycle( - representations: list[Representation]) -> list[Representation]: + representations: "list[Representation]" + ) -> "list[Representation]": """Filter representations based on LifeCycle traits. Args: @@ -887,7 +886,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_file_locations( representation: Representation, template_item: TemplateItem, - transfers: list[TransferItem]) -> None: + transfers: "list[TransferItem]") -> None: """Get transfers from FileLocations trait. Args: @@ -928,7 +927,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_sequence( representation: Representation, template_item: TemplateItem, - transfers: list[TransferItem] + transfers: "list[TransferItem]" ) -> None: """Get transfers from Sequence trait. @@ -949,7 +948,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): # template is higher, us the one from the template dst_padding = representation.get_trait( Sequence).frame_padding - frames: list[int] = sequence.get_frame_list( + frames: "list[int]" = sequence.get_frame_list( representation.get_trait(FileLocations), regex=sequence.frame_regex) template_padding = template_item.anatomy.templates_obj.frame_padding @@ -1000,7 +999,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_udim( representation: Representation, template_item: TemplateItem, - transfers: list[TransferItem] + transfers: "list[TransferItem]" ) -> None: """Get transfers from UDIM trait. @@ -1056,7 +1055,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_file_location( representation: Representation, template_item: TemplateItem, - transfers: list[TransferItem] + transfers: "list[TransferItem]" ) -> None: """Get transfers from FileLocation trait. @@ -1114,7 +1113,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_bundle( representation: Representation, template_item: TemplateItem, - transfers: list[TransferItem] + transfers: "list[TransferItem]" ) -> None: """Get transfers from Bundle trait. @@ -1152,7 +1151,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): ) def _prepare_file_info( - self, path: Path, anatomy: Anatomy) -> dict[str, Any]: + self, path: Path, anatomy: Anatomy) -> "dict[str, Any]": """Prepare information for one file (asset or resource). Arguments: @@ -1181,10 +1180,10 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def _get_legacy_files_for_representation( self, - transfer_items: list[TransferItem], + transfer_items: "list[TransferItem]", representation: Representation, anatomy: Anatomy, - ) -> list[dict[str, str]]: + ) -> "list[dict[str, str]]": """Get legacy files for a given representation. This expects the file to exist - it must run after the transfer @@ -1194,13 +1193,13 @@ class IntegrateTraits(pyblish.api.InstancePlugin): list: List of legacy files. """ - selected: list[TransferItem] = [] + selected: "list[TransferItem]" = [] selected.extend( item for item in transfer_items if item.representation == representation ) - files: list[dict[str, str]] = [] + files: "list[dict[str, str]]" = [] files.extend( self._prepare_file_info(item.destination, anatomy) for item in selected From cff69e19d04bd05f2d648e52ba420a32e61649fe Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 11:35:09 +0200 Subject: [PATCH 05/14] fix typehints --- .../plugins/publish/integrate_traits.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 5829510bdb..7edd7c9cb5 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -130,10 +130,10 @@ class TemplateItem: template_data (dict[str, Any]): Template data. template_object (AnatomyTemplateItem): Template object """ - anatomy: Anatomy + anatomy: "Anatomy" template: str template_data: "dict[str, Any]" - template_object: AnatomyTemplateItem + template_object: "AnatomyTemplateItem" @dataclass @@ -534,7 +534,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): return path_template_obj.template.replace("\\", "/") def get_publish_template_object( - self, instance: pyblish.api.Instance) -> AnatomyTemplateItem: + self, instance: pyblish.api.Instance) -> "AnatomyTemplateItem": """Return anatomy template object to use for integration. Note: What is the actual type of the object? @@ -755,7 +755,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): return version_data - def get_rootless_path(self, anatomy: Anatomy, path: str) -> str: + def get_rootless_path(self, anatomy: "Anatomy", path: str) -> str: r"""Get rootless variant of the path. Returns, if possible, a path without an absolute portion from the root @@ -1014,7 +1014,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): """ udim: UDIM = representation.get_trait(UDIM) - path_template_object: AnatomyStringTemplate = ( + path_template_object: "AnatomyStringTemplate" = ( template_item.template_object["path"] ) for file_loc in representation.get_trait( @@ -1069,7 +1069,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): template_item (TemplateItem): Template item. """ - path_template_object: AnatomyStringTemplate = ( + path_template_object: "AnatomyStringTemplate" = ( template_item.template_object["path"] ) template_item.template_data["ext"] = ( @@ -1151,7 +1151,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): ) def _prepare_file_info( - self, path: Path, anatomy: Anatomy) -> "dict[str, Any]": + self, path: Path, anatomy: "Anatomy") -> "dict[str, Any]": """Prepare information for one file (asset or resource). Arguments: @@ -1182,7 +1182,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): self, transfer_items: "list[TransferItem]", representation: Representation, - anatomy: Anatomy, + anatomy: "Anatomy", ) -> "list[dict[str, str]]": """Get legacy files for a given representation. From 0fb5220738326ef5b55afe72e71572cedd77fc25 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 11:37:06 +0200 Subject: [PATCH 06/14] one more fix --- client/ayon_core/plugins/publish/integrate_traits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 7edd7c9cb5..7961170f3b 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -244,7 +244,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): label = "Integrate Traits of an Asset" order = pyblish.api.IntegratorOrder - log: logging.Logger + log: "logging.Logger" def process(self, instance: pyblish.api.Instance) -> None: """Integrate representations with traits. From 3c3b165e36d985b0d477e29de5270e40b61e45b3 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:16:03 +0200 Subject: [PATCH 07/14] don't use dataclass for now --- .../plugins/publish/extract_review.py | 91 +++++++++++++------ 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/client/ayon_core/plugins/publish/extract_review.py b/client/ayon_core/plugins/publish/extract_review.py index 005229e305..c9596a26dd 100644 --- a/client/ayon_core/plugins/publish/extract_review.py +++ b/client/ayon_core/plugins/publish/extract_review.py @@ -1,3 +1,4 @@ +from __future__ import annotations import os import re import copy @@ -6,7 +7,6 @@ import shutil import subprocess from abc import ABC, abstractmethod from typing import Any, Optional -from dataclasses import dataclass, field import tempfile import clique @@ -36,37 +36,68 @@ from ayon_core.pipeline.publish import ( from ayon_core.pipeline.publish.lib import add_repre_files_for_cleanup -@dataclass class TempData: """Temporary data used across extractor's process.""" - fps: float - frame_start: int - frame_end: int - handle_start: int - handle_end: int - frame_start_handle: int - frame_end_handle: int - output_frame_start: int - output_frame_end: int - pixel_aspect: float - resolution_width: int - resolution_height: int - origin_repre: "dict[str, Any]" - input_is_sequence: bool - first_sequence_frame: int - input_allow_bg: bool - with_audio: bool - without_handles: bool - handles_are_set: bool - input_ext: str - explicit_input_paths: "list[str]" - paths_to_remove: "list[str]" + def __init__( + self, + fps: float, + frame_start: int, + frame_end: int, + handle_start: int, + handle_end: int, + frame_start_handle: int, + frame_end_handle: int, + output_frame_start: int, + output_frame_end: int, + pixel_aspect: float, + resolution_width: int, + resolution_height: int, + origin_repre: dict[str, Any], + input_is_sequence: bool, + first_sequence_frame: int, + input_allow_bg: bool, + with_audio: bool, + without_handles: bool, + handles_are_set: bool, + input_ext: str, + explicit_input_paths: list[str], + paths_to_remove: list[str], - # Set later - full_output_path: str = "" - filled_files: "dict[int, str]" = field(default_factory=dict) - output_ext_is_image: bool = True - output_is_sequence: bool = True + # Set later + full_output_path: str = "", + filled_files: dict[int, str] = None, + output_ext_is_image: bool = True, + output_is_sequence: bool = True, + ): + if filled_files is None: + filled_files = {} + self.fps = fps + self.frame_start = frame_start + self.frame_end = frame_end + self.handle_start = handle_start + self.handle_end = handle_end + self.frame_start_handle = frame_start_handle + self.frame_end_handle = frame_end_handle + self.output_frame_start = output_frame_start + self.output_frame_end = output_frame_end + self.pixel_aspect = pixel_aspect + self.resolution_width = resolution_width + self.resolution_height = resolution_height + self.origin_repre = origin_repre + self.input_is_sequence = input_is_sequence + self.first_sequence_frame = first_sequence_frame + self.input_allow_bg = input_allow_bg + self.with_audio = with_audio + self.without_handles = without_handles + self.handles_are_set = handles_are_set + self.input_ext = input_ext + self.explicit_input_paths = explicit_input_paths + self.paths_to_remove = paths_to_remove + + self.full_output_path = full_output_path + self.filled_files = filled_files + self.output_ext_is_image = output_ext_is_image + self.output_is_sequence = output_is_sequence def frame_to_timecode(frame: int, fps: float) -> str: @@ -1019,7 +1050,7 @@ class ExtractReview(pyblish.api.InstancePlugin): current_repre_name: str, start_frame: int, end_frame: int - ) -> Optional["dict[int, str]"]: + ) -> Optional[dict[int, str]]: """Tries to replace missing frames from ones from last version""" repre_file_paths = self._get_last_version_files( instance, current_repre_name) From 358efdb8989351cc68e9bd131191a6317605493d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 27 Jun 2025 13:30:46 +0200 Subject: [PATCH 08/14] :recycle: remove dataclasses we can't use dataclasses in pyblish plugins until new version of pyblish-base is propagated to AYON ecosystem --- .../plugins/publish/integrate_traits.py | 88 ++++++++++++++++--- 1 file changed, 77 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 7961170f3b..9f1471d090 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -1,9 +1,9 @@ """Integrate representations with traits.""" +from __future__ import annotations import contextlib import copy import hashlib import json -from dataclasses import dataclass from pathlib import Path from typing import TYPE_CHECKING, Any @@ -62,7 +62,6 @@ if TYPE_CHECKING: ) -@dataclass(frozen=True) class TransferItem: """Represents a single transfer item. @@ -85,10 +84,29 @@ class TransferItem: size: int checksum: str template: str - template_data: "dict[str, Any]" + template_data: dict[str, Any] representation: Representation related_trait: FileLocation + def __init__(self, + source: Path, + destination: Path, + size: int, + checksum: str, + template: str, + template_data: dict[str, Any], + representation: Representation, + related_trait: FileLocation): + + self.source = source + self.destination = destination + self.size = size + self.checksum = checksum + self.template = template + self.template_data = template_data + self.representation = representation + self.related_trait = related_trait + @staticmethod def get_size(file_path: Path) -> int: """Get the size of the file. @@ -118,7 +136,6 @@ class TransferItem: ).hexdigest() -@dataclass class TemplateItem: """Represents single template item. @@ -130,24 +147,73 @@ class TemplateItem: template_data (dict[str, Any]): Template data. template_object (AnatomyTemplateItem): Template object """ - anatomy: "Anatomy" + anatomy: Anatomy template: str - template_data: "dict[str, Any]" - template_object: "AnatomyTemplateItem" + template_data: dict[str, Any] + template_object: AnatomyTemplateItem + + def __init__(self, + anatomy: Anatomy, + template: str, + template_data: dict[str, Any], + template_object: AnatomyTemplateItem): + """Initialize TemplateItem. + + Args: + anatomy (Anatomy): Anatomy object. + template (str): Template path. + template_data (dict[str, Any]): Template data. + template_object (AnatomyTemplateItem): Template object. + + """ + self.anatomy = anatomy + self.template = template + self.template_data = template_data + self.template_object = template_object -@dataclass class RepresentationEntity: """Representation entity data.""" id: str versionId: str # noqa: N815 name: str - files: "dict[str, Any]" - attrib: "dict[str, Any]" + files: dict[str, Any] + attrib: dict[str, Any] data: str - tags: "list[str]" + tags: list[str] status: str + def __init__(self, + id: str, + versionId: str, # noqa: N815 + name: str, + files: dict[str, Any], + attrib: dict[str, Any], + data: str, + tags: list[str], + status: str): + """Initialize RepresentationEntity. + + Args: + id (str): Entity ID. + versionId (str): Version ID. + name (str): Representation name. + files (dict[str, Any]): Files in the representation. + attrib (dict[str, Any]): Attributes of the representation. + data (str): Data of the representation. + tags (list[str]): Tags of the representation. + status (str): Status of the representation. + + """ + self.id = id + self.versionId = versionId + self.name = name + self.files = files + self.attrib = attrib + self.data = data + self.tags = tags + self.status = status + def get_instance_families(instance: pyblish.api.Instance) -> "list[str]": """Get all families of the instance. From 6dc0a0e698f624232e284ff1a6c7e130bd9ba592 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:36:44 +0200 Subject: [PATCH 09/14] use ayon-core's publish plugin discovery --- client/ayon_core/pipeline/publish/lib.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index 464b2b6d8f..fbd6ed0b0b 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -1052,16 +1052,15 @@ def main_cli_publish( log.info("Running publish ...") - plugins = pyblish.api.discover() - print("Using plugins:") - for plugin in plugins: - print(plugin) + discover_result = publish_plugins_discover() + publish_plugins = discover_result.plugins + print("\n".join(discover_result.get_report(only_errors=False))) # Error exit as soon as any error occurs. error_format = ("Failed {plugin.__name__}: " "{error} -- {error.traceback}") - for result in pyblish.util.publish_iter(): + for result in pyblish.util.publish_iter(plugins=publish_plugins): if result["error"]: log.error(error_format.format(**result)) # uninstall() From 8ad408c50f554c0002a3b77ed6b8a9d0749570b0 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:56:29 +0200 Subject: [PATCH 10/14] revert stringified typehints --- .../plugins/publish/extract_review.py | 4 +-- .../plugins/publish/integrate_traits.py | 36 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/client/ayon_core/plugins/publish/extract_review.py b/client/ayon_core/plugins/publish/extract_review.py index c9596a26dd..a5f541225c 100644 --- a/client/ayon_core/plugins/publish/extract_review.py +++ b/client/ayon_core/plugins/publish/extract_review.py @@ -1138,7 +1138,7 @@ class ExtractReview(pyblish.api.InstancePlugin): resolution_height: int, extension: str, temp_data: TempData - ) -> Optional["dict[int, str]"]: + ) -> Optional[dict[int, str]]: """Fills missing files by blank frame.""" blank_frame_path = None @@ -1194,7 +1194,7 @@ class ExtractReview(pyblish.api.InstancePlugin): staging_dir: str, start_frame: int, end_frame: int - ) -> "dict[int, str]": + ) -> dict[int, str]: """Fill missing files in sequence by duplicating existing ones. This will take nearest frame file and copy it with so as to fill diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 9f1471d090..3fbf57be88 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -215,7 +215,7 @@ class RepresentationEntity: self.status = status -def get_instance_families(instance: pyblish.api.Instance) -> "list[str]": +def get_instance_families(instance: pyblish.api.Instance) -> list[str]: """Get all families of the instance. Todo: @@ -241,7 +241,7 @@ def get_instance_families(instance: pyblish.api.Instance) -> "list[str]": def get_changed_attributes( - old_entity: dict, new_entity: dict) -> ("dict[str, Any]"): + old_entity: dict, new_entity: dict) -> dict[str, Any]: """Prepare changes for entity update. Todo: @@ -276,7 +276,7 @@ def get_changed_attributes( return changes -def prepare_for_json(data: "dict[str, Any]") -> "dict[str, Any]": +def prepare_for_json(data: dict[str, Any]) -> dict[str, Any]: """Prepare data for JSON serialization. If there are values that json cannot serialize, this function will @@ -418,7 +418,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_representations( self, instance: pyblish.api.Instance, - representations: "list[Representation]") -> "list[TransferItem]": + representations: list[Representation]) -> list[TransferItem]: """Get transfers from representations. This method will go through all representations and prepare transfers @@ -440,7 +440,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): """ template: str = self.get_publish_template(instance) instance_template_data: dict[str, str] = {} - transfers: "list[TransferItem]" = [] + transfers: list[TransferItem] = [] # prepare template and data to format it for representation in representations: @@ -535,8 +535,8 @@ class IntegrateTraits(pyblish.api.InstancePlugin): @staticmethod def filter_lifecycle( - representations: "list[Representation]" - ) -> "list[Representation]": + representations: list[Representation] + ) -> list[Representation]: """Filter representations based on LifeCycle traits. Args: @@ -952,7 +952,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_file_locations( representation: Representation, template_item: TemplateItem, - transfers: "list[TransferItem]") -> None: + transfers: list[TransferItem]) -> None: """Get transfers from FileLocations trait. Args: @@ -993,7 +993,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_sequence( representation: Representation, template_item: TemplateItem, - transfers: "list[TransferItem]" + transfers: list[TransferItem] ) -> None: """Get transfers from Sequence trait. @@ -1014,7 +1014,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): # template is higher, us the one from the template dst_padding = representation.get_trait( Sequence).frame_padding - frames: "list[int]" = sequence.get_frame_list( + frames: list[int] = sequence.get_frame_list( representation.get_trait(FileLocations), regex=sequence.frame_regex) template_padding = template_item.anatomy.templates_obj.frame_padding @@ -1065,7 +1065,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_udim( representation: Representation, template_item: TemplateItem, - transfers: "list[TransferItem]" + transfers: list[TransferItem] ) -> None: """Get transfers from UDIM trait. @@ -1121,7 +1121,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_file_location( representation: Representation, template_item: TemplateItem, - transfers: "list[TransferItem]" + transfers: list[TransferItem] ) -> None: """Get transfers from FileLocation trait. @@ -1179,7 +1179,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def get_transfers_from_bundle( representation: Representation, template_item: TemplateItem, - transfers: "list[TransferItem]" + transfers: list[TransferItem] ) -> None: """Get transfers from Bundle trait. @@ -1217,7 +1217,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin): ) def _prepare_file_info( - self, path: Path, anatomy: "Anatomy") -> "dict[str, Any]": + self, path: Path, anatomy: "Anatomy") -> dict[str, Any]: """Prepare information for one file (asset or resource). Arguments: @@ -1246,10 +1246,10 @@ class IntegrateTraits(pyblish.api.InstancePlugin): def _get_legacy_files_for_representation( self, - transfer_items: "list[TransferItem]", + transfer_items: list[TransferItem], representation: Representation, anatomy: "Anatomy", - ) -> "list[dict[str, str]]": + ) -> list[dict[str, str]]: """Get legacy files for a given representation. This expects the file to exist - it must run after the transfer @@ -1259,13 +1259,13 @@ class IntegrateTraits(pyblish.api.InstancePlugin): list: List of legacy files. """ - selected: "list[TransferItem]" = [] + selected: list[TransferItem] = [] selected.extend( item for item in transfer_items if item.representation == representation ) - files: "list[dict[str, str]]" = [] + files: list[dict[str, str]] = [] files.extend( self._prepare_file_info(item.destination, anatomy) for item in selected From 06186a2ef04b43da22b1c80f6913a140218781b7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:57:48 +0200 Subject: [PATCH 11/14] stringify not imported types --- client/ayon_core/plugins/publish/integrate_traits.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate_traits.py b/client/ayon_core/plugins/publish/integrate_traits.py index 3fbf57be88..45f32be4a0 100644 --- a/client/ayon_core/plugins/publish/integrate_traits.py +++ b/client/ayon_core/plugins/publish/integrate_traits.py @@ -150,13 +150,13 @@ class TemplateItem: anatomy: Anatomy template: str template_data: dict[str, Any] - template_object: AnatomyTemplateItem + template_object: "AnatomyTemplateItem" def __init__(self, - anatomy: Anatomy, + anatomy: "Anatomy", template: str, template_data: dict[str, Any], - template_object: AnatomyTemplateItem): + template_object: "AnatomyTemplateItem"): """Initialize TemplateItem. Args: From bdc3285681ee2f36b473c077aa4a02cd2a379ec4 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Fri, 27 Jun 2025 12:36:01 +0000 Subject: [PATCH 12/14] [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 11fc31799b..8531e3fc42 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.3.2+dev" +__version__ = "1.4.0" diff --git a/package.py b/package.py index 908d34ffa8..2ea60bd4e9 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "1.3.2+dev" +version = "1.4.0" client_dir = "ayon_core" diff --git a/pyproject.toml b/pyproject.toml index f4a452a2b9..f5a272849f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "ayon-core" -version = "1.3.2+dev" +version = "1.4.0" description = "" authors = ["Ynput Team "] readme = "README.md" From 2352d812cc13929563a51ed4a69798be588477f5 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Fri, 27 Jun 2025 12:36:35 +0000 Subject: [PATCH 13/14] [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 8531e3fc42..df92396802 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.4.0" +__version__ = "1.4.0+dev" diff --git a/package.py b/package.py index 2ea60bd4e9..efed91b6cf 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "1.4.0" +version = "1.4.0+dev" client_dir = "ayon_core" diff --git a/pyproject.toml b/pyproject.toml index f5a272849f..91579f04fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "ayon-core" -version = "1.4.0" +version = "1.4.0+dev" description = "" authors = ["Ynput Team "] readme = "README.md" From 08f8548268f150420c65747356ecb3e2ea71acb5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 27 Jun 2025 12:37:29 +0000 Subject: [PATCH 14/14] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2cef7d13b0..eff53116a2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to AYON Tray options: + - 1.4.0 - 1.3.2 - 1.3.1 - 1.3.0