Skip to content

Commit

Permalink
chg: [type] Make mypy happy again.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Aug 1, 2024
1 parent f8cef97 commit 80edf74
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
Empty file added rstore/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions rstore/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
try:
from instance import config
except Exception:
from instance import sample as config
from instance import sample as config # type: ignore[no-redef]

security = HTTPBasic()

Expand Down Expand Up @@ -67,7 +67,7 @@ def custom_openapi() -> Dict[str, Any]:
return app.openapi_schema


app.openapi = custom_openapi
app.openapi = custom_openapi # type: ignore[method-assign]


#
Expand All @@ -79,5 +79,5 @@ def read_items(
limit: int = 100,
q: str = "",
) -> List[schemas.ItemBase]:
items = []
items: list[schemas.ItemBase] = []
return items
28 changes: 28 additions & 0 deletions rstore/schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from pydantic import BaseModel


class Payload(BaseModel):
raw: str


class Meta(BaseModel):
uuid: str
ts: int
type: str


class ScanData(BaseModel):
version: str
format: str
meta: Meta
payload: Payload

class Config:
from_attributes = True


class ItemBase(BaseModel):
scan_data: ScanData

class Config:
from_attributes = True

0 comments on commit 80edf74

Please sign in to comment.