apexdevkit 1.15.1__tar.gz → 1.15.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/PKG-INFO +1 -1
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/server.py +9 -2
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/pyproject.toml +1 -1
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/LICENSE +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/README.md +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/error.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/mongo.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.15.1 → apexdevkit-1.15.2}/apexdevkit/testing/rest.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging.config
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from typing import Any
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from typing import Any, Callable
|
|
6
6
|
|
|
7
7
|
import sentry_sdk
|
|
8
8
|
import uvicorn
|
|
@@ -20,6 +20,8 @@ class UvicornServer:
|
|
|
20
20
|
port: int = 8000
|
|
21
21
|
path: str = ""
|
|
22
22
|
|
|
23
|
+
on_startup: Callable[[], None] = field(init=False, default_factory=lambda: None)
|
|
24
|
+
|
|
23
25
|
@classmethod
|
|
24
26
|
def from_env(cls) -> UvicornServer:
|
|
25
27
|
load_dotenv()
|
|
@@ -42,7 +44,12 @@ class UvicornServer:
|
|
|
42
44
|
|
|
43
45
|
return self
|
|
44
46
|
|
|
47
|
+
def before_run(self, execute: Callable[[], None]):
|
|
48
|
+
self.on_startup = execute
|
|
49
|
+
|
|
45
50
|
def run(self, api: FastAPI) -> None:
|
|
51
|
+
self.on_startup()
|
|
52
|
+
|
|
46
53
|
uvicorn.run(
|
|
47
54
|
api,
|
|
48
55
|
host=self.host,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|