diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8dd45bba98..41ef0777d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,7 @@ jobs: run: poetry run pytest --cov=. --cov-report=xml if: matrix.python-version == '3.10' - uses: actions-rs/toolchain@v1 - name: Install latest nightly + name: Install Rust toolchain with: toolchain: stable profile: minimal diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 573cf5e3de..8c5017051f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,24 +66,24 @@ repos: "flake8-simplify", "flake8-type-checking", ] - - repo: https://github.com/ariebovenberg/slotscheck - rev: v0.14.1 - hooks: - - id: slotscheck - exclude: "^(?!starlite/)" - additional_dependencies: - [ - openapi_schema_pydantic, - orjson, - pydantic, - pydantic_factories, - pyyaml, - starlette, - sqlalchemy, - requests, - jinja2, - mako, - ] + # - repo: https://github.com/ariebovenberg/slotscheck + # rev: v0.14.1 + # hooks: + # - id: slotscheck + # exclude: "^(?!starlite/)" + # additional_dependencies: + # [ + # openapi_schema_pydantic, + # orjson, + # pydantic, + # pydantic_factories, + # pyyaml, + # starlette, + # sqlalchemy, + # requests, + # jinja2, + # mako, + # ] - repo: https://github.com/pycqa/pylint rev: "v2.14.5" hooks: diff --git a/Cargo.toml b/Cargo.toml index d7cac306a6..46e85d462d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] path = "extensions/route_map/lib.rs" [dependencies] -pyo3 = { version = "*" } +pyo3 = { version = "0.16.5" } [features] extension-module = ["pyo3/extension-module"] diff --git a/starlite/app.py b/starlite/app.py index 172a6b37bd..1e32a98ff1 100644 --- a/starlite/app.py +++ b/starlite/app.py @@ -24,7 +24,9 @@ from starlite.plugins.base import PluginProtocol from starlite.provide import Provide from starlite.response import Response -from starlite.route_map import RouteMap +from starlite.route_map import ( # pylint: disable=import-error, no-name-in-module + RouteMap, +) from starlite.router import Router from starlite.routes import ASGIRoute, BaseRoute, HTTPRoute, WebSocketRoute from starlite.signature import SignatureModelFactory diff --git a/starlite/route_map.py b/starlite/route_map.pyi similarity index 99% rename from starlite/route_map.py rename to starlite/route_map.pyi index 5f50b10309..47cc794a07 100644 --- a/starlite/route_map.py +++ b/starlite/route_map.pyi @@ -11,39 +11,32 @@ from starlite.routes import BaseRoute - class RouteMap: # pragma: no cover def __init__(self, debug: bool = False): """ Create a new RouteMap """ - def add_static_path(self, path: str) -> None: """ Adds a new static path by path name """ - def is_static_path(self, path: str) -> bool: """ Checks if a given path refers to a static path """ - def remove_static_path(self, path: str) -> bool: """ Removes a path from the static path set :return: True if the path was removed, False otherwise """ - def add_routes(self, routes: Sequence["BaseRoute"]) -> None: """ Add routes to the map """ - def resolve_asgi_app(self, scope: "Scope") -> "ASGIApp": """ Given a scope, retrieves the correct ASGI App for the route """ - def traverse_to_dict(self, path: str) -> Dict[str, Any]: """ Given a path, traverses the route map to find the corresponding trie node and returns it as a Dict