Skip to content

Commit

Permalink
addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Jul 30, 2022
1 parent 1201788 commit 71bbe8a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 3 additions & 1 deletion starlite/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions starlite/route_map.py → starlite/route_map.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71bbe8a

Please sign in to comment.