diff --git a/lib/galaxy/model/store/__init__.py b/lib/galaxy/model/store/__init__.py index b664c3cafa4..0cd9564bb3d 100644 --- a/lib/galaxy/model/store/__init__.py +++ b/lib/galaxy/model/store/__init__.py @@ -2694,14 +2694,14 @@ class BcoModelExportStore(WorkflowInvocationOnlyExportStore): empirical_error=export_options.override_empirical_error or {}, algorithmic_error=export_options.override_algorithmic_error or {}, ) - usability_domain = UsabilityDomain(__root__=usability_domain_str) + usability_domain = UsabilityDomain(root=usability_domain_str) description_domain = DescriptionDomain( keywords=keywords, xref=export_options.override_xref or [], platform=["Galaxy"], pipeline_steps=pipeline_steps, ) - parametric_domain = ParametricDomain(__root__=parametric_domain_items) + parametric_domain = ParametricDomain(root=parametric_domain_items) io_domain = InputAndOutputDomain( input_subdomain=input_subdomain_items, output_subdomain=output_subdomain_items, diff --git a/lib/galaxy/webapps/galaxy/api/histories.py b/lib/galaxy/webapps/galaxy/api/histories.py index 11d7e6a1c37..a5ddcf2a09c 100644 --- a/lib/galaxy/webapps/galaxy/api/histories.py +++ b/lib/galaxy/webapps/galaxy/api/histories.py @@ -391,8 +391,8 @@ class FastAPIHistories: use_tasks = accept == ExportTaskListResponse.__accept_type__ exports = self.service.index_exports(trans, history_id, use_tasks, limit, offset) if use_tasks: - return ExportTaskListResponse(__root__=exports) - return JobExportHistoryArchiveListResponse(__root__=exports) + return ExportTaskListResponse(root=exports) + return JobExportHistoryArchiveListResponse(root=exports) @router.put( # PUT instead of POST because multiple requests should just result in one object being created. "/api/histories/{history_id}/exports", diff --git a/lib/galaxy/webapps/galaxy/api/roles.py b/lib/galaxy/webapps/galaxy/api/roles.py index a7e3e4c10d0..1b64cdf70fc 100644 --- a/lib/galaxy/webapps/galaxy/api/roles.py +++ b/lib/galaxy/webapps/galaxy/api/roles.py @@ -45,7 +45,7 @@ class FastAPIRoles: @router.get("/api/roles") def index(self, trans: ProvidesUserContext = DependsOnTrans) -> RoleListResponse: roles = self.role_manager.list_displayable_roles(trans) - return RoleListResponse(__root__=[role_to_model(r) for r in roles]) + return RoleListResponse(root=[role_to_model(r) for r in roles]) @router.get("/api/roles/{id}") def show(self, id: DecodedDatabaseIdField, trans: ProvidesUserContext = DependsOnTrans) -> RoleModelResponse: diff --git a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py index 88ade549848..ecd866ec445 100644 --- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py +++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py @@ -142,9 +142,7 @@ class ToolShedRepositoriesController(BaseGalaxyAPIController): irm = InstallRepositoryManager(self.app) installed_tool_shed_repositories = irm.install(tool_shed_url, name, owner, changeset_revision, payload) if installed_tool_shed_repositories: - return InstalledToolShedRepositories( - __root__=list(map(self.service._show, installed_tool_shed_repositories)) - ) + return InstalledToolShedRepositories(root=list(map(self.service._show, installed_tool_shed_repositories))) message = "No repositories were installed, possibly because the selected repository has already been installed." return dict(status="ok", message=message) @@ -245,7 +243,7 @@ class ToolShedRepositoriesController(BaseGalaxyAPIController): return installed_tool_shed_repositories elif isinstance(installed_tool_shed_repositories, InstalledToolShedRepositories): all_installed_tool_shed_repositories.extend(installed_tool_shed_repositories.__root__) - return InstalledToolShedRepositories(__root__=all_installed_tool_shed_repositories) + return InstalledToolShedRepositories(root=all_installed_tool_shed_repositories) @require_admin @expose_api diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py index 2c8ca783d9b..74dad219929 100644 --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -559,7 +559,7 @@ class FastAPIUsers: for key, attributes in valid_dbkeys.items(): attributes["id"] = key dbkey_collection.append(attributes) - return CustomBuildsCollection.construct(__root__=dbkey_collection) + return CustomBuildsCollection.model_construct(root=dbkey_collection) @router.delete( "/api/users/{user_id}/custom_builds/{key}", name="delete_custom_build", summary="Delete a custom build" diff --git a/lib/galaxy/webapps/galaxy/services/history_contents.py b/lib/galaxy/webapps/galaxy/services/history_contents.py index 17a6a1f096b..b4490809e28 100644 --- a/lib/galaxy/webapps/galaxy/services/history_contents.py +++ b/lib/galaxy/webapps/galaxy/services/history_contents.py @@ -594,7 +594,7 @@ class HistoriesContentsService(ServiceBase, ServesExportStores, ConsumesModelSto :raises: RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException """ - payload_dict = payload.dict(by_alias=True) + payload_dict = payload.model_dump(by_alias=True) hda = self.hda_manager.get_owned(history_content_id, trans.user, current_history=trans.history, trans=trans) assert hda is not None self.history_manager.error_unless_mutable(hda.history) diff --git a/lib/galaxy/webapps/galaxy/services/libraries.py b/lib/galaxy/webapps/galaxy/services/libraries.py index 29e6632693c..6a896edad56 100644 --- a/lib/galaxy/webapps/galaxy/services/libraries.py +++ b/lib/galaxy/webapps/galaxy/services/libraries.py @@ -78,7 +78,7 @@ class LibrariesService(ServiceBase, ConsumesModelStores): for library in query: library_dict = self.library_manager.get_library_dict(trans, library, prefetched_ids) libraries.append(LibrarySummary(**library_dict)) - return LibrarySummaryList(__root__=libraries) + return LibrarySummaryList(root=libraries) def show(self, trans, id: DecodedDatabaseIdField) -> LibrarySummary: """Returns detailed information about a library.""" diff --git a/lib/galaxy/webapps/galaxy/services/notifications.py b/lib/galaxy/webapps/galaxy/services/notifications.py index fceb4b66f1a..1e2c128a096 100644 --- a/lib/galaxy/webapps/galaxy/services/notifications.py +++ b/lib/galaxy/webapps/galaxy/services/notifications.py @@ -92,9 +92,9 @@ class NotificationService(ServiceBase): """ self.notification_manager.ensure_notifications_enabled() if user_context.anonymous: - return UserNotificationListResponse(__root__=[]) + return UserNotificationListResponse(root=[]) user_notifications = self._get_user_notifications(user_context, limit, offset) - return UserNotificationListResponse(__root__=user_notifications) + return UserNotificationListResponse(root=user_notifications) def get_broadcasted_notification( self, user_context: ProvidesUserContext, notification_id: int @@ -118,7 +118,7 @@ class NotificationService(ServiceBase): self.notification_manager.ensure_notifications_enabled() active_only = not user_context.user_is_admin broadcasted_notifications = self._get_all_broadcasted(active_only=active_only) - return BroadcastNotificationListResponse(__root__=broadcasted_notifications) + return BroadcastNotificationListResponse(root=broadcasted_notifications) def get_user_notification(self, user: User, notification_id: int) -> UserNotificationResponse: """Gets the information of the notification received by the user with the given ID.""" diff --git a/lib/galaxy/webapps/galaxy/services/pages.py b/lib/galaxy/webapps/galaxy/services/pages.py index 8689d824868..7b5f8b5c764 100644 --- a/lib/galaxy/webapps/galaxy/services/pages.py +++ b/lib/galaxy/webapps/galaxy/services/pages.py @@ -74,9 +74,7 @@ class PagesService(ServiceBase): pages, total_matches = self.manager.index_query(trans, payload, include_total_count) return ( - PageSummaryList.construct( - __root__=[trans.security.encode_all_ids(p.to_dict(), recursive=True) for p in pages] - ), + PageSummaryList.construct(root=[trans.security.encode_all_ids(p.to_dict(), recursive=True) for p in pages]), total_matches, ) diff --git a/lib/tool_shed/test/base/populators.py b/lib/tool_shed/test/base/populators.py index dc7aeb88101..7262c9e2c80 100644 --- a/lib/tool_shed/test/base/populators.py +++ b/lib/tool_shed/test/base/populators.py @@ -229,7 +229,7 @@ class ToolShedPopulator: assert_msg = f"Updating repository [{repository}] with path [{path}] and commit_message {commit_message} failed to update repository contents, no changes found. Response: [{response_json}]" raise AssertionError(assert_msg) api_asserts.assert_status_code_is_ok(response) - return RepositoryUpdate(__root__=response.json()) + return RepositoryUpdate(root=response.json()) def new_repository(self, category_ids: Union[List[str], str], prefix: str = DEFAULT_PREFIX) -> Repository: name = random_name(prefix=prefix) @@ -293,7 +293,7 @@ class ToolShedPopulator: "repositories/get_ordered_installable_revisions", params=request.dict() ) api_asserts.assert_status_code_is_ok(revisions_response) - return OrderedInstallableRevisions(__root__=revisions_response.json()) + return OrderedInstallableRevisions(root=revisions_response.json()) def assert_has_n_installable_revisions(self, repository: Repository, n: int): revisions = self.get_ordered_installable_revisions(repository.owner, repository.name) @@ -312,7 +312,7 @@ class ToolShedPopulator: def repository_index(self, request: Optional[RepositoryIndexRequest]) -> RepositoryIndexResponse: repository_response = self._api_interactor.get("repositories", params=(request.dict() if request else {})) api_asserts.assert_status_code_is_ok(repository_response) - return RepositoryIndexResponse(__root__=repository_response.json()) + return RepositoryIndexResponse(root=repository_response.json()) def get_usernames_allowed_to_push(self, repository: HasRepositoryId) -> List[str]: repository_id = self._repository_id(repository) @@ -373,7 +373,7 @@ class ToolShedPopulator: f"repositories/{repository_id}/metadata?downloadable_only={downloadable_only}" ) api_asserts.assert_status_code_is_ok(metadata_response) - return RepositoryMetadata(__root__=metadata_response.json()) + return RepositoryMetadata(root=metadata_response.json()) def reset_metadata(self, repository: HasRepositoryId) -> ResetMetadataOnRepositoryResponse: repository_id = self._repository_id(repository) diff --git a/test/unit/data/test_bco_utils.py b/test/unit/data/test_bco_utils.py index f5233309d7c..bd2a44c24be 100644 --- a/test/unit/data/test_bco_utils.py +++ b/test/unit/data/test_bco_utils.py @@ -54,7 +54,7 @@ def example_bc_core_object() -> BioComputeObjectCore: email="normal@example.com", orcid="http://orcid.org/0000-0002-1825-0097", ) - parametric_domain = ParametricDomain(__root__=[]) + parametric_domain = ParametricDomain(root=[]) provenance_domain = ProvenanceDomain( name="workflow_name", version="workflow_version.0", @@ -64,7 +64,7 @@ def example_bc_core_object() -> BioComputeObjectCore: contributors=[contributor], license="MIT", ) - usability_domain = UsabilityDomain(__root__=["workflow annotation"]) + usability_domain = UsabilityDomain(root=["workflow annotation"]) gx_extension_domains = extension_domains( galaxy_url="https://usegalaxy.org", galaxy_version="22.05.0",