getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
213 stars 48 forks source link

No need to pass 'config' to 'host.(un)install' #505

Closed jasperges closed 4 years ago

jasperges commented 4 years ago

When changing the Blender integration so it works with #501, I noticed that the install() and uninstall() functions still expect the config variable. If I'm not mistaken this is not needed anymore and it can be safely removed after changing this line in avalon.pipeline to host.install().

Is there a reason not to change this? I can make a pull request if needed.

BigRoy commented 4 years ago

You are correct. Let's clean that up too. Let's try and force ourselves into there being no need for the Integrations to access the configs on install() .

Just for clarity. This is what happens on api.install() in the order as it is in the current code:

Step Description
io.install() Build api.Session from environment variables and connect to Avalon database
host.install() Trigger the Avalon Host Integration
config.host.install() The config Host Integration specific install()
register_host(host) Set the registered host
register_config(config) Set the registered config
config.install() The config global install()

Where host is the integration, e.g. maya or nuke. Where config is the studio configuration, e.g. the default polly or your studio config. Looking at that it still seems the order is somewhat confusing, with register_xxx in the middle there.

tokejepsen commented 4 years ago

Is the issue not with config.host.install()?

How would config do custom host installation otherwise?

BigRoy commented 4 years ago

@tokejepsen see #501 - with that the host.install() does not trigger the config.host.install() but it's api.install() that does so. That way, the code does not need to be duplicated per host integration, plus it avoids the need for the host integrations themselves to access the studio configs on install.

Does that answer your question?

tokejepsen commented 4 years ago

Excellent!