Skip to content

Commit

Permalink
Whoops, missed a bunch of renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Dec 23, 2024
1 parent 7eb4185 commit 1c31f11
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions robot-server/robot_server/client_data/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Annotated, Literal

import fastapi
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.client_data.store import (
ClientData,
Expand All @@ -19,7 +19,7 @@
get_client_data_publisher,
)

router = FastBuildRouter()
router = LightRouter()


Key = Annotated[
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/commands/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Annotated, Final, List, Literal, Optional, cast

from fastapi import Depends, Query, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_engine import CommandIntent
from opentrons.protocol_engine.errors import CommandDoesNotExistError
Expand All @@ -26,7 +26,7 @@
_DEFAULT_COMMAND_LIST_LENGTH: Final = 20


commands_router = FastBuildRouter()
commands_router = LightRouter()


class CommandNotFound(ErrorDetails):
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/data_files/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from fastapi import UploadFile, File, Form, Depends, Response, status
from opentrons.protocol_reader import FileHasher, FileReaderWriter
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.service.json_api import (
SimpleBody,
Expand All @@ -33,7 +33,7 @@
from ..protocols.dependencies import get_file_hasher, get_file_reader_writer
from ..service.dependencies import get_current_time, get_unique_id

datafiles_router = FastBuildRouter()
datafiles_router = LightRouter()


class MultipleDataFileSources(ErrorDetails):
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/deck_configuration/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import fastapi
from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons_shared_data.deck.types import DeckDefinitionV5

Expand All @@ -22,7 +22,7 @@
from .store import DeckConfigurationStore


router = FastBuildRouter()
router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/error_recovery/settings/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from typing import Annotated

import fastapi
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.service.json_api import PydanticResponse, RequestModel, SimpleBody
from .models import RequestData, ResponseData
from .store import ErrorRecoverySettingStore, get_error_recovery_setting_store


router = FastBuildRouter()
router = LightRouter()
_PATH = "/errorRecovery/settings"


Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/instruments/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Annotated, Optional, Dict, List, cast

from fastapi import status, Depends
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.hardware_control.instruments.ot3.instrument_calibration import (
PipetteOffsetSummary,
Expand Down Expand Up @@ -51,7 +51,7 @@

from opentrons.hardware_control import OT3HardwareControlAPI

instruments_router = FastBuildRouter()
instruments_router = LightRouter()


def _pipette_dict_to_pipette_res(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/labware_offsets/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Annotated, Literal

import fastapi
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_engine import LabwareOffset, LabwareOffsetCreate, ModuleModel
from opentrons.types import DeckSlotName
Expand All @@ -26,7 +26,7 @@
from .fastapi_dependencies import get_labware_offset_store


router = FastBuildRouter()
router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/maintenance_runs/router/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Maintenance Runs router."""
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from .base_router import base_router

from .commands_router import commands_router
from .labware_router import labware_router

maintenance_runs_router = FastBuildRouter()
maintenance_runs_router = LightRouter()

maintenance_runs_router.include_router(base_router)
maintenance_runs_router.include_router(commands_router)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from fastapi import Depends, status
from pydantic import BaseModel, Field
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.errors.error_responses import ErrorDetails, ErrorBody
from robot_server.service.dependencies import get_current_time, get_unique_id
Expand Down Expand Up @@ -43,7 +43,7 @@
from robot_server.service.notifications import get_pe_notify_publishers

log = logging.getLogger(__name__)
base_router = FastBuildRouter()
base_router = LightRouter()


# TODO (spp, 2023-04-10): move all error types from maintenance & regular runs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing_extensions import Final, Literal

from fastapi import Depends, Query, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_engine import (
CommandPointer,
Expand Down Expand Up @@ -40,7 +40,7 @@

_DEFAULT_COMMAND_LIST_LENGTH: Final = 20

commands_router = FastBuildRouter()
commands_router = LightRouter()


class CommandNotFound(ErrorDetails):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

from fastapi import Depends, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_engine import LabwareOffsetCreate, LabwareOffset
from opentrons.protocols.models import LabwareDefinition
Expand All @@ -17,7 +17,7 @@
from .base_router import RunNotFound, RunNotIdle, get_run_data_from_url

log = logging.getLogger(__name__)
labware_router = FastBuildRouter()
labware_router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/modules/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Annotated, List, Dict

from fastapi import Depends, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.hardware_control import HardwareControlAPI
from opentrons.hardware_control.modules import module_calibration
Expand All @@ -23,7 +23,7 @@
from .module_identifier import ModuleIdentifier
from .module_data_mapper import ModuleDataMapper

modules_router = FastBuildRouter()
modules_router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/protocols/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)
from fastapi.responses import PlainTextResponse
from pydantic import BaseModel, Field
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_reader import (
ProtocolReader,
Expand Down Expand Up @@ -151,7 +151,7 @@ class ProtocolLinks(BaseModel):
)


protocols_router = FastBuildRouter()
protocols_router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/robot/control/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Annotated, TYPE_CHECKING

from fastapi import status, Depends
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons_shared_data.robot.types import RobotType
from opentrons_shared_data.robot.types import RobotTypeEnum
Expand All @@ -24,7 +24,7 @@
if TYPE_CHECKING:
from opentrons.hardware_control.ot3api import OT3API # noqa: F401

control_router = FastBuildRouter()
control_router = LightRouter()


async def _get_estop_status_response(
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/robot/router.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Router for /robot endpoints."""
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from .control.router import control_router

robot_router = FastBuildRouter()
robot_router = LightRouter()

robot_router.include_router(router=control_router)
12 changes: 6 additions & 6 deletions robot-server/robot_server/router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Application routes."""
from fastapi import Depends, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter


from .constants import V1_TAG
Expand Down Expand Up @@ -28,15 +28,15 @@
from .subsystems.router import subsystems_router
from .system.router import system_router

router = FastBuildRouter()
router = LightRouter()

# Legacy routes
router.include_router(
router=legacy_routes,
tags=[V1_TAG],
# todo(mm, 2024-12-19): This `responses` setting is preventing us from
# porting legacy_routes from fastapi.APIRouter to our FastBuildRouter.
# Either teach FastBuildRouter how to handle `responses` or stop doing
# porting legacy_routes from fastapi.APIRouter to our LightRouter.
# Either teach LightRouter how to handle `responses` or stop doing
# a custom 422 response on these endpoints.
responses={
status.HTTP_422_UNPROCESSABLE_ENTITY: {
Expand All @@ -50,8 +50,8 @@
dependencies=[Depends(check_version_header)],
responses={
# todo(mm, 2024-12-19): This `responses` setting is preventing us from
# porting health_router from fastapi.APIRouter to our FastBuildRouter.
# Either teach FastBuildRouter how to handle `responses` or stop doing
# porting health_router from fastapi.APIRouter to our LightRouter.
# Either teach LightRouter how to handle `responses` or stop doing
# a custom 422 response on these endpoints.
status.HTTP_422_UNPROCESSABLE_ENTITY: {
"model": LegacyErrorResponse,
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/runs/router/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Runs router."""
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from .base_router import base_router
from .commands_router import commands_router
from .actions_router import actions_router
from .labware_router import labware_router
from .error_recovery_policy_router import error_recovery_policy_router

runs_router = FastBuildRouter()
runs_router = LightRouter()

runs_router.include_router(base_router)
runs_router.include_router(commands_router)
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/runs/router/actions_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Annotated, Literal, Union

from fastapi import Depends, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.errors.error_responses import ErrorDetails, ErrorBody
from robot_server.service.dependencies import get_current_time, get_unique_id
Expand Down Expand Up @@ -39,7 +39,7 @@
)

log = logging.getLogger(__name__)
actions_router = FastBuildRouter()
actions_router = LightRouter()


class RunActionNotAllowed(ErrorDetails):
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/runs/router/base_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from fastapi import Depends, status, Query
from pydantic import BaseModel, Field
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter


from opentrons_shared_data.errors import ErrorCodes
Expand Down Expand Up @@ -89,7 +89,7 @@
from robot_server.service.notifications import get_pe_notify_publishers

log = logging.getLogger(__name__)
base_router = FastBuildRouter()
base_router = LightRouter()

_DEFAULT_COMMAND_ERROR_LIST_LENGTH: Final = 20

Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/runs/router/commands_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Annotated, Final, Literal, Optional, Union

from fastapi import Depends, Query, status
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from opentrons.protocol_engine import (
CommandPointer,
Expand Down Expand Up @@ -45,7 +45,7 @@

_DEFAULT_COMMAND_LIST_LENGTH: Final = 20

commands_router = FastBuildRouter()
commands_router = LightRouter()


class CommandNotFound(ErrorDetails):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Annotated

from fastapi import status, Depends
from server_utils.fastapi_utils.light_router import FastBuildRouter
from server_utils.fastapi_utils.light_router import LightRouter

from robot_server.errors.error_responses import ErrorBody
from robot_server.service.json_api.request import RequestModel
Expand All @@ -21,7 +21,7 @@
from ..error_recovery_models import ErrorRecoveryPolicy


error_recovery_policy_router = FastBuildRouter()
error_recovery_policy_router = LightRouter()


@PydanticResponse.wrap_route(
Expand Down
Loading

0 comments on commit 1c31f11

Please sign in to comment.