[Notes] [Git][BuildGrid/buildgrid][mablanch/linting] Clean-up imports in order to respect PEP8 import order



Title: GitLab

Martin Blanchard pushed to branch mablanch/linting at BuildGrid / buildgrid

Commits:

17 changed files:

Changes:

  • app/cli.py
    ... ... @@ -24,10 +24,10 @@ will be attempted to be imported.
    24 24
     """
    
    25 25
     
    
    26 26
     import os
    
    27
    -import sys
    
    28
    -import click
    
    29 27
     import logging
    
    30 28
     
    
    29
    +import click
    
    30
    +
    
    31 31
     from . import _logging
    
    32 32
     
    
    33 33
     CONTEXT_SETTINGS = dict(auto_envvar_prefix='BUILDGRID')
    

  • app/commands/cmd_bot.py
    ... ... @@ -23,25 +23,24 @@ Create a bot interface and request work
    23 23
     """
    
    24 24
     
    
    25 25
     import asyncio
    
    26
    -import click
    
    27
    -import grpc
    
    28 26
     import logging
    
    29 27
     import os
    
    30 28
     import random
    
    31 29
     import subprocess
    
    32 30
     import tempfile
    
    33
    -
    
    34 31
     from pathlib import Path, PurePath
    
    35 32
     
    
    33
    +import click
    
    34
    +import grpc
    
    35
    +from google.protobuf import any_pb2
    
    36
    +
    
    36 37
     from buildgrid.bot import bot, bot_interface
    
    37 38
     from buildgrid.bot.bot_session import BotSession, Device, Worker
    
    38 39
     from buildgrid._exceptions import BotError
    
    39
    -
    
    40
    -from ..cli import pass_context
    
    41
    -
    
    42 40
     from buildgrid._protos.google.bytestream import bytestream_pb2, bytestream_pb2_grpc
    
    43 41
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
    
    44
    -from google.protobuf import any_pb2
    
    42
    +
    
    43
    +from ..cli import pass_context
    
    45 44
     
    
    46 45
     
    
    47 46
     @click.group(short_help='Create a bot client')
    

  • app/commands/cmd_execute.py
    ... ... @@ -22,18 +22,19 @@ Execute command
    22 22
     Request work to be executed and monitor status of jobs.
    
    23 23
     """
    
    24 24
     
    
    25
    -import click
    
    26
    -import grpc
    
    27 25
     import logging
    
    28 26
     import sys
    
    29 27
     import time
    
    30 28
     
    
    31
    -from ..cli import pass_context
    
    29
    +import click
    
    30
    +import grpc
    
    31
    +from google.protobuf import any_pb2
    
    32 32
     
    
    33 33
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
    
    34 34
     from buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2 import ExecuteOperationMetadata
    
    35 35
     from buildgrid._protos.google.longrunning import operations_pb2, operations_pb2_grpc
    
    36
    -from google.protobuf import any_pb2
    
    36
    +
    
    37
    +from ..cli import pass_context
    
    37 38
     
    
    38 39
     
    
    39 40
     @click.group(short_help="Simple execute client")
    

  • app/commands/cmd_server.py
    ... ... @@ -23,9 +23,10 @@ Create a BuildGrid server.
    23 23
     """
    
    24 24
     
    
    25 25
     import asyncio
    
    26
    -import click
    
    27 26
     import logging
    
    28 27
     
    
    28
    +import click
    
    29
    +
    
    29 30
     from buildgrid.server import build_grid_server
    
    30 31
     from buildgrid.server.action_cache import ActionCache
    
    31 32
     from buildgrid.server.cas.storage.disk import DiskStorage
    

  • buildgrid/bot/bot.py
    ... ... @@ -23,13 +23,10 @@ Creates a bot session.
    23 23
     """
    
    24 24
     
    
    25 25
     import asyncio
    
    26
    -import collections
    
    27 26
     import logging
    
    28
    -import time
    
    29 27
     
    
    30 28
     from . import bot_interface, bot_session
    
    31 29
     from .bot_session import BotStatus, LeaseState
    
    32
    -from .._exceptions import BotError
    
    33 30
     
    
    34 31
     
    
    35 32
     class Bot:
    

  • buildgrid/bot/bot_interface.py
    ... ... @@ -26,8 +26,6 @@ import logging
    26 26
     
    
    27 27
     from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2, bots_pb2_grpc
    
    28 28
     
    
    29
    -from .._exceptions import BotError
    
    30
    -
    
    31 29
     
    
    32 30
     class BotInterface:
    
    33 31
         """
    

  • buildgrid/server/build_grid_server.py
    ... ... @@ -22,10 +22,10 @@ BuildGridServer
    22 22
     Creates the user a local server BuildGrid server.
    
    23 23
     """
    
    24 24
     
    
    25
    -import time
    
    26
    -import grpc
    
    27 25
     from concurrent import futures
    
    28 26
     
    
    27
    +import grpc
    
    28
    +
    
    29 29
     from buildgrid._protos.google.bytestream import bytestream_pb2_grpc
    
    30 30
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2_grpc
    
    31 31
     from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2_grpc
    

  • buildgrid/server/cas/bytestream_service.py
    ... ... @@ -24,9 +24,9 @@ CAS blobs.
    24 24
     """
    
    25 25
     
    
    26 26
     import grpc
    
    27
    +
    
    27 28
     from buildgrid._protos.google.bytestream import bytestream_pb2, bytestream_pb2_grpc
    
    28 29
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 as re_pb2
    
    29
    -from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2_grpc as re_pb2_grpc
    
    30 30
     
    
    31 31
     from ...settings import HASH
    
    32 32
     
    

  • buildgrid/server/cas/content_addressable_storage_service.py
    ... ... @@ -23,8 +23,6 @@ Implements the Content Addressable Storage API, which provides methods
    23 23
     to check for missing CAS blobs and update them in bulk.
    
    24 24
     """
    
    25 25
     
    
    26
    -import grpc
    
    27
    -
    
    28 26
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 as re_pb2
    
    29 27
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2_grpc as re_pb2_grpc
    
    30 28
     
    

  • buildgrid/server/execution/action_cache_service.py
    ... ... @@ -23,6 +23,7 @@ Allows clients to manually query/update the action cache.
    23 23
     """
    
    24 24
     
    
    25 25
     import logging
    
    26
    +
    
    26 27
     import grpc
    
    27 28
     
    
    28 29
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
    

  • buildgrid/server/execution/execution_instance.py
    ... ... @@ -21,14 +21,13 @@ ExecutionInstance
    21 21
     An instance of the Remote Execution Server.
    
    22 22
     """
    
    23 23
     
    
    24
    -import uuid
    
    25 24
     import logging
    
    26 25
     
    
    27 26
     from buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2 import Action
    
    28 27
     
    
    29 28
     from ._exceptions import InvalidArgumentError
    
    30 29
     
    
    31
    -from ..job import Job, ExecuteStage
    
    30
    +from ..job import Job
    
    32 31
     
    
    33 32
     
    
    34 33
     class ExecutionInstance():
    

  • buildgrid/server/execution/execution_service.py
    ... ... @@ -22,14 +22,13 @@ ExecutionService
    22 22
     Serves remote execution requests.
    
    23 23
     """
    
    24 24
     
    
    25
    -import grpc
    
    26 25
     import logging
    
    27 26
     import queue
    
    28 27
     from functools import partial
    
    29 28
     
    
    30
    -from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
    
    29
    +import grpc
    
    30
    +
    
    31 31
     from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2_grpc
    
    32
    -from buildgrid._protos.google.longrunning import operations_pb2_grpc, operations_pb2
    
    33 32
     
    
    34 33
     from ._exceptions import InvalidArgumentError
    
    35 34
     
    

  • buildgrid/server/execution/operations_service.py
    ... ... @@ -21,9 +21,10 @@ OperationsService
    21 21
     
    
    22 22
     """
    
    23 23
     
    
    24
    -import grpc
    
    25 24
     import logging
    
    26 25
     
    
    26
    +import grpc
    
    27
    +
    
    27 28
     from buildgrid._protos.google.longrunning import operations_pb2_grpc, operations_pb2
    
    28 29
     
    
    29 30
     from ._exceptions import InvalidArgumentError
    

  • buildgrid/server/job.py
    ... ... @@ -17,14 +17,14 @@
    17 17
     
    
    18 18
     import logging
    
    19 19
     import uuid
    
    20
    -
    
    21 20
     from enum import Enum
    
    22 21
     
    
    22
    +from google.protobuf import any_pb2
    
    23
    +
    
    23 24
     from buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2 import ExecuteOperationMetadata
    
    24 25
     from buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2 import ExecuteResponse
    
    25
    -from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2, worker_pb2
    
    26
    +from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2
    
    26 27
     from buildgrid._protos.google.longrunning import operations_pb2
    
    27
    -from google.protobuf import any_pb2
    
    28 28
     
    
    29 29
     
    
    30 30
     class ExecuteStage(Enum):
    

  • buildgrid/server/scheduler.py
    ... ... @@ -23,9 +23,10 @@ Schedules jobs.
    23 23
     
    
    24 24
     from collections import deque
    
    25 25
     
    
    26
    +from google.protobuf import any_pb2
    
    27
    +
    
    26 28
     from buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2 import ActionResult
    
    27 29
     from buildgrid._protos.google.longrunning import operations_pb2
    
    28
    -from google.protobuf import any_pb2
    
    29 30
     
    
    30 31
     from .job import ExecuteStage, LeaseState
    
    31 32
     
    

  • buildgrid/server/worker/bots_service.py
    ... ... @@ -21,13 +21,13 @@ BotsService
    21 21
     
    
    22 22
     """
    
    23 23
     
    
    24
    -import grpc
    
    25 24
     import logging
    
    26 25
     
    
    27
    -from .bots_interface import BotsInterface
    
    28
    -from ._exceptions import InvalidArgumentError, OutofSyncError
    
    26
    +import grpc
    
    29 27
     
    
    30
    -from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2, bots_pb2_grpc
    
    28
    +from buildgrid._protos.google.devtools.remoteworkers.v1test2 import bots_pb2_grpc
    
    29
    +
    
    30
    +from ._exceptions import InvalidArgumentError, OutofSyncError
    
    31 31
     
    
    32 32
     
    
    33 33
     class BotsService(bots_pb2_grpc.BotsServicer):
    

  • buildgrid/settings.py
    1 1
     import hashlib
    
    2 2
     
    
    3
    +
    
    3 4
     # The hash function that CAS uses
    
    4 5
     HASH = hashlib.sha256



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]