Closed BigRoy closed 4 years ago
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.
This is fixed with #501
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