From 5c05b65b74b83de8cddcaa9be4324b576c597f34 Mon Sep 17 00:00:00 2001 From: Alan Cleary Date: Thu, 16 Feb 2023 14:24:07 -0700 Subject: [PATCH] Applied isort pre-commit hook. --- chromosome/chromosome/__main__.py | 1 - chromosome/chromosome/commands.py | 3 ++- chromosome/chromosome/database.py | 1 - chromosome/chromosome/grpc_server.py | 8 ++++++-- chromosome/chromosome/proto/__init__.py | 1 - chromosome/setup.py | 1 - chromosome_region/chromosome_region/__main__.py | 1 - chromosome_region/chromosome_region/commands.py | 3 ++- chromosome_region/chromosome_region/database.py | 1 - .../chromosome_region/grpc_server.py | 8 ++++++-- .../chromosome_region/proto/__init__.py | 1 - chromosome_region/setup.py | 1 - chromosome_search/chromosome_search/__main__.py | 1 - chromosome_search/chromosome_search/commands.py | 3 ++- chromosome_search/chromosome_search/database.py | 1 - .../chromosome_search/grpc_server.py | 8 ++++++-- .../chromosome_search/proto/__init__.py | 1 - chromosome_search/setup.py | 1 - gene_search/gene_search/__main__.py | 1 - gene_search/gene_search/commands.py | 3 ++- gene_search/gene_search/database.py | 1 - gene_search/gene_search/grpc_server.py | 8 ++++++-- gene_search/gene_search/proto/__init__.py | 1 - gene_search/setup.py | 1 - genes/genes/__main__.py | 1 - genes/genes/commands.py | 3 ++- genes/genes/database.py | 1 - genes/genes/grpc_server.py | 8 ++++++-- genes/genes/proto/__init__.py | 1 - genes/genes/request_handler.py | 2 +- genes/setup.py | 1 - linkouts/linkouts/request_handler.py | 5 +++-- .../macro_synteny_blocks/__main__.py | 1 - .../macro_synteny_blocks/commands.py | 3 ++- .../macro_synteny_blocks/database.py | 1 - .../macro_synteny_blocks/grpc_client.py | 13 +++++++++++-- .../macro_synteny_blocks/grpc_server.py | 11 +++++++++-- .../macro_synteny_blocks/proto/__init__.py | 1 - macro_synteny_blocks/setup.py | 1 - .../micro_synteny_search/__main__.py | 1 - .../micro_synteny_search/commands.py | 3 ++- .../micro_synteny_search/database.py | 1 - .../micro_synteny_search/grpc_server.py | 11 +++++++++-- .../micro_synteny_search/proto/__init__.py | 1 - .../micro_synteny_search/request_handler.py | 3 ++- micro_synteny_search/setup.py | 1 - .../pairwise_macro_synteny_blocks/__main__.py | 1 - .../pairwise_macro_synteny_blocks/commands.py | 3 ++- .../pairwise_macro_synteny_blocks/database.py | 1 - .../pairwise_macro_synteny_blocks/grpc_server.py | 7 ++++++- .../pairwise_macro_synteny_blocks/metrics.py | 2 +- .../proto/__init__.py | 1 - pairwise_macro_synteny_blocks/setup.py | 1 - redis_loader/redis_loader/loaders/gff.py | 4 ++-- redis_loader/redis_loader/loaders/redisearch.py | 1 - redis_loader/setup.py | 1 - search/search/__main__.py | 1 - search/search/commands.py | 3 ++- search/search/grpc_client.py | 16 ++++++++++------ search/search/grpc_server.py | 8 ++++++-- search/search/proto/__init__.py | 1 - search/search/request_handler.py | 2 +- search/setup.py | 1 - 63 files changed, 109 insertions(+), 79 deletions(-) diff --git a/chromosome/chromosome/__main__.py b/chromosome/chromosome/__main__.py index c798981b..b902a90f 100755 --- a/chromosome/chromosome/__main__.py +++ b/chromosome/chromosome/__main__.py @@ -17,7 +17,6 @@ from chromosome.http_server import run_http_server from chromosome.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/chromosome/chromosome/commands.py b/chromosome/chromosome/commands.py index c347ec6b..4995ebd9 100644 --- a/chromosome/chromosome/commands.py +++ b/chromosome/chromosome/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/chromosome/chromosome/database.py b/chromosome/chromosome/database.py index a9496968..105f95c7 100644 --- a/chromosome/chromosome/database.py +++ b/chromosome/chromosome/database.py @@ -4,7 +4,6 @@ # module import chromosome - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/chromosome/chromosome/grpc_server.py b/chromosome/chromosome/grpc_server.py index c1755c07..9527b3de 100644 --- a/chromosome/chromosome/grpc_server.py +++ b/chromosome/chromosome/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from chromosome.proto.chromosome_service.v1 import chromosome_pb2 # from chromosome.proto.chromosome_service.v1 import chromosome_pb2_grpc # from chromosome.proto.track.v1 import track_pb2 @@ -10,10 +13,11 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from chromosome import proto # noqa: F401 -from chromosome_service.v1 import chromosome_pb2 -from chromosome_service.v1 import chromosome_pb2_grpc +from chromosome_service.v1 import chromosome_pb2, chromosome_pb2_grpc from track.v1 import track_pb2 +# isort: on + class Chromosome(chromosome_pb2_grpc.ChromosomeServicer): def __init__(self, handler): diff --git a/chromosome/chromosome/proto/__init__.py b/chromosome/chromosome/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/chromosome/chromosome/proto/__init__.py +++ b/chromosome/chromosome/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/chromosome/setup.py b/chromosome/setup.py index 33d9477a..77dbcd18 100644 --- a/chromosome/setup.py +++ b/chromosome/setup.py @@ -7,7 +7,6 @@ # package from chromosome import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/chromosome_region/chromosome_region/__main__.py b/chromosome_region/chromosome_region/__main__.py index 6f3c582e..b50e1105 100755 --- a/chromosome_region/chromosome_region/__main__.py +++ b/chromosome_region/chromosome_region/__main__.py @@ -17,7 +17,6 @@ from chromosome_region.http_server import run_http_server from chromosome_region.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/chromosome_region/chromosome_region/commands.py b/chromosome_region/chromosome_region/commands.py index 7969044e..af3401ae 100644 --- a/chromosome_region/chromosome_region/commands.py +++ b/chromosome_region/chromosome_region/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/chromosome_region/chromosome_region/database.py b/chromosome_region/chromosome_region/database.py index 1bb96a79..9a5b08be 100644 --- a/chromosome_region/chromosome_region/database.py +++ b/chromosome_region/chromosome_region/database.py @@ -4,7 +4,6 @@ # module import chromosome_region - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/chromosome_region/chromosome_region/grpc_server.py b/chromosome_region/chromosome_region/grpc_server.py index ce249d71..61d70ce9 100644 --- a/chromosome_region/chromosome_region/grpc_server.py +++ b/chromosome_region/chromosome_region/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from chromosome_region.proto.chromosomeregion_service.v1 import chromosomeregion_pb2 # from chromosome_region.proto.chromosomeregion_service.v1 # import chromosomeregion_pb2_grpc @@ -11,10 +14,11 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from chromosome_region import proto # noqa: F401 -from chromosomeregion_service.v1 import chromosomeregion_pb2 -from chromosomeregion_service.v1 import chromosomeregion_pb2_grpc +from chromosomeregion_service.v1 import chromosomeregion_pb2, chromosomeregion_pb2_grpc from region.v1 import region_pb2 +# isort: on + class ChromosomeRegion(chromosomeregion_pb2_grpc.ChromosomeRegionServicer): def __init__(self, handler): diff --git a/chromosome_region/chromosome_region/proto/__init__.py b/chromosome_region/chromosome_region/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/chromosome_region/chromosome_region/proto/__init__.py +++ b/chromosome_region/chromosome_region/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/chromosome_region/setup.py b/chromosome_region/setup.py index de601688..fb84dfee 100644 --- a/chromosome_region/setup.py +++ b/chromosome_region/setup.py @@ -7,7 +7,6 @@ # package from chromosome_region import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/chromosome_search/chromosome_search/__main__.py b/chromosome_search/chromosome_search/__main__.py index 09b6fa4e..34748292 100755 --- a/chromosome_search/chromosome_search/__main__.py +++ b/chromosome_search/chromosome_search/__main__.py @@ -17,7 +17,6 @@ from chromosome_search.http_server import run_http_server from chromosome_search.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/chromosome_search/chromosome_search/commands.py b/chromosome_search/chromosome_search/commands.py index fb7aabf5..28c285b6 100644 --- a/chromosome_search/chromosome_search/commands.py +++ b/chromosome_search/chromosome_search/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/chromosome_search/chromosome_search/database.py b/chromosome_search/chromosome_search/database.py index b97e1e87..16d49e17 100644 --- a/chromosome_search/chromosome_search/database.py +++ b/chromosome_search/chromosome_search/database.py @@ -4,7 +4,6 @@ # module import chromosome_search - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/chromosome_search/chromosome_search/grpc_server.py b/chromosome_search/chromosome_search/grpc_server.py index d74ecce0..6115845b 100644 --- a/chromosome_search/chromosome_search/grpc_server.py +++ b/chromosome_search/chromosome_search/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from chromosome_search.proto.chromosomesearch_service.v1 import chromosomesearch_pb2 # from chromosome_search.proto.chromosomesearch_service.v1 # import chromosomesearch_pb2_grpc @@ -11,8 +14,9 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from chromosome_search import proto # noqa: F401 -from chromosomesearch_service.v1 import chromosomesearch_pb2 -from chromosomesearch_service.v1 import chromosomesearch_pb2_grpc +from chromosomesearch_service.v1 import chromosomesearch_pb2, chromosomesearch_pb2_grpc + +# isort: on class ChromosomeSearch(chromosomesearch_pb2_grpc.ChromosomeSearchServicer): diff --git a/chromosome_search/chromosome_search/proto/__init__.py b/chromosome_search/chromosome_search/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/chromosome_search/chromosome_search/proto/__init__.py +++ b/chromosome_search/chromosome_search/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/chromosome_search/setup.py b/chromosome_search/setup.py index 74866436..20a4c911 100644 --- a/chromosome_search/setup.py +++ b/chromosome_search/setup.py @@ -7,7 +7,6 @@ # package from chromosome_search import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/gene_search/gene_search/__main__.py b/gene_search/gene_search/__main__.py index 039834a9..2d46554c 100755 --- a/gene_search/gene_search/__main__.py +++ b/gene_search/gene_search/__main__.py @@ -17,7 +17,6 @@ from gene_search.http_server import run_http_server from gene_search.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/gene_search/gene_search/commands.py b/gene_search/gene_search/commands.py index 8737c77b..b4b12161 100644 --- a/gene_search/gene_search/commands.py +++ b/gene_search/gene_search/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/gene_search/gene_search/database.py b/gene_search/gene_search/database.py index 4ef8a2af..4b062c49 100644 --- a/gene_search/gene_search/database.py +++ b/gene_search/gene_search/database.py @@ -4,7 +4,6 @@ # module import gene_search - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/gene_search/gene_search/grpc_server.py b/gene_search/gene_search/grpc_server.py index a368fe50..6c042fe9 100644 --- a/gene_search/gene_search/grpc_server.py +++ b/gene_search/gene_search/grpc_server.py @@ -2,15 +2,19 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from gene_search.proto.genesearch_service.v1 import genesearch_pb2 # from gene_search.proto.genesearch_service.v1 import genesearch_pb2_grpc # NOTE: the following imports are a temporary workaround for a known protobuf # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from gene_search import proto # noqa: F401 -from genesearch_service.v1 import genesearch_pb2 -from genesearch_service.v1 import genesearch_pb2_grpc +from genesearch_service.v1 import genesearch_pb2, genesearch_pb2_grpc + +# isort: on class GeneSearch(genesearch_pb2_grpc.GeneSearchServicer): diff --git a/gene_search/gene_search/proto/__init__.py b/gene_search/gene_search/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/gene_search/gene_search/proto/__init__.py +++ b/gene_search/gene_search/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/gene_search/setup.py b/gene_search/setup.py index 7ec26f19..cfe0906a 100644 --- a/gene_search/setup.py +++ b/gene_search/setup.py @@ -6,7 +6,6 @@ # package from gene_search import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/genes/genes/__main__.py b/genes/genes/__main__.py index c7a23397..df3406ec 100755 --- a/genes/genes/__main__.py +++ b/genes/genes/__main__.py @@ -17,7 +17,6 @@ from genes.http_server import run_http_server from genes.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/genes/genes/commands.py b/genes/genes/commands.py index 03caa4a9..ab6a041f 100644 --- a/genes/genes/commands.py +++ b/genes/genes/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/genes/genes/database.py b/genes/genes/database.py index 7ad6b8a1..228c4f8e 100644 --- a/genes/genes/database.py +++ b/genes/genes/database.py @@ -4,7 +4,6 @@ # module import genes - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/genes/genes/grpc_server.py b/genes/genes/grpc_server.py index 464256a8..0bc491a3 100644 --- a/genes/genes/grpc_server.py +++ b/genes/genes/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from genes.proto.genes_service.v1 import genes_pb2 # from genes.proto.genes_service.v1 import genes_pb2_grpc # from genes.proto.gene.v1 import gene_pb2 @@ -10,10 +13,11 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from genes import proto # noqa: F401 -from genes_service.v1 import genes_pb2 -from genes_service.v1 import genes_pb2_grpc +from genes_service.v1 import genes_pb2, genes_pb2_grpc from gene.v1 import gene_pb2 +# isort: on + class Genes(genes_pb2_grpc.GenesServicer): def __init__(self, handler): diff --git a/genes/genes/proto/__init__.py b/genes/genes/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/genes/genes/proto/__init__.py +++ b/genes/genes/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/genes/genes/request_handler.py b/genes/genes/request_handler.py index fe992ff8..f2d47c70 100644 --- a/genes/genes/request_handler.py +++ b/genes/genes/request_handler.py @@ -1,7 +1,7 @@ # dependencies from redis.commands.search import AsyncSearch -from redis.commands.search.document import Document from redis.commands.search._util import to_string +from redis.commands.search.document import Document class RequestHandler: diff --git a/genes/setup.py b/genes/setup.py index 7d9ca843..e889ae71 100644 --- a/genes/setup.py +++ b/genes/setup.py @@ -7,7 +7,6 @@ # package from genes import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/linkouts/linkouts/request_handler.py b/linkouts/linkouts/request_handler.py index c20f5fff..ba212055 100644 --- a/linkouts/linkouts/request_handler.py +++ b/linkouts/linkouts/request_handler.py @@ -1,7 +1,8 @@ -import yaml +import glob import logging import re -import glob + +import yaml HREF = "href" METHOD = "method" diff --git a/macro_synteny_blocks/macro_synteny_blocks/__main__.py b/macro_synteny_blocks/macro_synteny_blocks/__main__.py index d81fbe30..d2d38025 100755 --- a/macro_synteny_blocks/macro_synteny_blocks/__main__.py +++ b/macro_synteny_blocks/macro_synteny_blocks/__main__.py @@ -17,7 +17,6 @@ from macro_synteny_blocks.http_server import run_http_server from macro_synteny_blocks.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/macro_synteny_blocks/macro_synteny_blocks/commands.py b/macro_synteny_blocks/macro_synteny_blocks/commands.py index a8e4b470..61694793 100644 --- a/macro_synteny_blocks/macro_synteny_blocks/commands.py +++ b/macro_synteny_blocks/macro_synteny_blocks/commands.py @@ -23,9 +23,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/macro_synteny_blocks/macro_synteny_blocks/database.py b/macro_synteny_blocks/macro_synteny_blocks/database.py index 1335f453..0faed845 100644 --- a/macro_synteny_blocks/macro_synteny_blocks/database.py +++ b/macro_synteny_blocks/macro_synteny_blocks/database.py @@ -4,7 +4,6 @@ # module import macro_synteny_blocks - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/macro_synteny_blocks/macro_synteny_blocks/grpc_client.py b/macro_synteny_blocks/macro_synteny_blocks/grpc_client.py index 7ae6b0a2..ad3d3857 100644 --- a/macro_synteny_blocks/macro_synteny_blocks/grpc_client.py +++ b/macro_synteny_blocks/macro_synteny_blocks/grpc_client.py @@ -1,10 +1,15 @@ # Python import logging +# isort: split + # dependencies from grpc.experimental import aio +# isort: split + # module +# isort: off # from macro_synteny_blocks.proto.pairwisemacrosyntenyblocks_service.v1 # import pairwisemacrosyntenyblocks_pb2 # from macro_synteny_blocks.proto.pairwisemacrosyntenyblocks_service.v1 @@ -13,8 +18,12 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from macro_synteny_blocks import proto # noqa: F401 -from pairwisemacrosyntenyblocks_service.v1 import pairwisemacrosyntenyblocks_pb2 -from pairwisemacrosyntenyblocks_service.v1 import pairwisemacrosyntenyblocks_pb2_grpc +from pairwisemacrosyntenyblocks_service.v1 import ( + pairwisemacrosyntenyblocks_pb2, + pairwisemacrosyntenyblocks_pb2_grpc, +) + +# isort: on async def computePairwiseMacroSyntenyBlocks( diff --git a/macro_synteny_blocks/macro_synteny_blocks/grpc_server.py b/macro_synteny_blocks/macro_synteny_blocks/grpc_server.py index 2a3a9636..b8cb9253 100644 --- a/macro_synteny_blocks/macro_synteny_blocks/grpc_server.py +++ b/macro_synteny_blocks/macro_synteny_blocks/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from macro_synteny_blocks.proto.macrosyntenyblocks_service.v1 # import macrosyntenyblocks_pb2 # from macro_synteny_blocks.proto.macrosyntenyblocks_service.v1 @@ -11,8 +14,12 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from macro_synteny_blocks import proto # noqa: F401 -from macrosyntenyblocks_service.v1 import macrosyntenyblocks_pb2 -from macrosyntenyblocks_service.v1 import macrosyntenyblocks_pb2_grpc +from macrosyntenyblocks_service.v1 import ( + macrosyntenyblocks_pb2, + macrosyntenyblocks_pb2_grpc, +) + +# isort: on class MacroSyntenyBlocks(macrosyntenyblocks_pb2_grpc.MacroSyntenyBlocksServicer): diff --git a/macro_synteny_blocks/macro_synteny_blocks/proto/__init__.py b/macro_synteny_blocks/macro_synteny_blocks/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/macro_synteny_blocks/macro_synteny_blocks/proto/__init__.py +++ b/macro_synteny_blocks/macro_synteny_blocks/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/macro_synteny_blocks/setup.py b/macro_synteny_blocks/setup.py index 28de3548..3fa11e54 100644 --- a/macro_synteny_blocks/setup.py +++ b/macro_synteny_blocks/setup.py @@ -7,7 +7,6 @@ # package from macro_synteny_blocks import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/micro_synteny_search/micro_synteny_search/__main__.py b/micro_synteny_search/micro_synteny_search/__main__.py index a2967176..8bea4212 100755 --- a/micro_synteny_search/micro_synteny_search/__main__.py +++ b/micro_synteny_search/micro_synteny_search/__main__.py @@ -17,7 +17,6 @@ from micro_synteny_search.http_server import run_http_server from micro_synteny_search.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/micro_synteny_search/micro_synteny_search/commands.py b/micro_synteny_search/micro_synteny_search/commands.py index 70e3e2ff..2e8524e3 100644 --- a/micro_synteny_search/micro_synteny_search/commands.py +++ b/micro_synteny_search/micro_synteny_search/commands.py @@ -23,9 +23,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/micro_synteny_search/micro_synteny_search/database.py b/micro_synteny_search/micro_synteny_search/database.py index af1f4aac..1fd94bbd 100644 --- a/micro_synteny_search/micro_synteny_search/database.py +++ b/micro_synteny_search/micro_synteny_search/database.py @@ -4,7 +4,6 @@ # module import micro_synteny_search - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/micro_synteny_search/micro_synteny_search/grpc_server.py b/micro_synteny_search/micro_synteny_search/grpc_server.py index 5e7a14fe..58be5805 100644 --- a/micro_synteny_search/micro_synteny_search/grpc_server.py +++ b/micro_synteny_search/micro_synteny_search/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from micro_synteny_search.proto.microsyntenysearch_service.v1 # import microsyntenysearch_pb2 # from micro_synteny_search.proto.microsyntenysearch_service.v1 @@ -12,10 +15,14 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from micro_synteny_search import proto # noqa: F401 -from microsyntenysearch_service.v1 import microsyntenysearch_pb2 -from microsyntenysearch_service.v1 import microsyntenysearch_pb2_grpc +from microsyntenysearch_service.v1 import ( + microsyntenysearch_pb2, + microsyntenysearch_pb2_grpc, +) from track.v1 import track_pb2 +# isort: on + class MicroSyntenySearch(microsyntenysearch_pb2_grpc.MicroSyntenySearchServicer): def __init__(self, handler): diff --git a/micro_synteny_search/micro_synteny_search/proto/__init__.py b/micro_synteny_search/micro_synteny_search/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/micro_synteny_search/micro_synteny_search/proto/__init__.py +++ b/micro_synteny_search/micro_synteny_search/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/micro_synteny_search/micro_synteny_search/request_handler.py b/micro_synteny_search/micro_synteny_search/request_handler.py index ff656a61..c6218ae3 100644 --- a/micro_synteny_search/micro_synteny_search/request_handler.py +++ b/micro_synteny_search/micro_synteny_search/request_handler.py @@ -3,9 +3,10 @@ from collections import defaultdict from itertools import chain +from redis.commands.search import AsyncSearch + # dependencies from redis.commands.search.query import Query -from redis.commands.search import AsyncSearch class RequestHandler: diff --git a/micro_synteny_search/setup.py b/micro_synteny_search/setup.py index 1e0265d7..07f4581c 100644 --- a/micro_synteny_search/setup.py +++ b/micro_synteny_search/setup.py @@ -7,7 +7,6 @@ # package from micro_synteny_search import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/__main__.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/__main__.py index 8bbcd819..b9636030 100755 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/__main__.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/__main__.py @@ -17,7 +17,6 @@ from pairwise_macro_synteny_blocks.http_server import run_http_server from pairwise_macro_synteny_blocks.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/commands.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/commands.py index a41d661b..74b2e383 100644 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/commands.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/commands.py @@ -24,9 +24,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/database.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/database.py index 1f0b48d6..19d546e6 100644 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/database.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/database.py @@ -4,7 +4,6 @@ # module import pairwise_macro_synteny_blocks - COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/grpc_server.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/grpc_server.py index 72e4255b..aa86b565 100644 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/grpc_server.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/grpc_server.py @@ -2,7 +2,10 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from pairwise_macro_synteny_blocks.proto.pairwisemacrosyntenyblocks_service.v1 # import pairwisemacrosyntenyblocks_pb2 # from pairwise_macro_synteny_blocks.proto.pairwisemacrosyntenyblocks_service.v1 @@ -12,12 +15,14 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from pairwise_macro_synteny_blocks import proto # noqa: F401 -from pairwisemacrosyntenyblocks_service.v1 import pairwisemacrosyntenyblocks_pb2 from pairwisemacrosyntenyblocks_service.v1 import ( + pairwisemacrosyntenyblocks_pb2, pairwisemacrosyntenyblocks_pb2_grpc as pwb_pb2_grpc, ) from block.v1 import block_pb2 +# isort: on + class PairwiseMacroSyntenyBlocks(pwb_pb2_grpc.PairwiseMacroSyntenyBlocksServicer): def __init__(self, handler): diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/metrics.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/metrics.py index a77c4cef..c7630d74 100644 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/metrics.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/metrics.py @@ -1,6 +1,6 @@ from array import array -from itertools import chain from collections import Counter +from itertools import chain def jaccard(a, b, n=1, reversals=False, multiset=False): diff --git a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/proto/__init__.py b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/proto/__init__.py +++ b/pairwise_macro_synteny_blocks/pairwise_macro_synteny_blocks/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/pairwise_macro_synteny_blocks/setup.py b/pairwise_macro_synteny_blocks/setup.py index 8bd073df..27178bbe 100644 --- a/pairwise_macro_synteny_blocks/setup.py +++ b/pairwise_macro_synteny_blocks/setup.py @@ -7,7 +7,6 @@ # package from pairwise_macro_synteny_blocks import commands - PACKAGE_DIRECTORIES = { "": ".", } diff --git a/redis_loader/redis_loader/loaders/gff.py b/redis_loader/redis_loader/loaders/gff.py index 055b6400..39474833 100644 --- a/redis_loader/redis_loader/loaders/gff.py +++ b/redis_loader/redis_loader/loaders/gff.py @@ -1,12 +1,12 @@ # Python import codecs import csv +import gzip from collections import defaultdict +from urllib.request import urlopen, urlparse # dependencies import gffutils -import gzip -from urllib.request import urlopen, urlparse def transferChromosomes(redisearch_loader, genus, species, chromosome_gff): diff --git a/redis_loader/redis_loader/loaders/redisearch.py b/redis_loader/redis_loader/loaders/redisearch.py index 640ffb62..8423bd36 100644 --- a/redis_loader/redis_loader/loaders/redisearch.py +++ b/redis_loader/redis_loader/loaders/redisearch.py @@ -7,7 +7,6 @@ # module import redis_loader - VERSION_KEY = "GCV_SCHEMA_VERSION" COMPATIBLE_KEY = "GCV_COMPATIBLE_SCHEMA_VERSIONS" diff --git a/redis_loader/setup.py b/redis_loader/setup.py index dd4e63e4..beda28e8 100644 --- a/redis_loader/setup.py +++ b/redis_loader/setup.py @@ -2,5 +2,4 @@ from setuptools import setup - setup() diff --git a/search/search/__main__.py b/search/search/__main__.py index d50b071a..1fb7dc19 100755 --- a/search/search/__main__.py +++ b/search/search/__main__.py @@ -17,7 +17,6 @@ from search.query_parser import makeQueryParser from search.request_handler import RequestHandler - LOG_LEVELS = { "DEBUG": logging.DEBUG, "INFO": logging.INFO, diff --git a/search/search/commands.py b/search/search/commands.py index 41d1d72e..7a590ea7 100644 --- a/search/search/commands.py +++ b/search/search/commands.py @@ -21,9 +21,10 @@ import os +import sys + import pkg_resources import setuptools -import sys class BuildProtos(setuptools.Command): diff --git a/search/search/grpc_client.py b/search/search/grpc_client.py index a3be233b..68e9766a 100644 --- a/search/search/grpc_client.py +++ b/search/search/grpc_client.py @@ -1,10 +1,15 @@ # Python import logging +# isort: split + # dependencies from grpc.experimental import aio +# isort: split + # module +# isort: off # from search.proto.genesearch_service.v1 import genesearch_pb2 # from search.proto.genesearch_service.v1 import genesearch_pb2_grpc # from search.proto.chromosomesearch_service.v1 import chromosomesearch_pb2 @@ -15,12 +20,11 @@ # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from search import proto # noqa: F401 -from genesearch_service.v1 import genesearch_pb2 -from genesearch_service.v1 import genesearch_pb2_grpc -from chromosomesearch_service.v1 import chromosomesearch_pb2 -from chromosomesearch_service.v1 import chromosomesearch_pb2_grpc -from chromosomeregion_service.v1 import chromosomeregion_pb2 -from chromosomeregion_service.v1 import chromosomeregion_pb2_grpc +from genesearch_service.v1 import genesearch_pb2, genesearch_pb2_grpc +from chromosomesearch_service.v1 import chromosomesearch_pb2, chromosomesearch_pb2_grpc +from chromosomeregion_service.v1 import chromosomeregion_pb2, chromosomeregion_pb2_grpc + +# isort: on async def gene_search(query, address): diff --git a/search/search/grpc_server.py b/search/search/grpc_server.py index 3b2c59c2..25d196d3 100644 --- a/search/search/grpc_server.py +++ b/search/search/grpc_server.py @@ -2,15 +2,19 @@ import grpc from grpc.experimental import aio +# isort: split + # module +# isort: off # from search.proto.search_service.v1 import search_pb2 # from search.proto.search_service.v1 import search_pb2_grpc # NOTE: the following imports are a temporary workaround for a known protobuf # bug; the commented imports above should be used when the bug is fixed: # https://github.com/protocolbuffers/protobuf/issues/10075 from search import proto # noqa: F401 -from search_service.v1 import search_pb2 -from search_service.v1 import search_pb2_grpc +from search_service.v1 import search_pb2, search_pb2_grpc + +# isort: on class Search(search_pb2_grpc.SearchServicer): diff --git a/search/search/proto/__init__.py b/search/search/proto/__init__.py index f3d64f77..77d8d184 100644 --- a/search/search/proto/__init__.py +++ b/search/search/proto/__init__.py @@ -1,7 +1,6 @@ import os import sys - # protoc can't generate Python files with relative imports and Python 3 doesn't # have implicit relative imports like Python 2. This is unfortunate because we # don't want to add service-specific absolute import paths to .proto files diff --git a/search/search/request_handler.py b/search/search/request_handler.py index 2428379e..959cbf90 100644 --- a/search/search/request_handler.py +++ b/search/search/request_handler.py @@ -2,7 +2,7 @@ import asyncio # module -from search.grpc_client import gene_search, chromosome_search, chromosome_region +from search.grpc_client import chromosome_region, chromosome_search, gene_search class RequestHandler: diff --git a/search/setup.py b/search/setup.py index 19a6c2eb..e0be929c 100644 --- a/search/setup.py +++ b/search/setup.py @@ -7,7 +7,6 @@ # package from search import commands - PACKAGE_DIRECTORIES = { "": ".", }