apexdevkit 1.23.13__tar.gz → 1.24.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.23.13 → apexdevkit-1.24.2}/PKG-INFO +4 -2
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/server.py +8 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/testing/rest.py +47 -18
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/pyproject.toml +1 -1
- apexdevkit-1.23.13/apexdevkit/fastapi/request.py +0 -31
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/LICENSE +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/README.md +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/date.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/error.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/name.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/httpx/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/httpx/client.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/httpx/hooks.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/id.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/query/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/query/generator.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/query/query.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/mssql.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/repository.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/sql.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.23.13 → apexdevkit-1.24.2}/apexdevkit/value.py +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: apexdevkit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.24.2
|
|
4
4
|
Summary: Apex Development Tools for python.
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Author: Apex Dev
|
|
6
7
|
Author-email: dev@apex.ge
|
|
7
8
|
Requires-Python: >=3.11
|
|
@@ -9,6 +10,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
14
|
Requires-Dist: fastapi
|
|
13
15
|
Requires-Dist: httpx
|
|
14
16
|
Requires-Dist: pymssql (==2.3.2)
|
|
@@ -9,6 +9,7 @@ import sentry_sdk
|
|
|
9
9
|
import uvicorn
|
|
10
10
|
from dotenv import load_dotenv
|
|
11
11
|
from fastapi import FastAPI
|
|
12
|
+
from sentry_sdk.types import Event, Hint
|
|
12
13
|
|
|
13
14
|
from apexdevkit.environment import environment_variable
|
|
14
15
|
|
|
@@ -87,6 +88,12 @@ class Sentry:
|
|
|
87
88
|
if not self.dsn:
|
|
88
89
|
return
|
|
89
90
|
|
|
91
|
+
def before_send(event: Event, _hint: Hint) -> Event | None:
|
|
92
|
+
if event.get("contexts", {}).get("response", {}).get("status_code") == 422:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
return event
|
|
96
|
+
|
|
90
97
|
sentry_sdk.init(
|
|
91
98
|
release=self.release,
|
|
92
99
|
traces_sample_rate=float(self.trace_sample_rate),
|
|
@@ -94,6 +101,7 @@ class Sentry:
|
|
|
94
101
|
_experiments={
|
|
95
102
|
"enable_logs": True,
|
|
96
103
|
},
|
|
104
|
+
before_send=before_send,
|
|
97
105
|
)
|
|
98
106
|
|
|
99
107
|
|
|
@@ -6,7 +6,6 @@ from functools import cached_property
|
|
|
6
6
|
from typing import Any, Self
|
|
7
7
|
|
|
8
8
|
from apexdevkit.fastapi.name import RestfulName
|
|
9
|
-
from apexdevkit.fastapi.request import HttpRequest
|
|
10
9
|
from apexdevkit.http import Http, HttpMethod, JsonDict
|
|
11
10
|
from apexdevkit.http.fluent import HttpResponse
|
|
12
11
|
|
|
@@ -123,39 +122,42 @@ class _RestResource:
|
|
|
123
122
|
)
|
|
124
123
|
|
|
125
124
|
|
|
126
|
-
@dataclass
|
|
125
|
+
@dataclass(frozen=True)
|
|
127
126
|
class _TestRequest:
|
|
128
127
|
resource: RestfulName
|
|
129
128
|
request: HttpRequest
|
|
130
129
|
|
|
131
|
-
def with_id(self, value: Any) ->
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
def with_id(self, value: Any) -> _TestRequest:
|
|
131
|
+
return _TestRequest(
|
|
132
|
+
resource=self.resource,
|
|
133
|
+
request=self.request.with_endpoint(value),
|
|
134
|
+
)
|
|
135
135
|
|
|
136
|
-
def from_collection(self, value: list[JsonDict]) ->
|
|
136
|
+
def from_collection(self, value: list[JsonDict]) -> _TestRequest:
|
|
137
137
|
return self.with_data(
|
|
138
138
|
JsonDict({self.resource.plural: [dict(item) for item in value]})
|
|
139
139
|
)
|
|
140
140
|
|
|
141
|
-
def and_data(self, value: JsonDict) ->
|
|
141
|
+
def and_data(self, value: JsonDict) -> _TestRequest:
|
|
142
142
|
return self.with_data(value)
|
|
143
143
|
|
|
144
|
-
def from_data(self, value: JsonDict) ->
|
|
144
|
+
def from_data(self, value: JsonDict) -> _TestRequest:
|
|
145
145
|
return self.with_data(value)
|
|
146
146
|
|
|
147
|
-
def with_data(self, value: JsonDict) ->
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
def with_data(self, value: JsonDict) -> _TestRequest:
|
|
148
|
+
return _TestRequest(
|
|
149
|
+
resource=self.resource,
|
|
150
|
+
request=self.request.with_json(value),
|
|
151
|
+
)
|
|
151
152
|
|
|
152
|
-
def and_param(self, name: str, value: Any) ->
|
|
153
|
+
def and_param(self, name: str, value: Any) -> _TestRequest:
|
|
153
154
|
return self.with_param(name, value)
|
|
154
155
|
|
|
155
|
-
def with_param(self, name: str, value: Any) ->
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
def with_param(self, name: str, value: Any) -> _TestRequest:
|
|
157
|
+
return _TestRequest(
|
|
158
|
+
resource=self.resource,
|
|
159
|
+
request=self.request.with_param(name, str(value)),
|
|
160
|
+
)
|
|
159
161
|
|
|
160
162
|
@cached_property
|
|
161
163
|
def response(self) -> HttpResponse:
|
|
@@ -177,6 +179,33 @@ class _TestRequest:
|
|
|
177
179
|
)
|
|
178
180
|
|
|
179
181
|
|
|
182
|
+
@dataclass(frozen=True)
|
|
183
|
+
class HttpRequest:
|
|
184
|
+
method: HttpMethod
|
|
185
|
+
http: Http
|
|
186
|
+
|
|
187
|
+
def with_endpoint(self, value: Any) -> HttpRequest:
|
|
188
|
+
return HttpRequest(
|
|
189
|
+
method=self.method,
|
|
190
|
+
http=self.http.with_endpoint(str(value)),
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
def with_param(self, name: str, value: Any) -> HttpRequest:
|
|
194
|
+
return HttpRequest(
|
|
195
|
+
method=self.method,
|
|
196
|
+
http=self.http.with_param(name, value),
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
def with_json(self, value: JsonDict) -> HttpRequest:
|
|
200
|
+
return HttpRequest(
|
|
201
|
+
method=self.method,
|
|
202
|
+
http=self.http.with_json(value),
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
def __call__(self) -> HttpResponse:
|
|
206
|
+
return self.http.request(self.method)
|
|
207
|
+
|
|
208
|
+
|
|
180
209
|
@dataclass
|
|
181
210
|
class _Response:
|
|
182
211
|
resource: RestfulName
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from apexdevkit.http import Http, HttpMethod, JsonDict
|
|
7
|
-
from apexdevkit.http.fluent import HttpResponse
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass
|
|
11
|
-
class HttpRequest:
|
|
12
|
-
method: HttpMethod
|
|
13
|
-
http: Http
|
|
14
|
-
|
|
15
|
-
def with_endpoint(self, value: Any) -> HttpRequest:
|
|
16
|
-
self.http = self.http.with_endpoint(str(value))
|
|
17
|
-
|
|
18
|
-
return self
|
|
19
|
-
|
|
20
|
-
def with_param(self, name: str, value: Any) -> HttpRequest:
|
|
21
|
-
self.http = self.http.with_param(name, value)
|
|
22
|
-
|
|
23
|
-
return self
|
|
24
|
-
|
|
25
|
-
def with_json(self, value: JsonDict) -> HttpRequest:
|
|
26
|
-
self.http = self.http.with_json(value)
|
|
27
|
-
|
|
28
|
-
return self
|
|
29
|
-
|
|
30
|
-
def __call__(self) -> HttpResponse:
|
|
31
|
-
return self.http.request(self.method)
|
|
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
|
|
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
|