Publish: Remove dataclasses from publish plugins - #2050
Conversation
moonyuet
left a comment
There was a problem hiding this comment.
publish-report-260915-17-43.json
Tested successfully with maya USD publish and review.
|
Looks ok to me - note that the issue only occurs if the file has |
There was a problem hiding this comment.
🟡 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 fromfrom_dict; the previousdataclasses.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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@iLLiCiTiT can we merge this and get to a release sometime soon? |
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:
Resolves ynput/ayon-nuke#366