diff --git a/bioblend/_tests/TestGalaxyGroups.py b/bioblend/_tests/TestGalaxyGroups.py index f0fa80565..dc0fd07a7 100644 --- a/bioblend/_tests/TestGalaxyGroups.py +++ b/bioblend/_tests/TestGalaxyGroups.py @@ -1,6 +1,7 @@ """ WARNING: only admins can operate on groups! """ + import uuid from . import GalaxyTestBase diff --git a/bioblend/_tests/TestGalaxyHistories.py b/bioblend/_tests/TestGalaxyHistories.py index 9c21b1ba2..6dff33588 100644 --- a/bioblend/_tests/TestGalaxyHistories.py +++ b/bioblend/_tests/TestGalaxyHistories.py @@ -1,5 +1,6 @@ """ """ + import os import shutil import tarfile diff --git a/bioblend/_tests/TestGalaxyInstance.py b/bioblend/_tests/TestGalaxyInstance.py index 54b67d343..51462368a 100644 --- a/bioblend/_tests/TestGalaxyInstance.py +++ b/bioblend/_tests/TestGalaxyInstance.py @@ -1,6 +1,7 @@ """ Tests on the GalaxyInstance object itself. """ + import os import time import unittest diff --git a/bioblend/_tests/TestGalaxyToolContainerResolution.py b/bioblend/_tests/TestGalaxyToolContainerResolution.py index 3f8015739..32395f839 100644 --- a/bioblend/_tests/TestGalaxyToolContainerResolution.py +++ b/bioblend/_tests/TestGalaxyToolContainerResolution.py @@ -1,6 +1,7 @@ """ Test functions in bioblend.galaxy.container_resolution """ + from . import ( GalaxyTestBase, test_util, diff --git a/bioblend/_tests/TestGalaxyToolDependencies.py b/bioblend/_tests/TestGalaxyToolDependencies.py index 08d34d5e3..e521c714a 100644 --- a/bioblend/_tests/TestGalaxyToolDependencies.py +++ b/bioblend/_tests/TestGalaxyToolDependencies.py @@ -1,6 +1,7 @@ """ Test functions in bioblend.galaxy.tool_dependencies """ + from . import ( GalaxyTestBase, test_util, diff --git a/bioblend/_tests/TestGalaxyTools.py b/bioblend/_tests/TestGalaxyTools.py index 1ff25b8ca..722dcfa2d 100644 --- a/bioblend/_tests/TestGalaxyTools.py +++ b/bioblend/_tests/TestGalaxyTools.py @@ -1,5 +1,6 @@ """ """ + import os from typing import ( Any, diff --git a/bioblend/_tests/test_util.py b/bioblend/_tests/test_util.py index de0bed93b..5cb584fd4 100644 --- a/bioblend/_tests/test_util.py +++ b/bioblend/_tests/test_util.py @@ -1,5 +1,6 @@ """ General support infrastructure not tied to any particular test. """ + import os import random import string diff --git a/bioblend/galaxy/__init__.py b/bioblend/galaxy/__init__.py index 2985bcd32..8c5a652fb 100644 --- a/bioblend/galaxy/__init__.py +++ b/bioblend/galaxy/__init__.py @@ -1,6 +1,7 @@ """ A base representation of an instance of Galaxy """ + from typing import Optional from bioblend.galaxy import ( diff --git a/bioblend/galaxy/config/__init__.py b/bioblend/galaxy/config/__init__.py index 1d2363fd5..3418d7d35 100644 --- a/bioblend/galaxy/config/__init__.py +++ b/bioblend/galaxy/config/__init__.py @@ -2,6 +2,7 @@ Contains possible interaction dealing with Galaxy configuration. """ + from typing import TYPE_CHECKING from bioblend.galaxy.client import Client diff --git a/bioblend/galaxy/container_resolution/__init__.py b/bioblend/galaxy/container_resolution/__init__.py index c39d81eba..ae3011de0 100644 --- a/bioblend/galaxy/container_resolution/__init__.py +++ b/bioblend/galaxy/container_resolution/__init__.py @@ -2,6 +2,7 @@ Contains interactions dealing with Galaxy container resolvers. Works only with Galaxy > 22.01 """ + from typing import ( List, Optional, diff --git a/bioblend/galaxy/datasets/__init__.py b/bioblend/galaxy/datasets/__init__.py index fd3c1cfba..4ced347ee 100644 --- a/bioblend/galaxy/datasets/__init__.py +++ b/bioblend/galaxy/datasets/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Datasets """ + import logging import os import shlex @@ -99,8 +100,7 @@ def download_dataset( use_default_filename: bool = True, require_ok_state: bool = True, maxwait: float = 12000, - ) -> bytes: - ... + ) -> bytes: ... @overload def download_dataset( @@ -110,8 +110,7 @@ def download_dataset( use_default_filename: bool = True, require_ok_state: bool = True, maxwait: float = 12000, - ) -> str: - ... + ) -> str: ... def download_dataset( self, diff --git a/bioblend/galaxy/datatypes/__init__.py b/bioblend/galaxy/datatypes/__init__.py index 9998e37ff..87b87f198 100644 --- a/bioblend/galaxy/datatypes/__init__.py +++ b/bioblend/galaxy/datatypes/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Datatype """ + from typing import ( Dict, List, diff --git a/bioblend/galaxy/folders/__init__.py b/bioblend/galaxy/folders/__init__.py index 7e0ea88e1..99f1c5bde 100644 --- a/bioblend/galaxy/folders/__init__.py +++ b/bioblend/galaxy/folders/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy library folders """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/forms/__init__.py b/bioblend/galaxy/forms/__init__.py index ab39eae22..1de54abfc 100644 --- a/bioblend/galaxy/forms/__init__.py +++ b/bioblend/galaxy/forms/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Forms """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/ftpfiles/__init__.py b/bioblend/galaxy/ftpfiles/__init__.py index b00a5a639..348f2cdff 100644 --- a/bioblend/galaxy/ftpfiles/__init__.py +++ b/bioblend/galaxy/ftpfiles/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy FTP Files """ + from typing import ( List, TYPE_CHECKING, diff --git a/bioblend/galaxy/genomes/__init__.py b/bioblend/galaxy/genomes/__init__.py index 0eb91a21a..2f5089cd4 100644 --- a/bioblend/galaxy/genomes/__init__.py +++ b/bioblend/galaxy/genomes/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Histories """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/groups/__init__.py b/bioblend/galaxy/groups/__init__.py index 60a48a3c0..80194d70d 100644 --- a/bioblend/galaxy/groups/__init__.py +++ b/bioblend/galaxy/groups/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Groups """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/histories/__init__.py b/bioblend/galaxy/histories/__init__.py index f5b95a1ae..4fac2b195 100644 --- a/bioblend/galaxy/histories/__init__.py +++ b/bioblend/galaxy/histories/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Histories """ + import logging import re import sys @@ -270,8 +271,7 @@ def show_history( self, history_id: str, contents: Literal[False] = False, - ) -> Dict[str, Any]: - ... + ) -> Dict[str, Any]: ... @overload def show_history( @@ -282,8 +282,7 @@ def show_history( visible: Optional[bool] = None, details: Optional[str] = None, types: Optional[List[str]] = None, - ) -> List[Dict[str, Any]]: - ... + ) -> List[Dict[str, Any]]: ... # Fallback in case the caller provides a regular bool as contents @overload diff --git a/bioblend/galaxy/invocations/__init__.py b/bioblend/galaxy/invocations/__init__.py index f13aa330c..fa6e023ab 100644 --- a/bioblend/galaxy/invocations/__init__.py +++ b/bioblend/galaxy/invocations/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy workflow invocations """ + import logging import time from typing import ( diff --git a/bioblend/galaxy/jobs/__init__.py b/bioblend/galaxy/jobs/__init__.py index 1fa37447a..c90b04ce4 100644 --- a/bioblend/galaxy/jobs/__init__.py +++ b/bioblend/galaxy/jobs/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Jobs """ + import logging import time from typing import ( diff --git a/bioblend/galaxy/libraries/__init__.py b/bioblend/galaxy/libraries/__init__.py index 530c7aeed..eb89ff157 100644 --- a/bioblend/galaxy/libraries/__init__.py +++ b/bioblend/galaxy/libraries/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Data Libraries """ + import logging import time from typing import ( diff --git a/bioblend/galaxy/objects/client.py b/bioblend/galaxy/objects/client.py index 7b50f1ba0..f7a53c6dd 100644 --- a/bioblend/galaxy/objects/client.py +++ b/bioblend/galaxy/objects/client.py @@ -4,6 +4,7 @@ Classes in this module should not be instantiated directly, but used via their handles in :class:`~.galaxy_instance.GalaxyInstance`. """ + import abc import json from collections.abc import Sequence @@ -498,12 +499,10 @@ class ObjDatasetClient(ObjClient): """ @overload - def get(self, id_: str, hda_ldda: Literal["hda"] = "hda") -> wrappers.HistoryDatasetAssociation: - ... + def get(self, id_: str, hda_ldda: Literal["hda"] = "hda") -> wrappers.HistoryDatasetAssociation: ... @overload - def get(self, id_: str, hda_ldda: Literal["ldda"]) -> wrappers.LibraryDatasetDatasetAssociation: - ... + def get(self, id_: str, hda_ldda: Literal["ldda"]) -> wrappers.LibraryDatasetDatasetAssociation: ... def get(self, id_: str, hda_ldda: HdaLdda = "hda") -> wrappers.Dataset: """ diff --git a/bioblend/galaxy/roles/__init__.py b/bioblend/galaxy/roles/__init__.py index bee93edc3..06f4cf025 100644 --- a/bioblend/galaxy/roles/__init__.py +++ b/bioblend/galaxy/roles/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Roles """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/tool_data/__init__.py b/bioblend/galaxy/tool_data/__init__.py index 0957cd4b9..cb47f94cf 100644 --- a/bioblend/galaxy/tool_data/__init__.py +++ b/bioblend/galaxy/tool_data/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Tool data tables """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/tool_dependencies/__init__.py b/bioblend/galaxy/tool_dependencies/__init__.py index c25eebbe6..f772613db 100644 --- a/bioblend/galaxy/tool_dependencies/__init__.py +++ b/bioblend/galaxy/tool_dependencies/__init__.py @@ -1,6 +1,7 @@ """ Contains interactions dealing with Galaxy dependency resolvers. """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/tools/__init__.py b/bioblend/galaxy/tools/__init__.py index d3f6b1b1d..5ff93e5b1 100644 --- a/bioblend/galaxy/tools/__init__.py +++ b/bioblend/galaxy/tools/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interaction dealing with Galaxy tools. """ + from os.path import basename from typing import ( Any, diff --git a/bioblend/galaxy/users/__init__.py b/bioblend/galaxy/users/__init__.py index f772a2ef6..c39a65a82 100644 --- a/bioblend/galaxy/users/__init__.py +++ b/bioblend/galaxy/users/__init__.py @@ -3,6 +3,7 @@ Most of these methods must be executed by a registered Galaxy admin user. """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/visual/__init__.py b/bioblend/galaxy/visual/__init__.py index 38c27bfad..3d168b223 100644 --- a/bioblend/galaxy/visual/__init__.py +++ b/bioblend/galaxy/visual/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy visualization """ + from typing import ( Any, Dict, diff --git a/bioblend/galaxy/workflows/__init__.py b/bioblend/galaxy/workflows/__init__.py index b7c5f51d5..9c6bb7b86 100644 --- a/bioblend/galaxy/workflows/__init__.py +++ b/bioblend/galaxy/workflows/__init__.py @@ -1,6 +1,7 @@ """ Contains possible interactions with the Galaxy Workflows """ + import json import os from typing import ( diff --git a/bioblend/galaxyclient.py b/bioblend/galaxyclient.py index c33c4c831..6d58e0e37 100644 --- a/bioblend/galaxyclient.py +++ b/bioblend/galaxyclient.py @@ -5,6 +5,7 @@ should not use it directly. A base representation of an instance """ + import base64 import contextlib import json diff --git a/bioblend/toolshed/__init__.py b/bioblend/toolshed/__init__.py index 854f68528..4408864c4 100644 --- a/bioblend/toolshed/__init__.py +++ b/bioblend/toolshed/__init__.py @@ -1,6 +1,7 @@ """ A base representation of an instance of Tool Shed """ + from typing import Optional from bioblend.galaxyclient import GalaxyClient diff --git a/bioblend/toolshed/categories/__init__.py b/bioblend/toolshed/categories/__init__.py index 222fadf5f..af55b3f0e 100644 --- a/bioblend/toolshed/categories/__init__.py +++ b/bioblend/toolshed/categories/__init__.py @@ -1,6 +1,7 @@ """ Interaction with a Tool Shed instance categories """ + from typing import ( Any, Dict, diff --git a/bioblend/toolshed/repositories/__init__.py b/bioblend/toolshed/repositories/__init__.py index 46e0fbd48..c00063830 100644 --- a/bioblend/toolshed/repositories/__init__.py +++ b/bioblend/toolshed/repositories/__init__.py @@ -1,6 +1,7 @@ """ Interaction with a Tool Shed instance repositories """ + from typing import ( Any, Dict, diff --git a/bioblend/toolshed/tools/__init__.py b/bioblend/toolshed/tools/__init__.py index 4ebe8564b..9b9cb0235 100644 --- a/bioblend/toolshed/tools/__init__.py +++ b/bioblend/toolshed/tools/__init__.py @@ -1,6 +1,7 @@ """ Interaction with a Tool Shed instance tools """ + from typing import ( Any, Dict, diff --git a/setup.cfg b/setup.cfg index 40c3cb3b7..0f6430dea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,8 +10,10 @@ exclude = build # E203 is whitespace before ':'; we follow black's formatting here. See https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated # E501 is line length, managed by black +# E701,E704 are multiple statements on one line; we follow black's formatting here. See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#configuration +# SFS3 is string literal formatting using f-strings # W503 is line breaks before binary operators, which has been reversed in PEP 8. -ignore = E203,E501,E741,SFS3,W503 +ignore = E203,E501,E701,E704,SFS3,W503 [metadata] author = Enis Afgan