From c6c0605797436095577c4cfb85b65ff53de4d53e Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sun, 13 Jun 2021 02:34:19 +0100 Subject: [PATCH] Release 0.16.0 Also: docs fixes. --- CHANGELOG.md | 69 +++++++++++++++++-- bioblend/__init__.py | 2 +- .../galaxy/dataset_collections/__init__.py | 19 ++--- bioblend/galaxy/datasets/__init__.py | 2 + bioblend/galaxy/invocations/__init__.py | 29 ++++---- bioblend/galaxy/jobs/__init__.py | 1 + bioblend/galaxy/objects/wrappers.py | 2 +- bioblend/galaxy/tool_dependencies/__init__.py | 7 +- docs/api_docs/galaxy/all.rst | 14 ++++ 9 files changed, 109 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4345f9273..0800b2c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ -### BioBlend v - unreleased +### BioBlend v0.16.0 - 2021-06-13 * Added support for Galaxy release 21.05. +* Replaced the ``job_info`` parameter with separate ``tool_id``, ``inputs`` and + ``state`` parameters in ``JobsClient.search_jobs()`` (thanks to + [rikeshi](https://github.com/rikeshi)). + * Pass the API key for all requests as the ``x-api-key`` header instead of as a parameter (thanks to [rikeshi](https://github.com/rikeshi)). +* Try prepending https:// and http:// if the scheme is missing in the ``url`` + parameter of ``GalaxyClient``, i.e. when initialising a Galaxy or ToolShed + instance. + * Added a new ``dataset_collections`` attribute to ``GalaxyInstance`` objects, which is an instance of the new ``DatasetCollectionClient``. This new module can be used to get details of a dataset collection, wait until elements of a @@ -16,24 +24,73 @@ can be used to summarize requirements across toolbox (thanks to [cat-bro](https://github.com/cat-bro)). -* Added ``publish_dataset()`` and ``update_permissions()`` methods to - ``DatasetClient``. +* Added ``publish_dataset()`` ``update_permissions()`` and +``wait_for_dataset()`` methods to ``DatasetClient``. * Added ``get_invocation_biocompute_object()``, ``get_invocation_report_pdf()``, - ``get_invocation_step_jobs_summary()`` methods to ``InvocationClient`` (thanks - to [rikeshi](https://github.com/rikeshi)). + ``get_invocation_step_jobs_summary()``, ``rerun_invocation()`` and + ``wait_for_invocation()`` methods to ``InvocationClient`` (thanks to + [rikeshi](https://github.com/rikeshi)). + +* Added ``cancel_job()``, ``get_common_problems()``, + ``get_destination_params()``, ``get_inputs()``, ``get_outputs()``, + ``resume_job()``, ``show_job_lock()``, ``update_job_lock()`` and + ``wait_for_job()`` methods to ``JobsClient`` (thanks to + [Andrew Mcgregor](https://github.com/Mcgregor381) and + [rikeshi](https://github.com/rikeshi)). + +* Added ``get_citations()`` and ``uninstall_dependencies()`` methods to + ``ToolClient`` (thanks to [rikeshi](https://github.com/rikeshi)). + +* Added ``extract_workflow_from_history()``, ``refactor_workflow()`` and + ``show_versions()`` methods to ``WorkflowClient`` (thanks to + [rikeshi](https://github.com/rikeshi)). * Added several parameters to ``DatasetClient.get_datasets()`` method (thanks to [rikeshi](https://github.com/rikeshi)). +* Added several parameters to ``InvocationClient.get_invocations()`` method + (thanks to [Nolan Woods](https://github.com/innovate-invent) and + [rikeshi](https://github.com/rikeshi)). + +* Added several parameters to ``JobsClient.get_jobs()`` method (thanks to + [rikeshi](https://github.com/rikeshi)). + +* Added ``parameters_normalized`` parameter to + ``WorkflowClient.invoke_workflow()`` method (thanks to + [rikeshi](https://github.com/rikeshi)). + +* Deprecated ``folder_id`` parameter of ``LibraryClient.get_folders()`` method. + +* Deprecated ``library_id`` parameter of ``LibraryClient.get_libraries()`` + method. + +* Deprecated ``tool_id`` parameter of ``ToolClient.get_tools()`` method. + +* Deprecated ``workflow_id`` parameter of ``WorkflowClient.get_workflows()`` + method. + * BioBlend.objects: Removed deprecated ``container_id`` property of ``Dataset`` and ``Folder`` objects. +* BioBlend.objects: Removed ``Preview`` abstract class. + +* BioBlend.objects: Added ``invoke()`` method to ``Workflow``. Added + ``ObjInvocationClient``, and ``Invocation`` and ``InvocationPreview`` wrappers + (thanks to [rikeshi](https://github.com/rikeshi)). + +* BioBlend.objects: Added ``latest_workflow_uuid`` property to ``Workflow`` + objects. Added ``deleted``, ``latest_workflow_uuid``, ``number_of_steps``, + ``owner`` and ``show_in_tool_panel`` properties to ``WorkflowPreview`` (thanks + to [Nolan Woods](https://github.com/innovate-invent)). + +* BioBlend.objects: Deprecated ``run()`` method of ``Workflow``. + * Added ``use_ssl``, ``verify`` and ``authuser`` parameters to ``CloudManInstance.__init__()`` (thanks to [Nathan Edwards](https://github.com/edwardsnj)). -* Improvements to tests and documentation (thanks to +* Improvements to type annotations, tests and documentation (thanks to [rikeshi](https://github.com/rikeshi)). ### BioBlend v0.15.0 - 2021-02-10 diff --git a/bioblend/__init__.py b/bioblend/__init__.py index aaf6f8e86..6657e2020 100644 --- a/bioblend/__init__.py +++ b/bioblend/__init__.py @@ -7,7 +7,7 @@ ) # Current version of the library -__version__ = '0.15.0' +__version__ = '0.16.0' # default chunk size (in bytes) for reading remote data try: diff --git a/bioblend/galaxy/dataset_collections/__init__.py b/bioblend/galaxy/dataset_collections/__init__.py index 4c1b78e46..786010eba 100644 --- a/bioblend/galaxy/dataset_collections/__init__.py +++ b/bioblend/galaxy/dataset_collections/__init__.py @@ -86,15 +86,6 @@ def __init__(self, name, id): )) -__all__ = ( - "CollectionDescription", - "CollectionElement", - "HistoryDatasetElement", - "HistoryDatasetCollectionElement", - "LibraryDatasetElement", -) - - class DatasetCollectionClient(Client): module = 'dataset_collections' @@ -217,3 +208,13 @@ def wait_for_dataset_collection(self, dataset_collection_id: str, maxwait: float class DatasetCollectionTimeoutException(TimeoutException): pass + + +__all__ = ( + "CollectionDescription", + "CollectionElement", + "DatasetCollectionClient", + "HistoryDatasetElement", + "HistoryDatasetCollectionElement", + "LibraryDatasetElement", +) diff --git a/bioblend/galaxy/datasets/__init__.py b/bioblend/galaxy/datasets/__init__.py index 31dbd8b8b..0c4446250 100644 --- a/bioblend/galaxy/datasets/__init__.py +++ b/bioblend/galaxy/datasets/__init__.py @@ -310,6 +310,7 @@ def publish_dataset(self, dataset_id: str, published: bool = False): :rtype: dict :return: Current roles for all available permission types. + .. note:: This method can only be used with Galaxy ``release_19.05`` or later. """ @@ -338,6 +339,7 @@ def update_permissions(self, dataset_id: str, access_ids: Optional[list] = None, :rtype: dict :return: Current roles for all available permission types. + .. note:: This method can only be used with Galaxy ``release_19.05`` or later. """ diff --git a/bioblend/galaxy/invocations/__init__.py b/bioblend/galaxy/invocations/__init__.py index d7378a2ad..b02e13c9e 100644 --- a/bioblend/galaxy/invocations/__init__.py +++ b/bioblend/galaxy/invocations/__init__.py @@ -321,22 +321,19 @@ def get_invocation_step_jobs_summary(self, invocation_id): :rtype: list of dicts :return: The invocation step jobs summary. For example:: - [ - {'populated_state': 'ok', - 'states': {'ok': 1}, - 'model': 'Job', - 'id': 'e85a3be143d5905b'}, - - {'populated_state': 'ok', - 'states': {'running': 1}, - 'model': 'Job', - 'id': 'c9468fdb6dc5c5f1'} - - {'populated_state': 'ok', - 'states': {'new': 1}, - 'model': 'Job', - 'id': '2a56795cad3c7db3'} - ] + + [{'id': 'e85a3be143d5905b', + 'model': 'Job', + 'populated_state': 'ok', + 'states': {'ok': 1}}, + {'id': 'c9468fdb6dc5c5f1', + 'model': 'Job', + 'populated_state': 'ok', + 'states': {'running': 1}}, + {'id': '2a56795cad3c7db3', + 'model': 'Job', + 'populated_state': 'ok', + 'states': {'new': 1}}] """ url = self._make_url(invocation_id) + '/step_jobs_summary' return self._get(url=url) diff --git a/bioblend/galaxy/jobs/__init__.py b/bioblend/galaxy/jobs/__init__.py index a04022b6e..d2778facf 100644 --- a/bioblend/galaxy/jobs/__init__.py +++ b/bioblend/galaxy/jobs/__init__.py @@ -193,6 +193,7 @@ def rerun_job(self, job_id, remap=False, tool_inputs_update=None, history_id=Non :rtype: dict :return: Information about outputs and the rerun job + .. note:: This method can only be used with Galaxy ``release_21.01`` or later. """ diff --git a/bioblend/galaxy/objects/wrappers.py b/bioblend/galaxy/objects/wrappers.py index 049cae9cd..f719fec77 100644 --- a/bioblend/galaxy/objects/wrappers.py +++ b/bioblend/galaxy/objects/wrappers.py @@ -172,7 +172,7 @@ def __init__(self, step_dict, parent): class InvocationStep(Wrapper): """ - Abstract base class for invocation steps. + Invocation step. """ BASE_ATTRS = Wrapper.BASE_ATTRS + ( 'action', diff --git a/bioblend/galaxy/tool_dependencies/__init__.py b/bioblend/galaxy/tool_dependencies/__init__.py index e15184a76..d33a10013 100644 --- a/bioblend/galaxy/tool_dependencies/__init__.py +++ b/bioblend/galaxy/tool_dependencies/__init__.py @@ -32,12 +32,12 @@ def summarize_toolbox(self, index=None, tool_ids=None, resolver_type=None, inclu :type index_by: str :param index_by: By default results are grouped by requirements. Set to 'tools' - to return one entry per tool. + to return one entry per tool. :rtype: list of dicts :returns: dictified descriptions of the dependencies, with attribute - `dependency_type: None` if no match was found. - For example:: + `dependency_type: None` if no match was found. + For example:: [{'requirements': [{'name': 'galaxy_sequence_utils', 'specs': [], @@ -60,6 +60,7 @@ def summarize_toolbox(self, index=None, tool_ids=None, resolver_type=None, inclu 'name': 'bx-python', 'version': '0.8.6'}], 'tool_ids': ['vcf_to_maf_customtrack1']}] + .. note:: This method can only be used with Galaxy ``release_20.01`` or later and requires the user to be an admin. It relies on an experimental API particularly tied to diff --git a/docs/api_docs/galaxy/all.rst b/docs/api_docs/galaxy/all.rst index a6635b2ca..5af4a14e9 100644 --- a/docs/api_docs/galaxy/all.rst +++ b/docs/api_docs/galaxy/all.rst @@ -27,6 +27,13 @@ Datasets ----- +Dataset collections +------------------- + +.. automodule:: bioblend.galaxy.dataset_collections + +----- + Datatypes --------- @@ -123,6 +130,13 @@ Tool data tables ----- +Tool dependencies +----------------- + +.. automodule:: bioblend.galaxy.tool_dependencies + +----- + ToolShed --------