-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch #499: Refactor find_host_config to lib.find_module_in_config #501
Conversation
- Add `uninstall()` function to `avalon.fusion` as that was missing. - Match Houdini and Fusion metadata collecting to Maya implementation, which had an optimization.
Actually, this could be done much easier. We should remove the code from the individual host integrations and move it to the global install function. Will update the PR. |
With 3f1aa64 the Host Integrations now don't need to manually call The This avoids the need for the Integrations per host implementing this, simplifying the code greatly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work ! Code simplified !
Just a few place need to be polished ;)
And looks like the import statements in each hosts' pipeline.py
can be polished as well, since some of the modules are not used anymore.
I think it's here, in CONTRIBUTING # Code Quality - Architecture at row A8.
Yeah, we can simplify that, but I lean to name it
I more like to keep the message, and rephrase it to like: log_.warning("Could not find '%s' in module '%s'." % (submodule, module)) And the variables need to be renamed as well. |
Thanks @davidlatwe for the thorough check. Admittedly I wrote the previous code at home and it was untested (as mentioned in the original post) because I was on holiday leave. Back in the office Today, cleaned up the code, listened to the lovely hound that is back to his regular woof-woof (thanks Marcus!) and tested the integrations in Maya, Houdini and Fusion to be sure. All good now. Can you double check the code style and let me know if there's still anything out of the ordinary? |
Just found this odd exception printing which is not a change by this PR but has been there for quite some time. Is there any Python version where that actually prints as a formatted string? I don't believe so. Python 2 err = "bar"
print("Skipped: \"%s\" (%s)", mod_name, err)
# ('Skipped: "%s" (%s)', 'foo', 'bar') Python 3 err = "bar"
print("Skipped: \"%s\" (%s)", mod_name, err)
# Skipped: "%s" (%s) foo bar I'll patch that up too. |
@BigRoy Did a quick check with Blender with the changes you mentioned and everything seems to work fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay.
I believe we could merge this, today ! 🚀
Merging this. |
This PR is related to #499
This now makes sure the way the
config.{host}
module is retrieved per host matches across each integration usingavalon.lib.find_module_in_config
as a replacement for thefind_host_config
function that eachavalon.{host}
module implemented.Aside of that, I've made the variable names consistently
config_host
as opposed to replacing theconfig
variable that could previously had left some confusion thinking it was the config module, but was actually theconfig.{host}
mdoule.And of course, as per #499 this should now allow
config.{host}
module to not exist at all for each of the integrations with only a logged warning along the lines of:Config has no '{config}.{host}' module.
Additionally this makes these changes:
uninstall()
function toavalon.fusion
as that was missing.Discussion
NOTE: This code should still be tested. However I wanted to set up this PR to discuss the code choices.
Is the code clear enough?
This imports the
find_module_in_host
function fromavalon.lib
as it became more readable than doing the following. However I believe this was frowned upon by the code style, but I couldn't find that mentioned anywhere.get_submodule
? This would shorten the function name and make it more generic. Then however, it logging the warning message feels to "specific" to the use cases. Maybe removing the warning is actually fine?