You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fusion which looking at the code will actually pass but instead return the config itself as opposed to the fusion package inside of it. Which is also very wrong. It should actually set config = None.
What did you expect?
Clarify what is going on, and allow it to pass.
It should either:
Show a descriptive error message on how this could be solved.
Or, maybe even more preferred, allow it to actually run fine without requiring{config}/nuke module to exist. Maybe just logging a warning of something like:
Config "polly" has no dedicated "nuke" module. Skipping config initialization for "nuke"
I'd opt for two and make it very clear where and how one could set something like that up. Maybe even pointing to a part in the documentation on how to set up custom installations in a studio config for an integration.
Avoid code duplication
Additionally, note how the find_host_config code is duplicated among all integrations. I'd recommend instead making a single function in avalon.lib like:
# pseudocodedeffind_host_config(config, host):
config_name=config.__name__module_name="%s.%s"% (config_name, host)
try:
config=importlib.import_module(module_name)
exceptImportErrorasexc:
ifstr(exc) !="No module name {}".format(module_name):
log.warning("Config has no '%s' module."%module_name)
config=Nonereturnconfig
And then e.g. use it in the avalon.nuke.pipeline as simply as lib.find_host_config(config, "nuke").
To Reproduce
Try running e.g Nuke with the Polly config which does not have anything set up for nuke.
Additional context
This "No module" error caught my attention as someone asked me about how to get the Nuke integration up and running which he failed to try out because of a config that didn't have polly/nuke/__init__.py
The text was updated successfully, but these errors were encountered:
In the PR I actually proposed a different way of cleaning the duplicate code by moving the code to the global install/uninstall which makes much more sense and it would never have to be duplicated for new hosts, greatly simplifying what's required for new host integrations.
Be aware that pending integrations like #466#497#496#502 should update the core install and uninstall functions for the host accordingly, that is the removal of calling install and uninstall on the config's host module.
Issue
Say you're a newcomer to Avalon and you'd want to try the setup in Nuke with a config that does not have
{config}/nuke/__init__.py
yet you will run into anImportError
error saying "No module name nuke".The same is true for other hosts like:
fusion
package inside of it. Which is also very wrong. It should actually setconfig = None
.What did you expect?
Clarify what is going on, and allow it to pass.
It should either:
{config}/nuke
module to exist. Maybe just logging a warning of something like:I'd opt for two and make it very clear where and how one could set something like that up. Maybe even pointing to a part in the documentation on how to set up custom installations in a studio config for an integration.
Avoid code duplication
Additionally, note how the
find_host_config
code is duplicated among all integrations. I'd recommend instead making a single function inavalon.lib
like:And then e.g. use it in the
avalon.nuke.pipeline
as simply aslib.find_host_config(config, "nuke")
.To Reproduce
Try running e.g Nuke with the Polly config which does not have anything set up for
nuke
.Additional context
This "No module" error caught my attention as someone asked me about how to get the Nuke integration up and running which he failed to try out because of a config that didn't have
polly/nuke/__init__.py
The text was updated successfully, but these errors were encountered: