diff --git a/requirements.txt b/requirements.txt index 78a9e32e..92c87b23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.14 # by the following command: # # pip-compile --output-file=./requirements.txt ./requirements.in @@ -52,10 +52,6 @@ python-dateutil==2.9.0.post0 # via matplotlib six==1.* # via python-dateutil -typing-extensions==4.* - # via - # aiohttp - # aiosignal vtk==9.6.2 # via -r requirements.in websocket-client==1.8.0 @@ -65,4 +61,3 @@ wslink==2.6.0 yarl==1.* # via aiohttp -opengeodeweb-microservice==1.*,>=1.3.2 diff --git a/ruff.toml b/ruff.toml index 46d218b1..21f48b49 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,6 +1,6 @@ # https://docs.astral.sh/ruff/configuration/ -target-version = "py312" +target-version = "py314" line-length = 100 indent-width = 4 extend-exclude = ["**/schemas/**"] # generated schemas diff --git a/src/opengeodeweb_viewer/object/object_methods.py b/src/opengeodeweb_viewer/object/object_methods.py index 85dc1f54..a2c48010 100644 --- a/src/opengeodeweb_viewer/object/object_methods.py +++ b/src/opengeodeweb_viewer/object/object_methods.py @@ -1,4 +1,5 @@ import logging +from typing import TYPE_CHECKING # Third party imports from vtkmodules.vtkCommonDataModel import ( @@ -13,10 +14,12 @@ ) # Local application imports -from opengeodeweb_viewer.utils_functions import ColorClassProtocol -from opengeodeweb_viewer.vtk_pipeline import VtkPipeline from opengeodeweb_viewer.vtk_protocol import VtkView +if TYPE_CHECKING: + from opengeodeweb_viewer.utils_functions import ColorClassProtocol + from opengeodeweb_viewer.vtk_pipeline import VtkPipeline + logger = logging.getLogger(__name__) diff --git a/src/opengeodeweb_viewer/rpc/generic/generic_protocols.py b/src/opengeodeweb_viewer/rpc/generic/generic_protocols.py index 2a5cdece..1fe0919b 100644 --- a/src/opengeodeweb_viewer/rpc/generic/generic_protocols.py +++ b/src/opengeodeweb_viewer/rpc/generic/generic_protocols.py @@ -1,11 +1,10 @@ # Standard library imports from pathlib import Path +from typing import TYPE_CHECKING # Third party imports from opengeodeweb_microservice.schemas import get_schemas_dict -from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from opengeodeweb_viewer.rpc.model.model_protocols import VtkModelView from opengeodeweb_viewer.typed_rpc import typed_rpc # Local application imports @@ -13,6 +12,10 @@ from . import schemas +if TYPE_CHECKING: + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView + from opengeodeweb_viewer.rpc.model.model_protocols import VtkModelView + class VtkGenericView(VtkView): generic_prefix = "opengeodeweb_viewer.generic." diff --git a/src/opengeodeweb_viewer/rpc/protocols.py b/src/opengeodeweb_viewer/rpc/protocols.py index 098dfb78..91a45265 100644 --- a/src/opengeodeweb_viewer/rpc/protocols.py +++ b/src/opengeodeweb_viewer/rpc/protocols.py @@ -1,5 +1,6 @@ # Local application imports -from opengeodeweb_viewer.vtk_protocol import VtkView + +from typing import TYPE_CHECKING from .mesh.cells.attribute.cell.cells_attribute_cell_protocols import VtkMeshCellsAttributeCellView from .mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import ( @@ -69,6 +70,9 @@ ) from .model.surfaces.points.model_surfaces_points_protocols import VtkModelSurfacesPointsView +if TYPE_CHECKING: + from opengeodeweb_viewer.vtk_protocol import VtkView + MESH_PROTOCOLS: tuple[type[VtkView], ...] = ( VtkMeshPointsView, VtkMeshPointsAttributeVertexView, diff --git a/src/opengeodeweb_viewer/typed_rpc.py b/src/opengeodeweb_viewer/typed_rpc.py index 6b7e742b..705ec98b 100644 --- a/src/opengeodeweb_viewer/typed_rpc.py +++ b/src/opengeodeweb_viewer/typed_rpc.py @@ -1,19 +1,22 @@ # Standard library imports import functools import os -from collections.abc import Callable from dataclasses import fields -from typing import Any, Concatenate, Protocol, cast +from typing import TYPE_CHECKING, Any, Concatenate, Protocol, cast # Third party imports import fastjsonschema # type: ignore[import-untyped] from dataclasses_json import DataClassJsonMixin -from opengeodeweb_microservice.schemas import Route from wslink import register # type: ignore[import-untyped] # Local application imports from opengeodeweb_viewer.utils_functions import RpcParams, validate_schema +if TYPE_CHECKING: + from collections.abc import Callable + + from opengeodeweb_microservice.schemas import Route + TYPED_RPC_MARKER = "__typed_rpc__" diff --git a/src/opengeodeweb_viewer/utils_functions.py b/src/opengeodeweb_viewer/utils_functions.py index 485b9e8d..44989560 100644 --- a/src/opengeodeweb_viewer/utils_functions.py +++ b/src/opengeodeweb_viewer/utils_functions.py @@ -2,12 +2,14 @@ # Standard library imports # Third party imports -from typing import Protocol +from typing import TYPE_CHECKING, Protocol import fastjsonschema # type: ignore[import-untyped] -from opengeodeweb_microservice.schemas import SchemaDict from vtkmodules.vtkRenderingCore import vtkColorTransferFunction +if TYPE_CHECKING: + from opengeodeweb_microservice.schemas import SchemaDict + logger = logging.getLogger(__name__) diff --git a/src/opengeodeweb_viewer/vtk_pipeline.py b/src/opengeodeweb_viewer/vtk_pipeline.py index e7f00a9f..d6b3f264 100644 --- a/src/opengeodeweb_viewer/vtk_pipeline.py +++ b/src/opengeodeweb_viewer/vtk_pipeline.py @@ -3,13 +3,9 @@ # Standard library imports import math from dataclasses import dataclass, field -from typing import Literal, TypedDict, cast +from typing import TYPE_CHECKING, Literal, TypedDict, cast # Local application imports -from opengeodeweb_microservice.database.data_types import ( - ViewerElementsType, - ViewerType, -) from vtkmodules.vtkCommonDataModel import ( vtkBoundingBox, vtkCompositeDataSet, @@ -20,9 +16,7 @@ vtkSelectionNode, vtkVector2d, ) -from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkAppendFilter, vtkThreshold from vtkmodules.vtkFiltersExtraction import ( vtkExtractGeometry, vtkExtractSelection, @@ -30,7 +24,6 @@ from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter, vtkTransformFilter from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter from vtkmodules.vtkFiltersSources import vtkLineSource, vtkSphereSource -from vtkmodules.vtkIOXML import vtkXMLReader from vtkmodules.vtkRenderingAnnotation import ( vtkScalarBarActor, ) @@ -57,6 +50,15 @@ create_color_transfer_function, ) +if TYPE_CHECKING: + from opengeodeweb_microservice.database.data_types import ( + ViewerElementsType, + ViewerType, + ) + from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm + from vtkmodules.vtkFiltersCore import vtkAppendFilter, vtkThreshold + from vtkmodules.vtkIOXML import vtkXMLReader + logger = logging.getLogger(__name__) diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index 93a42115..d35477fc 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -4,7 +4,7 @@ import math import os from pathlib import Path -from typing import cast +from typing import TYPE_CHECKING, cast import vtkmodules.vtkRenderingOpenGL2 # noqa: F401 registers the OpenGL render window backend @@ -27,12 +27,6 @@ from vtkmodules.vtkFiltersExtraction import vtkExtractGeometry from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter from vtkmodules.vtkImagingCore import vtkExtractVOI -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import ( - vtkAxesActor, - vtkCubeAxesActor, - vtkScalarBarActor, -) from vtkmodules.vtkRenderingCore import ( vtkActor, vtkCellPicker, @@ -40,11 +34,8 @@ vtkRenderer, vtkRenderWindow, ) -from vtkmodules.vtkWebCore import vtkWebApplication from vtkmodules.web import protocols as vtk_protocols -from opengeodeweb_viewer.rpc.viewer.schemas.clipping_planes import Plane -from opengeodeweb_viewer.rpc.viewer.schemas.slice import SliceElement from opengeodeweb_viewer.rpc.viewer.schemas.threshold import Attribute, Location from opengeodeweb_viewer.vtk_pipeline import ( RulerPipeline, @@ -52,6 +43,18 @@ VtkPipeline, ) +if TYPE_CHECKING: + from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget + from vtkmodules.vtkRenderingAnnotation import ( + vtkAxesActor, + vtkCubeAxesActor, + vtkScalarBarActor, + ) + from vtkmodules.vtkWebCore import vtkWebApplication + + from opengeodeweb_viewer.rpc.viewer.schemas.clipping_planes import Plane + from opengeodeweb_viewer.rpc.viewer.schemas.slice import SliceElement + logger = logging.getLogger(__name__) MAX_DATA_NAME_LENGTH = 22 diff --git a/tests/conftest.py b/tests/conftest.py index f188e06f..5356d73a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,9 +4,8 @@ import shutil import tempfile import xml.etree.ElementTree as ET -from collections.abc import Callable, Generator from pathlib import Path -from typing import Any, ClassVar +from typing import TYPE_CHECKING, Any, ClassVar import msgpack # type: ignore[import-untyped] import pytest @@ -21,6 +20,9 @@ from opengeodeweb_viewer.config import TestConfig from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView +if TYPE_CHECKING: + from collections.abc import Callable, Generator + logger = logging.getLogger(__name__) @@ -182,7 +184,7 @@ class Starter(ProcessStarter): # type: ignore[misc] @pytest.fixture -def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]: +def server(xprocess: XProcess) -> Generator[ServerMonitor]: name, starter, monitor_class = HELPER.get_xprocess_args(TEST_PROJECT_FOLDER_PATH) os.environ["PYTHON_ENV"] = "test" _, log = xprocess.ensure(name, starter) @@ -195,7 +197,7 @@ def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]: @pytest.fixture(scope="session", autouse=True) -def configure_test_environment() -> Generator[None, None, None]: +def configure_test_environment() -> Generator[None]: app_config = TestConfig(TEST_PROJECT_FOLDER_PATH) db_path = Path(app_config.DATA_FOLDER_PATH) / "project.db" init_database(db_path=db_path) diff --git a/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py index 41fae3cb..3e08e59a 100644 --- a/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py +++ b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.cells.attribute.cell.cells_attribute_cell_protocols import ( VtkMeshCellsAttributeCellView, @@ -9,7 +10,11 @@ from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py b/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py index 9912e097..bbf16599 100644 --- a/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py +++ b/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import ( VtkMeshCellsAttributeVertexView, @@ -9,7 +10,11 @@ from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/cells/test_mesh_cells_protocols.py b/tests/mesh/cells/test_mesh_cells_protocols.py index 96c6aca6..1bba0ca0 100644 --- a/tests/mesh/cells/test_mesh_cells_protocols.py +++ b/tests/mesh/cells/test_mesh_cells_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.cells.cells_protocols import VtkMeshCellsView @@ -8,7 +9,11 @@ from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py b/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py index 6ff6cec7..45a68a82 100644 --- a/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py +++ b/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import ( VtkMeshEdgesAttributeEdgeView, @@ -9,7 +10,11 @@ from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py b/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py index 3bedb392..5ba3154d 100644 --- a/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py +++ b/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import ( VtkMeshEdgesAttributeVertexView, @@ -9,7 +10,11 @@ from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index a404b20c..1713b26e 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -1,16 +1,21 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.edges.edges_protocols import VtkMeshEdgesView # Third party imports from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.mesh.test_mesh_protocols import test_register_mesh +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py b/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py index 4b05efc3..3c55301c 100644 --- a/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py +++ b/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py @@ -1,7 +1,8 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.points.attribute.vertex.points_attribute_vertex_protocols import ( VtkMeshPointsAttributeVertexView, @@ -12,7 +13,11 @@ ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkMeshPolygonsAttributeVertexView = ( polygons_attribute_vertex_protocols.VtkMeshPolygonsAttributeVertexView diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index bafc3253..ae2cfbeb 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -1,16 +1,21 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.points.points_protocols import ( VtkMeshPointsView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.mesh.test_mesh_protocols import test_register_mesh +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + def test_points_visibility(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py b/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py index 58a7d4ee..ea99229d 100644 --- a/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py +++ b/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py @@ -1,14 +1,19 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.polygons.attribute.polygon import ( polygons_attribute_polygon_protocols, ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkMeshPolygonsAttributePolygonView = ( polygons_attribute_polygon_protocols.VtkMeshPolygonsAttributePolygonView diff --git a/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py b/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py index cdacc435..03389fb2 100644 --- a/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py +++ b/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py @@ -1,14 +1,19 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.polygons.attribute.vertex import ( polygons_attribute_vertex_protocols, ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkMeshPolygonsAttributeVertexView = ( polygons_attribute_vertex_protocols.VtkMeshPolygonsAttributeVertexView diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index f419cf42..ecc7e4e2 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -1,14 +1,19 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.polygons.polygons_protocols import VtkMeshPolygonsView from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.mesh.test_mesh_protocols import test_register_mesh +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py b/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py index 77b7b66e..e66b2775 100644 --- a/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py +++ b/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py @@ -1,14 +1,19 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.polyhedron import ( polyhedra_attribute_polyhedron_protocols, ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkMeshPolyhedraAttributePolyhedronView = ( polyhedra_attribute_polyhedron_protocols.VtkMeshPolyhedraAttributePolyhedronView diff --git a/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py b/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py index b8fc2132..151ee4d6 100644 --- a/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py +++ b/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py @@ -1,14 +1,19 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.vertex import ( polyhedra_attribute_vertex_protocols, ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkMeshPolyhedraAttributeVertexView = ( polyhedra_attribute_vertex_protocols.VtkMeshPolyhedraAttributeVertexView diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 918edffc..d0134bb8 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -1,7 +1,8 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.mesh.polyhedra.polyhedra_protocols import ( VtkMeshPolyhedraView, @@ -9,7 +10,11 @@ from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/mesh/test_mesh_protocols.py b/tests/mesh/test_mesh_protocols.py index 867a5494..96a3399f 100644 --- a/tests/mesh/test_mesh_protocols.py +++ b/tests/mesh/test_mesh_protocols.py @@ -1,7 +1,11 @@ -from collections.abc import Callable +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants mesh_id = "12345678901234567890123456789012" diff --git a/tests/model/blocks/attribute/polyhedron/test_model_blocks_attribute_polyhedron_protocols.py b/tests/model/blocks/attribute/polyhedron/test_model_blocks_attribute_polyhedron_protocols.py index d37899f7..3a6b217a 100644 --- a/tests/model/blocks/attribute/polyhedron/test_model_blocks_attribute_polyhedron_protocols.py +++ b/tests/model/blocks/attribute/polyhedron/test_model_blocks_attribute_polyhedron_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.blocks.attribute.polyhedron import ( blocks_attribute_polyhedron_protocols, @@ -9,11 +10,15 @@ from opengeodeweb_viewer.rpc.model.blocks.model_blocks_protocols import ( VtkModelBlocksView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + VtkModelBlocksAttributePolyhedronView = ( blocks_attribute_polyhedron_protocols.VtkModelBlocksAttributePolyhedronView ) diff --git a/tests/model/blocks/attribute/vertex/test_model_blocks_attribute_vertex_protocols.py b/tests/model/blocks/attribute/vertex/test_model_blocks_attribute_vertex_protocols.py index 9010a61b..85a6e48b 100644 --- a/tests/model/blocks/attribute/vertex/test_model_blocks_attribute_vertex_protocols.py +++ b/tests/model/blocks/attribute/vertex/test_model_blocks_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.blocks.attribute.vertex import ( blocks_attribute_vertex_protocols, @@ -9,11 +10,15 @@ from opengeodeweb_viewer.rpc.model.blocks.model_blocks_protocols import ( VtkModelBlocksView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + VtkModelBlocksAttributeVertexView = ( blocks_attribute_vertex_protocols.VtkModelBlocksAttributeVertexView ) diff --git a/tests/model/blocks/test_model_blocks_protocols.py b/tests/model/blocks/test_model_blocks_protocols.py index 1026c6ac..947a67bf 100644 --- a/tests/model/blocks/test_model_blocks_protocols.py +++ b/tests/model/blocks/test_model_blocks_protocols.py @@ -1,16 +1,21 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.blocks.model_blocks_protocols import ( VtkModelBlocksView, ) from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/corners/attribute/vertex/test_model_corners_attribute_vertex_protocols.py b/tests/model/corners/attribute/vertex/test_model_corners_attribute_vertex_protocols.py index 148837cb..e8d2bf80 100644 --- a/tests/model/corners/attribute/vertex/test_model_corners_attribute_vertex_protocols.py +++ b/tests/model/corners/attribute/vertex/test_model_corners_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.corners.attribute.vertex import ( corners_attribute_vertex_protocols, @@ -9,11 +10,15 @@ from opengeodeweb_viewer.rpc.model.corners.model_corners_protocols import ( VtkModelCornersView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + VtkModelCornersAttributeVertexView = ( corners_attribute_vertex_protocols.VtkModelCornersAttributeVertexView ) diff --git a/tests/model/corners/test_model_corners_protocols.py b/tests/model/corners/test_model_corners_protocols.py index c09865ec..ec7f9deb 100644 --- a/tests/model/corners/test_model_corners_protocols.py +++ b/tests/model/corners/test_model_corners_protocols.py @@ -1,15 +1,20 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.corners.model_corners_protocols import ( VtkModelCornersView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/edges/test_model_edges_protocols.py b/tests/model/edges/test_model_edges_protocols.py index 48da9422..691b986c 100644 --- a/tests/model/edges/test_model_edges_protocols.py +++ b/tests/model/edges/test_model_edges_protocols.py @@ -1,15 +1,20 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.edges.model_edges_protocols import ( VtkModelEdgesView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/lines/attribute/edge/test_model_lines_attribute_edge_protocols.py b/tests/model/lines/attribute/edge/test_model_lines_attribute_edge_protocols.py index f81346e0..56d9d3ae 100644 --- a/tests/model/lines/attribute/edge/test_model_lines_attribute_edge_protocols.py +++ b/tests/model/lines/attribute/edge/test_model_lines_attribute_edge_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.lines.attribute.edge.lines_attribute_edge_protocols import ( VtkModelLinesAttributeEdgeView, @@ -9,11 +10,15 @@ from opengeodeweb_viewer.rpc.model.lines.model_lines_protocols import ( VtkModelLinesView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/lines/attribute/vertex/test_model_lines_attribute_vertex_protocols.py b/tests/model/lines/attribute/vertex/test_model_lines_attribute_vertex_protocols.py index 15583d9f..ba95ef23 100644 --- a/tests/model/lines/attribute/vertex/test_model_lines_attribute_vertex_protocols.py +++ b/tests/model/lines/attribute/vertex/test_model_lines_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.lines.attribute.vertex.lines_attribute_vertex_protocols import ( VtkModelLinesAttributeVertexView, @@ -9,11 +10,15 @@ from opengeodeweb_viewer.rpc.model.lines.model_lines_protocols import ( VtkModelLinesView, ) -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/lines/test_model_lines_protocols.py b/tests/model/lines/test_model_lines_protocols.py index 62416c66..6f812718 100644 --- a/tests/model/lines/test_model_lines_protocols.py +++ b/tests/model/lines/test_model_lines_protocols.py @@ -1,16 +1,21 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.lines.model_lines_protocols import ( VtkModelLinesView, ) from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/points/test_model_points_protocols.py b/tests/model/points/test_model_points_protocols.py index 75bcf5d2..e17a4721 100644 --- a/tests/model/points/test_model_points_protocols.py +++ b/tests/model/points/test_model_points_protocols.py @@ -1,7 +1,8 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.lines.points.model_lines_points_protocols import ( VtkModelLinesPointsView, ) @@ -18,11 +19,15 @@ VtkModelSurfacesPointsView, ) from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_model_cube_side_view, test_register_model +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + VtkModelSurfacesPointsAttributeVertexView = ( surfaces_points_attribute_vertex_protocols.VtkModelSurfacesPointsAttributeVertexView ) diff --git a/tests/model/surfaces/attribute/polygon/test_model_surfaces_attribute_polygon_protocols.py b/tests/model/surfaces/attribute/polygon/test_model_surfaces_attribute_polygon_protocols.py index 8c88dd5a..586f2fd2 100644 --- a/tests/model/surfaces/attribute/polygon/test_model_surfaces_attribute_polygon_protocols.py +++ b/tests/model/surfaces/attribute/polygon/test_model_surfaces_attribute_polygon_protocols.py @@ -1,7 +1,7 @@ # Standard library imports import os -from collections.abc import Callable from pathlib import Path +from typing import TYPE_CHECKING from vtkmodules.vtkCommonCore import vtkDoubleArray @@ -17,7 +17,11 @@ ) # Local application imports -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor VtkModelSurfacesAttributePolygonView = ( surfaces_attribute_polygon_protocols.VtkModelSurfacesAttributePolygonView diff --git a/tests/model/surfaces/attribute/vertex/test_model_surfaces_attribute_vertex_protocols.py b/tests/model/surfaces/attribute/vertex/test_model_surfaces_attribute_vertex_protocols.py index 3b247791..7c8a71dc 100644 --- a/tests/model/surfaces/attribute/vertex/test_model_surfaces_attribute_vertex_protocols.py +++ b/tests/model/surfaces/attribute/vertex/test_model_surfaces_attribute_vertex_protocols.py @@ -1,5 +1,6 @@ # Standard library imports -from collections.abc import Callable + +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.surfaces.attribute.vertex import ( surfaces_attribute_vertex_protocols, @@ -11,12 +12,16 @@ ) # Local application imports -from tests.conftest import ServerMonitor from tests.model.test_model_protocols import ( test_register_model_cube, test_register_model_implicit_attribute, ) +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + VtkModelSurfacesAttributeVertexView = ( surfaces_attribute_vertex_protocols.VtkModelSurfacesAttributeVertexView ) diff --git a/tests/model/surfaces/test_model_surfaces_protocols.py b/tests/model/surfaces/test_model_surfaces_protocols.py index e99b76c6..ac95e1be 100644 --- a/tests/model/surfaces/test_model_surfaces_protocols.py +++ b/tests/model/surfaces/test_model_surfaces_protocols.py @@ -1,16 +1,21 @@ # Standard library imports -from collections.abc import Callable # Third party imports +from typing import TYPE_CHECKING + from opengeodeweb_viewer.rpc.model.surfaces.model_surfaces_protocols import ( VtkModelSurfacesView, ) from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.model.test_model_protocols import test_register_model_cube +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/model/test_model_protocols.py b/tests/model/test_model_protocols.py index 938c6265..cafecf11 100644 --- a/tests/model/test_model_protocols.py +++ b/tests/model/test_model_protocols.py @@ -1,11 +1,15 @@ -from collections.abc import Callable +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.model.blocks.model_blocks_protocols import ( VtkModelBlocksView, ) from opengeodeweb_viewer.rpc.model.model_protocols import VtkModelView from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor # Local constants model_id = "12345678901234567890123456789012" diff --git a/tests/test_generic_protocols.py b/tests/test_generic_protocols.py index 81b592be..f623026b 100644 --- a/tests/test_generic_protocols.py +++ b/tests/test_generic_protocols.py @@ -1,7 +1,11 @@ -from collections.abc import Callable +from typing import TYPE_CHECKING from opengeodeweb_viewer.rpc.generic.generic_protocols import VtkGenericView -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor def test_register_mesh(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: diff --git a/tests/test_utils_protocols.py b/tests/test_utils_protocols.py index 5c22aced..84a21467 100644 --- a/tests/test_utils_protocols.py +++ b/tests/test_utils_protocols.py @@ -1,4 +1,4 @@ -from collections.abc import Callable +from typing import TYPE_CHECKING from opengeodeweb_microservice.database.connection import get_session from opengeodeweb_microservice.database.data import Data @@ -6,7 +6,11 @@ from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView from opengeodeweb_viewer.rpc.utils_protocols import VtkUtilsView from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor + +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor def test_reset_project_after_import( diff --git a/tests/test_viewer_protocols.py b/tests/test_viewer_protocols.py index 8231768d..4fd91bd8 100644 --- a/tests/test_viewer_protocols.py +++ b/tests/test_viewer_protocols.py @@ -1,8 +1,7 @@ import logging +from typing import TYPE_CHECKING # Standard library imports -from collections.abc import Callable - import pytest from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView @@ -10,11 +9,15 @@ # Third party imports # Local application imports from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView -from tests.conftest import ServerMonitor # Local application imports from tests.mesh.test_mesh_protocols import test_register_mesh +if TYPE_CHECKING: + from collections.abc import Callable + + from tests.conftest import ServerMonitor + # Local constants logger = logging.getLogger(__name__)