apexdevkit 1.15.3__tar.gz → 1.15.4__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.3 → apexdevkit-1.15.4}/PKG-INFO +1 -1
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/server.py +10 -4
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/pyproject.toml +4 -2
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/LICENSE +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/README.md +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/error.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/mongo.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.15.3 → apexdevkit-1.15.4}/apexdevkit/testing/rest.py +0 -0
|
@@ -12,6 +12,10 @@ from fastapi import FastAPI
|
|
|
12
12
|
from apexdevkit.environment import environment_variable
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def _do_nothing() -> None:
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
15
19
|
@dataclass
|
|
16
20
|
class UvicornServer:
|
|
17
21
|
logging_config: dict[str, Any]
|
|
@@ -20,11 +24,11 @@ class UvicornServer:
|
|
|
20
24
|
port: int = 8000
|
|
21
25
|
path: str = ""
|
|
22
26
|
|
|
23
|
-
on_startup: Callable[[], None] = field(init=False,
|
|
27
|
+
on_startup: Callable[[], None] = field(init=False, default=_do_nothing)
|
|
24
28
|
|
|
25
29
|
@classmethod
|
|
26
|
-
def from_env(cls,
|
|
27
|
-
load_dotenv(
|
|
30
|
+
def from_env(cls, path: str = ".env") -> UvicornServer:
|
|
31
|
+
load_dotenv(path)
|
|
28
32
|
Sentry().setup()
|
|
29
33
|
|
|
30
34
|
return cls(LoggingConfig().setup().as_dict())
|
|
@@ -44,9 +48,11 @@ class UvicornServer:
|
|
|
44
48
|
|
|
45
49
|
return self
|
|
46
50
|
|
|
47
|
-
def before_run(self, execute: Callable[[], None]):
|
|
51
|
+
def before_run(self, execute: Callable[[], None]) -> UvicornServer:
|
|
48
52
|
self.on_startup = execute
|
|
49
53
|
|
|
54
|
+
return self
|
|
55
|
+
|
|
50
56
|
def run(self, api: FastAPI) -> None:
|
|
51
57
|
self.on_startup()
|
|
52
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "apexdevkit"
|
|
3
|
-
version = "1.15.
|
|
3
|
+
version = "1.15.4"
|
|
4
4
|
description = "Apex Development Tools for python."
|
|
5
5
|
authors = ["Apex Dev <dev@apex.ge>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -33,7 +33,6 @@ strict = true
|
|
|
33
33
|
exclude = [
|
|
34
34
|
"apexdevkit/fastapi/schema.py",
|
|
35
35
|
"apexdevkit/fastapi/dependable.py",
|
|
36
|
-
"apexdevkit/server.py",
|
|
37
36
|
]
|
|
38
37
|
|
|
39
38
|
[tool.ruff]
|
|
@@ -61,6 +60,9 @@ source = [
|
|
|
61
60
|
"apexdevkit",
|
|
62
61
|
"tests",
|
|
63
62
|
]
|
|
63
|
+
omit = [
|
|
64
|
+
"apexdevkit/server.py",
|
|
65
|
+
]
|
|
64
66
|
|
|
65
67
|
[tool.coverage.report]
|
|
66
68
|
skip_empty = true
|
|
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
|