Skip to content

Publish: Remove dataclasses from publish plugins - #2050

Merged
iLLiCiTiT merged 9 commits into
developfrom
bugfix/remove-dataclasses-from-publish-plugins
Sep 17, 2026
Merged

iLLiCiTiT merged 9 commits into
developfrom
bugfix/remove-dataclasses-from-publish-plugins

Conversation

@iLLiCiTiT

@iLLiCiTiT iLLiCiTiT commented Sep 11, 2026

Copy link
Copy Markdown
Member

Changelog Description

Use classic classes instead of dataclasses in publish plugins.

Additional info

Dataclasses are broken in case they are in publish plugin files which are discovered using pyblish discovery logic (it works if AYON's discovery is used...).

Replaced dataclasses with just classes -> added __init__ and similar "work-like" logic.

Testing notes:

  1. Collect addons, Extract Thumbnail, Extract USD Layer plugins should work if pyblish publish logic is triggered instead of AYON's logic.

Resolves ynput/ayon-nuke#366

@iLLiCiTiT
iLLiCiTiT requested a review from BigRoy September 11, 2026 16:03
@iLLiCiTiT iLLiCiTiT self-assigned this Sep 11, 2026
@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Sep 11, 2026
@ynbot ynbot added the size/S label Sep 11, 2026

@moonyuet moonyuet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publish-report-260915-17-43.json

Tested successfully with maya USD publish and review.

@BigRoy

BigRoy commented Sep 15, 2026

Copy link
Copy Markdown
Member

Looks ok to me - note that the issue only occurs if the file has from __future__ import annotations at the top. So some of these fixes aren't entirely needed, but it's maybe a safe preparation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two moderate compatibility and maintainability issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request replaces dataclasses in publish plugin helpers with classic classes for Pyblish compatibility.

Changes:

  • Added explicit constructors for contribution and addon models.
  • Reimplemented thumbnail initialization and dictionary conversion.
  • Updated related type annotations.
File summaries
File Review summary
client/ayon_core/plugins/publish/extract_usd_layer_contributions.py Classic contribution classes added; moderate issue with preserving positional constructor compatibility (2 votes).
client/ayon_core/plugins/publish/extract_thumbnail.py Manual thumbnail initialization added; moderate issue with duplicated constructor-field whitelist (1 vote).
client/ayon_core/plugins/publish/collect_addons.py AddonInfo converted to a classic class; no final comment.
Review details

Suppressed comments (1)

client/ayon_core/plugins/publish/extract_thumbnail.py:93

  • This whitelist duplicates every constructor field, so adding a setting to __init__ without also updating this set will silently drop that setting from from_dict; the previous dataclasses.fields(cls) implementation could not drift this way. Use a single source of truth for the accepted constructor fields (for example, derive the names from the constructor) instead of maintaining this second list.
        field_names = {
            "integrate_thumbnail",
            "target_size",
            "duration_split",
            "oiiotool_defaults",
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/ayon_core/plugins/publish/extract_usd_layer_contributions.py Outdated
@ynbot ynbot moved this from Merge Requested to Review In Progress in PR reviewing Sep 15, 2026
@github-project-automation github-project-automation Bot moved this from Review In Progress to Merge Requested in PR reviewing Sep 15, 2026
@ynbot ynbot moved this to Review In Progress in PR reviewing Sep 15, 2026
@BigRoy

BigRoy commented Sep 17, 2026

Copy link
Copy Markdown
Member

@iLLiCiTiT can we merge this and get to a release sometime soon?

@iLLiCiTiT
iLLiCiTiT merged commit 084b4c5 into develop Sep 17, 2026
2 checks passed
@iLLiCiTiT
iLLiCiTiT deleted the bugfix/remove-dataclasses-from-publish-plugins branch September 17, 2026 09:08
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in PR reviewing Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S type: bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Render On Farm fails with Ayon-Core >= 1.9.9

5 participants