AYON: Ignore separated modules (#5619)

* ayon mode explicitly ignores addons that have own repository

* change warning message of missing addon directory to debug

* Better log message
This commit is contained in:
Jakub Trllo 2023-09-19 16:52:51 +02:00 committed by GitHub
parent c83637a257
commit a8fa44c3fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,6 +59,14 @@ IGNORED_DEFAULT_FILENAMES = (
"example_addons", "example_addons",
"default_modules", "default_modules",
) )
# Modules that won't be loaded in AYON mode from "./openpype/modules"
# - the same modules are ignored in "./server_addon/create_ayon_addons.py"
IGNORED_FILENAMES_IN_AYON = {
"ftrack",
"shotgrid",
"sync_server",
"slack",
}
# Inherit from `object` for Python 2 hosts # Inherit from `object` for Python 2 hosts
@ -392,9 +400,9 @@ def _load_ayon_addons(openpype_modules, modules_key, log):
folder_name = "{}_{}".format(addon_name, addon_version) folder_name = "{}_{}".format(addon_name, addon_version)
addon_dir = os.path.join(addons_dir, folder_name) addon_dir = os.path.join(addons_dir, folder_name)
if not os.path.exists(addon_dir): if not os.path.exists(addon_dir):
log.warning(( log.debug((
"Directory for addon {} {} does not exists. Path \"{}\"" "No localized client code found for addon {} {}."
).format(addon_name, addon_version, addon_dir)) ).format(addon_name, addon_version))
continue continue
sys.path.insert(0, addon_dir) sys.path.insert(0, addon_dir)
@ -483,6 +491,10 @@ def _load_modules():
is_in_current_dir = dirpath == current_dir is_in_current_dir = dirpath == current_dir
is_in_host_dir = dirpath == hosts_dir is_in_host_dir = dirpath == hosts_dir
ignored_current_dir_filenames = set(IGNORED_DEFAULT_FILENAMES)
if AYON_SERVER_ENABLED:
ignored_current_dir_filenames |= IGNORED_FILENAMES_IN_AYON
for filename in os.listdir(dirpath): for filename in os.listdir(dirpath):
# Ignore filenames # Ignore filenames
if filename in IGNORED_FILENAMES: if filename in IGNORED_FILENAMES:
@ -490,7 +502,7 @@ def _load_modules():
if ( if (
is_in_current_dir is_in_current_dir
and filename in IGNORED_DEFAULT_FILENAMES and filename in ignored_current_dir_filenames
): ):
continue continue