Skip to content

Draft: SG-44542: source setup modernization - #1356

Open
herronelou wants to merge 9 commits into
AcademySoftwareFoundation:mainfrom
herronelou:OCIO_source_setup_modernization
Open

Draft: SG-44542: source setup modernization#1356
herronelou wants to merge 9 commits into
AcademySoftwareFoundation:mainfrom
herronelou:OCIO_source_setup_modernization

Conversation

@herronelou

Copy link
Copy Markdown
Contributor

Summarize your change.

In this MR I do a pass of trying to modernize ocio_source_setup for python 3.10+, attempting to maintain compatibility, logic and signatures from previous implementation.
I would have liked to change a bit more but figured I’d limit the scope for this MR to mostly stylistic changes.
I made separate commits for each change I made so we could pick and choose what would make sense to use or not.

Describe the reason for the change.

This module used some non-conventional python patterns, making the code difficult to read and follow. Rather than an extensive rewrite, I figured cleaning up the odd patterns and adding docstrings could be a step in the right direction.

Describe what you have tested and on which operating system.

This draft is currently barely tested, and some of the commits were done with assistance from Gemini. Drafting this from Siggraph after a conversation with @rogernelson

Replaced print statements with logging for better control over output levels and formatting.

Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Refactor OCIO management functions to use functools.partial for better compatibility and maintainability. Deprecate old public API methods while preserving functionality.

Signed-off-by: Erwan Leroy <herronelou@gmail.com>
This was done with assistance from Google Gemini

Signed-off-by: Erwan Leroy <herronelou@gmail.com>
This is meant as an amendment to the last commit

Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Refactored addPath function to remove redundant returns and improve clarity. Updated method overriding to use getattr for better attribute handling.

Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Signed-off-by: Erwan Leroy <herronelou@gmail.com>
Signed-off-by: Erwan Leroy <herronelou@gmail.com>
return commands.UncheckedMenuState

return F
def isOCIOManaged(nodeType: str) -> Callable[[], int]:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’d have removed these as I don’t think anyone should really import from this file, but decided to maintain “public API” for this PR

@eloisebrosseau eloisebrosseau changed the title Draft: source setup modernization Draft: SG-44542: source setup modernization Jul 30, 2026
@eloisebrosseau eloisebrosseau added community Contribution from the Open RV Community PR: Acknowledged New PR has been acknowledge by the TSC labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Contribution from the Open RV Community PR: Acknowledged New PR has been acknowledge by the TSC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants