Skip to content

Commit 160cfed

Browse files
committed
Keep galaxy.webapps imports local in operations.py
CI on PR galaxyproject#22625 caught this -- packages/test.sh installs galaxy-app on its own and runs pytest with --doctest-modules, which imports every source file at collection time. The earlier "Hoist agent-operations local imports to module level" commit moved InvocationIndexPayload/WorkflowIndexPayload up alongside the rest, but galaxy.webapps lives in galaxy-webapps and isn't a galaxy-app dependency, so those two imports blow up collection with ModuleNotFoundError. Restoring just those two as method-local imports (with a comment so we don't try to hoist them again) gets the package test back to green without dragging the rest of the cleanup back down.
1 parent efbf5e1 commit 160cfed

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/galaxy/agents/operations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
from galaxy.schema.workflows import InvokeWorkflowPayload
3535
from galaxy.structured_app import MinimalManagerApp
3636
from galaxy.tool_util_models.dynamic_tool_models import DynamicUnprivilegedToolCreatePayload
37-
from galaxy.webapps.galaxy.services.invocations import InvocationIndexPayload
38-
from galaxy.webapps.galaxy.services.workflows import WorkflowIndexPayload
37+
38+
# galaxy.webapps lives in a separate package (galaxy-webapps) and is not a
39+
# dependency of galaxy-app, so these imports must stay local to keep the
40+
# package-level test suite happy.
3941

4042
log = logging.getLogger(__name__)
4143

@@ -443,6 +445,8 @@ def list_workflows(
443445
show_shared: bool = True,
444446
search: str | None = None,
445447
) -> dict[str, Any]:
448+
from galaxy.webapps.galaxy.services.workflows import WorkflowIndexPayload
449+
446450
payload = WorkflowIndexPayload(
447451
limit=limit,
448452
offset=offset,
@@ -528,6 +532,8 @@ def get_invocations(
528532
if history_id:
529533
decoded_history_id = self.trans.security.decode_id(history_id)
530534

535+
from galaxy.webapps.galaxy.services.invocations import InvocationIndexPayload
536+
531537
payload = InvocationIndexPayload(
532538
workflow_id=decoded_workflow_id,
533539
history_id=decoded_history_id,

0 commit comments

Comments
 (0)