Skip to content

Commit bdf7a10

Browse files
committed
Release 1.1.0
Also: - Using the deprecated ``folder_id`` parameter of the ``LibraryClient.get_folders()`` method now raises a ``ValueError`` exception. - Using the deprecated ``library_id`` parameter of the ``LibraryClient.get_libraries()`` method now raises a ``ValueError`` exception. - Using the deprecated ``tool_id`` parameter of the ``ToolClient.get_tools()`` method now raises a ``ValueError`` exception. - Using the deprecated ``workflow_id`` parameter of the ``WorkflowClient.get_workflows()`` method now raises a ``ValueError`` exception.
1 parent 14651cb commit bdf7a10

File tree

5 files changed

+46
-69
lines changed

5 files changed

+46
-69
lines changed

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
### BioBlend v
1+
### BioBlend v1.1.0 - 2023-02-21
22

33
* Added support for Python 3.11. Added support for Galaxy release 23.0.
44

5+
* Using the deprecated ``folder_id`` parameter of the
6+
``LibraryClient.get_folders()`` method now raises a ``ValueError`` exception.
7+
8+
* Using the deprecated ``library_id`` parameter of the
9+
``LibraryClient.get_libraries()`` method now raises a ``ValueError``
10+
exception.
11+
12+
* Using the deprecated ``tool_id`` parameter of the ``ToolClient.get_tools()``
13+
method now raises a ``ValueError`` exception.
14+
15+
* Using the deprecated ``workflow_id`` parameter of the
16+
``WorkflowClient.get_workflows()`` method now raises a ``ValueError``
17+
exception.
18+
519
* Modified ``delete_workflow()`` method of ``WorkflowClient`` to return
620
``None`` instead of a string.
721

8-
* Improvements to tests
22+
* Add ``py.typed`` marker file to distributed packages (as per PEP 561) to
23+
declare type checking support.
24+
25+
* Improvements to tests and documentation.
926

1027
### BioBlend v1.0.0 - 2022-10-13
1128

bioblend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414

1515
# Current version of the library
16-
__version__ = "1.0.0"
16+
__version__ = "1.0.1"
1717

1818
# default chunk size (in bytes) for reading remote data
1919
try:

bioblend/galaxy/libraries/__init__.py

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
import logging
55
import time
6-
import warnings
76
from typing import (
87
Any,
98
Dict,
@@ -280,33 +279,24 @@ def get_folders(
280279
:type library_id: str
281280
:param library_id: library id to use
282281
283-
:type folder_id: str
284-
:param folder_id: filter for folder by folder id
285-
286-
.. deprecated:: 0.16.0
287-
To get details of a folder for which you know the ID, use the much
288-
more efficient :meth:`show_folder` instead.
289-
290282
:type name: str
291283
:param name: Folder name to filter on. For ``name`` specify the full
292284
path of the folder starting from the library's root
293285
folder, e.g. ``/subfolder/subsubfolder``.
294286
295287
:rtype: list
296288
:return: list of dicts each containing basic information about a folder
289+
290+
.. versionchanged:: 1.1.0
291+
Using the deprecated ``folder_id`` parameter now raises a
292+
``ValueError`` exception.
297293
"""
298294
if folder_id is not None:
299-
warnings.warn(
300-
"The folder_id parameter is deprecated, use the show_folder() method to view details of a folder for which you know the ID.",
301-
category=FutureWarning,
295+
raise ValueError(
296+
"The folder_id parameter has been removed, use the show_folder() method to view details of a folder for which you know the ID."
302297
)
303-
if folder_id is not None and name is not None:
304-
raise ValueError("Provide only one argument between name or folder_id, but not both")
305298
library_contents = self.show_library(library_id=library_id, contents=True)
306-
if folder_id is not None:
307-
folder = next((_ for _ in library_contents if _["type"] == "folder" and _["id"] == folder_id), None)
308-
folders = [folder] if folder is not None else []
309-
elif name is not None:
299+
if name is not None:
310300
folders = [_ for _ in library_contents if _["type"] == "folder" and _["name"] == name]
311301
else:
312302
folders = [_ for _ in library_contents if _["type"] == "folder"]
@@ -319,13 +309,6 @@ def get_libraries(
319309
Get all libraries, or select a subset by specifying optional arguments
320310
for filtering (e.g. a library name).
321311
322-
:type library_id: str
323-
:param library_id: filter for library by library id
324-
325-
.. deprecated:: 0.16.0
326-
To get details of a library for which you know the ID, use the much
327-
more efficient :meth:`show_library` instead.
328-
329312
:type name: str
330313
:param name: Library name to filter on.
331314
@@ -336,18 +319,16 @@ def get_libraries(
336319
337320
:rtype: list
338321
:return: list of dicts each containing basic information about a library
322+
323+
.. versionchanged:: 1.1.0
324+
Using the deprecated ``library_id`` parameter now raises a
325+
``ValueError`` exception.
339326
"""
340327
if library_id is not None:
341-
warnings.warn(
342-
"The library_id parameter is deprecated, use the show_library() method to view details of a library for which you know the ID.",
343-
category=FutureWarning,
328+
raise ValueError(
329+
"The library_id parameter has been removed, use the show_library() method to view details of a library for which you know the ID."
344330
)
345-
if library_id is not None and name is not None:
346-
raise ValueError("Provide only one argument between name or library_id, but not both")
347331
libraries = self._get(params={"deleted": deleted})
348-
if library_id is not None:
349-
library = next((_ for _ in libraries if _["id"] == library_id), None)
350-
libraries = [library] if library is not None else []
351332
if name is not None:
352333
libraries = [_ for _ in libraries if _["name"] == name]
353334
return libraries

bioblend/galaxy/tools/__init__.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Contains possible interaction dealing with Galaxy tools.
33
"""
4-
import warnings
54
from os.path import basename
65
from typing import (
76
Any,
@@ -37,13 +36,6 @@ def get_tools(
3736
Get all tools, or select a subset by specifying optional arguments for
3837
filtering (e.g. a tool name).
3938
40-
:type tool_id: str
41-
:param tool_id: id of the requested tool
42-
43-
.. deprecated:: 0.16.0
44-
To get details of a tool for which you know the ID, use the much
45-
more efficient :meth:`show_tool` instead.
46-
4739
:type name: str
4840
:param name: Tool name to filter on.
4941
@@ -55,19 +47,17 @@ def get_tools(
5547
:return: List of tool descriptions.
5648
5749
.. seealso:: bioblend.galaxy.toolshed.get_repositories()
50+
51+
.. versionchanged:: 1.1.0
52+
Using the deprecated ``tool_id`` parameter now raises a
53+
``ValueError`` exception.
5854
"""
5955
if tool_id is not None:
60-
warnings.warn(
61-
"The tool_id parameter is deprecated, use the show_tool() method to view details of a tool for which you know the ID.",
62-
category=FutureWarning,
56+
raise ValueError(
57+
"The tool_id parameter has been removed, use the show_tool() method to view details of a tool for which you know the ID."
6358
)
64-
if tool_id is not None and name is not None:
65-
raise ValueError("Provide only one argument between name or tool_id, but not both")
6659
tools = self._raw_get_tool(in_panel=False, trackster=trackster)
67-
if tool_id is not None:
68-
tool = next((_ for _ in tools if _["id"] == tool_id), None)
69-
tools = [tool] if tool is not None else []
70-
elif name is not None:
60+
if name is not None:
7161
tools = [_ for _ in tools if _["name"] == name]
7262
return tools
7363

bioblend/galaxy/workflows/__init__.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
import json
55
import os
6-
import warnings
76
from typing import (
87
Any,
98
Dict,
@@ -36,13 +35,6 @@ def get_workflows(
3635
Get all workflows, or select a subset by specifying optional arguments
3736
for filtering (e.g. a workflow name).
3837
39-
:type workflow_id: str
40-
:param workflow_id: Encoded workflow ID
41-
42-
.. deprecated:: 0.16.0
43-
To get details of a workflow for which you know the ID, use the
44-
much more efficient :meth:`show_workflow` instead.
45-
4638
:type name: str
4739
:param name: Workflow name to filter on.
4840
@@ -57,22 +49,19 @@ def get_workflows(
5749
'name': 'Simple',
5850
'url': '/api/workflows/92c56938c2f9b315'}]
5951
52+
.. versionchanged:: 1.1.0
53+
Using the deprecated ``workflow_id`` parameter now raises a
54+
``ValueError`` exception.
6055
"""
6156
if workflow_id is not None:
62-
warnings.warn(
63-
"The workflow_id parameter is deprecated, use the show_workflow() method to view details of a workflow for which you know the ID.",
64-
category=FutureWarning,
57+
raise ValueError(
58+
"The workflow_id parameter has been removed, use the show_workflow() method to view details of a workflow for which you know the ID."
6559
)
66-
if workflow_id is not None and name is not None:
67-
raise ValueError("Provide only one argument between name or workflow_id, but not both")
6860
params: Dict[str, Any] = {}
6961
if published:
7062
params["show_published"] = True
7163
workflows = self._get(params=params)
72-
if workflow_id is not None:
73-
workflow = next((_ for _ in workflows if _["id"] == workflow_id), None)
74-
workflows = [workflow] if workflow is not None else []
75-
elif name is not None:
64+
if name is not None:
7665
workflows = [_ for _ in workflows if _["name"] == name]
7766
return workflows
7867

0 commit comments

Comments
 (0)