Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/OP-7353-make_houdini_submissions_r…
Browse files Browse the repository at this point in the history
…espect_pools_groups
  • Loading branch information
antirotor authored Mar 19, 2024
2 parents a26f17c + fd2a3e6 commit 3b614b3
Show file tree
Hide file tree
Showing 513 changed files with 9,538 additions and 14,483 deletions.
8 changes: 6 additions & 2 deletions client/ayon_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os
from .version import __version__


AYON_CORE_ROOT = os.path.dirname(os.path.abspath(__file__))

# TODO remove after '1.x.x'
# -------------------------
# DEPRECATED - Remove before '1.x.x' release
# -------------------------
PACKAGE_DIR = AYON_CORE_ROOT
PLUGINS_DIR = os.path.join(AYON_CORE_ROOT, "plugins")
AYON_SERVER_ENABLED = True

# Indicate if AYON entities should be used instead of OpenPype entities
USE_AYON_ENTITIES = False
USE_AYON_ENTITIES = True
# -------------------------
8 changes: 3 additions & 5 deletions client/ayon_core/addon/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import six
import appdirs
import ayon_api

from ayon_core.lib import Logger, is_dev_mode_enabled
from ayon_core.client import get_ayon_server_api_connection
from ayon_core.settings import get_studio_settings

from .interfaces import (
Expand Down Expand Up @@ -147,8 +147,7 @@ def load_addons(force=False):


def _get_ayon_bundle_data():
con = get_ayon_server_api_connection()
bundles = con.get_bundles()["bundles"]
bundles = ayon_api.get_bundles()["bundles"]

bundle_name = os.getenv("AYON_BUNDLE_NAME")

Expand Down Expand Up @@ -176,8 +175,7 @@ def _get_ayon_addons_information(bundle_info):

output = []
bundle_addons = bundle_info["addons"]
con = get_ayon_server_api_connection()
addons = con.get_addons_info()["addons"]
addons = ayon_api.get_addons_info()["addons"]
for addon in addons:
name = addon["name"]
versions = addon.get("versions")
Expand Down
15 changes: 8 additions & 7 deletions client/ayon_core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ayon_core import AYON_CORE_ROOT
from ayon_core.addon import AddonsManager
from ayon_core.settings import get_general_environments
from ayon_core.lib import initialize_ayon_connection

from .cli_commands import Commands

Expand Down Expand Up @@ -102,19 +103,18 @@ def extractenvironments(output_json_path, project, asset, task, app, envgroup):


@main_cli.command()
@click.argument("paths", nargs=-1)
@click.option("-t", "--targets", help="Targets module", default=None,
@click.argument("path", required=True)
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
@click.option("-g", "--gui", is_flag=True,
help="Show Publish UI", default=False)
def publish(paths, targets, gui):
def publish(path, targets, gui):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
Publish collects json from path provided as an argument.
S
"""

Commands.publish(list(paths), targets, gui)
Commands.publish(path, targets, gui)


@main_cli.command(context_settings={"ignore_unknown_options": True})
Expand Down Expand Up @@ -243,6 +243,7 @@ def _set_addons_environments():


def main(*args, **kwargs):
initialize_ayon_connection()
python_path = os.getenv("PYTHONPATH", "")
split_paths = python_path.split(os.pathsep)

Expand Down
29 changes: 15 additions & 14 deletions client/ayon_core/cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import sys
import json
import warnings


class Commands:
Expand Down Expand Up @@ -41,21 +42,21 @@ def add_addons(click_func):
return click_func

@staticmethod
def publish(paths, targets=None, gui=False):
def publish(path: str, targets: list=None, gui:bool=False) -> None:
"""Start headless publishing.
Publish use json from passed paths argument.
Publish use json from passed path argument.
Args:
paths (list): Paths to jsons.
targets (string): What module should be targeted
(to choose validator for example)
path (str): Path to JSON.
targets (list of str): List of pyblish targets.
gui (bool): Show publish UI.
Raises:
RuntimeError: When there is no path to process.
"""
RuntimeError: When executed with list of JSON paths.
"""
from ayon_core.lib import Logger
from ayon_core.lib.applications import (
get_app_environments_for_context,
Expand All @@ -73,6 +74,9 @@ def publish(paths, targets=None, gui=False):
import pyblish.api
import pyblish.util

if not isinstance(path, str):
raise RuntimeError("Path to JSON must be a string.")

# Fix older jobs
for src_key, dst_key in (
("AVALON_PROJECT", "AYON_PROJECT_NAME"),
Expand All @@ -95,11 +99,8 @@ def publish(paths, targets=None, gui=False):

publish_paths = manager.collect_plugin_paths()["publish"]

for path in publish_paths:
pyblish.api.register_plugin_path(path)

if not any(paths):
raise RuntimeError("No publish paths specified")
for plugin_path in publish_paths:
pyblish.api.register_plugin_path(plugin_path)

app_full_name = os.getenv("AYON_APP_NAME")
if app_full_name:
Expand All @@ -122,7 +123,7 @@ def publish(paths, targets=None, gui=False):
else:
pyblish.api.register_target("farm")

os.environ["AYON_PUBLISH_DATA"] = os.pathsep.join(paths)
os.environ["AYON_PUBLISH_DATA"] = path
os.environ["HEADLESS_PUBLISH"] = 'true' # to use in app lib

log.info("Running publish ...")
Expand Down Expand Up @@ -181,7 +182,7 @@ def extractenvironments(output_json_path, project, asset, task, app,
json.dump(env, file_stream, indent=4)

@staticmethod
def contextselection(output_path, project_name, asset_name, strict):
def contextselection(output_path, project_name, folder_path, strict):
from ayon_core.tools.context_dialog import main

main(output_path, project_name, asset_name, strict)
main(output_path, project_name, folder_path, strict)
110 changes: 0 additions & 110 deletions client/ayon_core/client/__init__.py

This file was deleted.

28 changes: 0 additions & 28 deletions client/ayon_core/client/constants.py

This file was deleted.

Loading

0 comments on commit 3b614b3

Please sign in to comment.