Rename the package roledesk to app
The boilerplate's rule: the deploy kit's Dockerfile, the APP_CONFIG, APP_PASSWORD and APP_DATA variables and its commands all assume a package called app, so a project renames its display title and nothing else. The console script is `app`, and the launch entry runs `uv run app serve --port 8790`. The domain noun stays `role`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
248ea1636d
commit
7a63311714
32 files changed
+102
-98
No files matched your search
@@ -0,0 +1,27 @@
|
||||
"""How a route reaches the store.
|
||||
|
||||
Built once by the app's factory and parked on `app.state`; a route asks for
|
||||
it as a dependency rather than closing over it, the same split newsdesk's
|
||||
`web/deps.py` makes and for the same reason — a router module stays
|
||||
importable, and testable, on its own.
|
||||
|
||||
Not a `yield` dependency: `Store` holds no connection between calls (see
|
||||
`app/storage/store.py`), so there is nothing to close, and building one
|
||||
per request would take SQLite's write lock for a plain read.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import Depends
|
||||
from starlette.requests import HTTPConnection
|
||||
|
||||
from app.storage import Store
|
||||
|
||||
|
||||
def get_store(request: HTTPConnection) -> Store:
|
||||
return request.app.state.store
|
||||
|
||||
|
||||
StoreDep = Annotated[Store, Depends(get_store)]
|
||||
Reference in new issue
Block a user