From 44ef79472c280345907d55f5fc96b2801f96086d Mon Sep 17 00:00:00 2001 From: Christopher Vittal Date: Wed, 7 Aug 2024 12:32:09 -0400 Subject: [PATCH] lint fixes --- hail/python/hailtop/aiotools/plan.py | 7 ++++--- hail/python/hailtop/aiotools/sync.py | 12 ++++++------ hail/python/hailtop/hailctl/__main__.py | 3 +-- hail/python/hailtop/hailctl/fs/cli.py | 10 ++++++---- .../python/test/hailtop/inter_cloud/test_copy.py | 16 ++++++++-------- .../hailtop/inter_cloud/test_hailctl_fs_sync.py | 2 ++ 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/hail/python/hailtop/aiotools/plan.py b/hail/python/hailtop/aiotools/plan.py index 1d2575c021f..6545c3791fb 100644 --- a/hail/python/hailtop/aiotools/plan.py +++ b/hail/python/hailtop/aiotools/plan.py @@ -1,12 +1,13 @@ -from typing import List, Tuple, Optional import asyncio import os from contextlib import AsyncExitStack +from typing import List, Optional, Tuple + from hailtop.aiotools import FileAndDirectoryError -from .router_fs import RouterAsyncFS -from .fs import FileListEntry, FileStatus, AsyncFS, WritableStream from ..utils.rich_progress_bar import CopyToolProgressBar, Progress +from .fs import AsyncFS, FileListEntry, FileStatus, WritableStream +from .router_fs import RouterAsyncFS class PlanError(ValueError): diff --git a/hail/python/hailtop/aiotools/sync.py b/hail/python/hailtop/aiotools/sync.py index 0deebcb9a49..d98fd43c3f5 100644 --- a/hail/python/hailtop/aiotools/sync.py +++ b/hail/python/hailtop/aiotools/sync.py @@ -1,15 +1,15 @@ -from typing import Optional import asyncio -import os import functools +import os +from typing import Optional +from ..utils import bounded_gather2, retry_transient_errors +from ..utils.rich_progress_bar import CopyToolProgressBar, make_listener from .copy import GrowingSempahore -from .fs.fs import MultiPartCreate from .fs.copier import Copier from .fs.exceptions import UnexpectedEOFError -from .router_fs import RouterAsyncFS, AsyncFS -from ..utils import retry_transient_errors, bounded_gather2 -from ..utils.rich_progress_bar import make_listener, CopyToolProgressBar +from .fs.fs import MultiPartCreate +from .router_fs import AsyncFS, RouterAsyncFS class SyncError(ValueError): diff --git a/hail/python/hailtop/hailctl/__main__.py b/hail/python/hailtop/hailctl/__main__.py index 36fc0154d83..3f514d2b224 100644 --- a/hail/python/hailtop/hailctl/__main__.py +++ b/hail/python/hailtop/hailctl/__main__.py @@ -1,5 +1,4 @@ import os - from typing import cast import click @@ -11,8 +10,8 @@ from .dataproc import cli as dataproc_cli from .describe import describe from .dev import cli as dev_cli -from .hdinsight import cli as hdinsight_cli from .fs import cli as fs_cli +from .hdinsight import cli as hdinsight_cli app = typer.Typer( help='Manage and monitor hail deployments.', diff --git a/hail/python/hailtop/hailctl/fs/cli.py b/hail/python/hailtop/hailctl/fs/cli.py index dba1db5acea..f27a7e57526 100644 --- a/hail/python/hailtop/hailctl/fs/cli.py +++ b/hail/python/hailtop/hailctl/fs/cli.py @@ -1,12 +1,14 @@ -from typing import Optional, List, Tuple, cast import asyncio -import click import sys +from typing import List, Optional, Tuple, cast + +import click import typer from hailtop import uvloopx -from hailtop.aiotools.plan import plan, PlanError -from hailtop.aiotools.sync import sync as aiotools_sync, SyncError +from hailtop.aiotools.plan import PlanError, plan +from hailtop.aiotools.sync import SyncError +from hailtop.aiotools.sync import sync as aiotools_sync app_without_click = typer.Typer( name='fs', diff --git a/hail/python/test/hailtop/inter_cloud/test_copy.py b/hail/python/test/hailtop/inter_cloud/test_copy.py index 8ab4e4790ed..7e8f8c22083 100644 --- a/hail/python/test/hailtop/inter_cloud/test_copy.py +++ b/hail/python/test/hailtop/inter_cloud/test_copy.py @@ -2,21 +2,21 @@ import os import secrets import tempfile - from typing import AsyncIterator, Dict, List, Tuple import pytest -from hailtop.utils import url_scheme -from hailtop.aiotools.plan import plan, PlanError -from hailtop.aiotools.sync import sync, SyncError -from hailtop.aiotools.router_fs import RouterAsyncFS + from hailtop.aiotools import ( - Transfer, - FileAndDirectoryError, - Copier, AsyncFS, + Copier, + FileAndDirectoryError, FileListEntry, + Transfer, ) +from hailtop.aiotools.plan import PlanError, plan +from hailtop.aiotools.router_fs import RouterAsyncFS +from hailtop.aiotools.sync import SyncError, sync +from hailtop.utils import url_scheme from .copy_test_specs import COPY_TEST_SPECS from .generate_copy_test_specs import create_test_dir, create_test_file, run_test_spec diff --git a/hail/python/test/hailtop/inter_cloud/test_hailctl_fs_sync.py b/hail/python/test/hailtop/inter_cloud/test_hailctl_fs_sync.py index a0f2f80efc0..119623e9b21 100644 --- a/hail/python/test/hailtop/inter_cloud/test_hailctl_fs_sync.py +++ b/hail/python/test/hailtop/inter_cloud/test_hailctl_fs_sync.py @@ -1,6 +1,8 @@ import pytest + from hailtop.utils import check_exec_output +from .test_copy import cloud_scheme from .utils import fresh_dir