kover 3.2.0__tar.gz → 3.2.1__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.
- {kover-3.2.0 → kover-3.2.1}/PKG-INFO +17 -32
- {kover-3.2.0 → kover-3.2.1}/README.md +14 -29
- {kover-3.2.0 → kover-3.2.1}/docs/architecture.md +1 -1
- {kover-3.2.0 → kover-3.2.1}/docs/documents.md +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/__version__.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/bootstrap.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/collection.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/cursor.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/gridfs/gridfs.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/gridfs/models.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/models/replica_set.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/models/user.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/network/auth/scram.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/network/connection.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/network/factory.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/codec.py +3 -3
- {kover-3.2.0 → kover-3.2.1}/kover/schema/document.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/kover/schema/generator.py +3 -3
- {kover-3.2.0 → kover-3.2.1}/kover/session.py +1 -1
- {kover-3.2.0 → kover-3.2.1}/pyproject.toml +2 -11
- {kover-3.2.0 → kover-3.2.1}/.gitignore +0 -0
- {kover-3.2.0 → kover-3.2.1}/CODE_OF_CONDUCT.md +0 -0
- {kover-3.2.0 → kover-3.2.1}/LICENSE +0 -0
- {kover-3.2.0 → kover-3.2.1}/docs/connections.md +0 -0
- {kover-3.2.0 → kover-3.2.1}/docs/development.md +0 -0
- {kover-3.2.0 → kover-3.2.1}/docs/read_preferences.md +0 -0
- {kover-3.2.0 → kover-3.2.1}/docs/transactions.md +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/_utils/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/_utils/mappings.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/_utils/protocols.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/_utils/representation.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/bulk_write_builder.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/client.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/configuration/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/configuration/environment.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/database.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/error_codes.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/exceptions.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/context.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/executor.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/preparation.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/protocols.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/execution/router.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/gridfs/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/gridfs/annotations.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/gridfs/exceptions.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/address.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/collation.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/collection.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/concerns.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/credentials.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/hello.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/indexes.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/operations.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/options.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/parsed_uri.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/read_preference.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/server.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/topology.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/models/tx_state.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/auth/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/auth/authenticator.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/lease.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/pool.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/probe.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/registry.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/transport.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/uri_parser/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/uri_parser/hosts.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/uri_parser/srv.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/uri_parser/uri.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/uri_parser/uri_options.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/compression.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/error_codes.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/error_mapper.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/network/wire/handshake.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/policies/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/policies/commands.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/policies/routing.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/py.typed +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/schema/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/schema/_pipeline.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/topology/__init__.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/topology/discovery.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/topology/protocols.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/topology/selector.py +0 -0
- {kover-3.2.0 → kover-3.2.1}/kover/topology/state.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: kover
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.1
|
|
4
4
|
Summary: A fully asynchronous, strongly typed MongoDB driver for Python.
|
|
5
5
|
Project-URL: Homepage, https://github.com/megawattka/kover
|
|
6
6
|
Project-URL: Repository, https://github.com/megawattka/kover
|
|
@@ -9,7 +9,7 @@ Project-URL: Changelog, https://github.com/megawattka/kover/releases
|
|
|
9
9
|
Author-email: megawattka <gunter56741@gmail.com>
|
|
10
10
|
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Keywords: async,asyncio,
|
|
12
|
+
Keywords: async,asyncio,database,driver,mongodb,odm,pymongo
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Framework :: AsyncIO
|
|
15
15
|
Classifier: Framework :: Pydantic :: 2
|
|
@@ -23,8 +23,8 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
23
23
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
24
24
|
Classifier: Typing :: Typed
|
|
25
25
|
Requires-Python: >=3.12
|
|
26
|
-
Requires-Dist: bson>=0.4.0
|
|
27
26
|
Requires-Dist: dnspython>=2.7.0
|
|
27
|
+
Requires-Dist: elune>=0.5.0
|
|
28
28
|
Requires-Dist: pydantic>=2.14.3
|
|
29
29
|
Requires-Dist: typing-extensions>=4.16.0
|
|
30
30
|
Provides-Extra: snappy
|
|
@@ -78,31 +78,17 @@ Runtime dependencies:
|
|
|
78
78
|
|
|
79
79
|
| Dependency | Minimum version |
|
|
80
80
|
| --- | --- |
|
|
81
|
-
| `
|
|
81
|
+
| `elune` | `0.5.0` |
|
|
82
82
|
| `dnspython` | `2.7.0` |
|
|
83
83
|
| `pydantic` | `2.14.3` |
|
|
84
84
|
| `typing-extensions` | `4.16.0` |
|
|
85
85
|
|
|
86
|
-
Kover uses
|
|
87
|
-
including its native Pydantic integration.
|
|
88
|
-
it: both provide the `bson` import namespace.
|
|
86
|
+
Kover uses [Elune](https://github.com/megawattka/elune) for BSON serialization,
|
|
87
|
+
including its native Pydantic integration.
|
|
89
88
|
|
|
90
89
|
## Installation
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```toml
|
|
95
|
-
[tool.uv.sources]
|
|
96
|
-
bson = { index = "bson" }
|
|
97
|
-
|
|
98
|
-
[[tool.uv.index]]
|
|
99
|
-
name = "bson"
|
|
100
|
-
url = "https://python.wattka.dev/"
|
|
101
|
-
explicit = true
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
For a separate application using uv, include the same BSON source/index mapping
|
|
105
|
-
in its `pyproject.toml`, then add Kover:
|
|
91
|
+
Install Kover using uv:
|
|
106
92
|
|
|
107
93
|
```bash
|
|
108
94
|
uv add kover
|
|
@@ -110,8 +96,7 @@ uv add kover
|
|
|
110
96
|
uv add "kover[snappy,zstd]"
|
|
111
97
|
```
|
|
112
98
|
|
|
113
|
-
`zlib` compression needs no extra dependency.
|
|
114
|
-
for packages mapped to it, rather than as a general package source.
|
|
99
|
+
`zlib` compression needs no extra dependency.
|
|
115
100
|
|
|
116
101
|
## Quick start
|
|
117
102
|
|
|
@@ -281,7 +266,7 @@ Native UUIDs require an explicit BSON representation. Use this client for the
|
|
|
281
266
|
`User` schema and CRUD examples below:
|
|
282
267
|
|
|
283
268
|
```python
|
|
284
|
-
from
|
|
269
|
+
from elune import CodecOptions, UuidRepresentation
|
|
285
270
|
|
|
286
271
|
from kover import from_uri
|
|
287
272
|
|
|
@@ -306,7 +291,7 @@ UUIDs as binary subtype 4 and decodes them back to `UUID`. The default
|
|
|
306
291
|
| `Model.model_mongodb_schema()` | Generate a `{"$jsonSchema": ...}` validator |
|
|
307
292
|
|
|
308
293
|
```python
|
|
309
|
-
from
|
|
294
|
+
from elune import ObjectId
|
|
310
295
|
|
|
311
296
|
user = User(username="alice", age=27)
|
|
312
297
|
assert user.object_id is None
|
|
@@ -324,9 +309,9 @@ automatically converted to camelCase: declare aliases explicitly, as with
|
|
|
324
309
|
`externalId` above.
|
|
325
310
|
See [documents and serialization](docs/documents.md) for details.
|
|
326
311
|
|
|
327
|
-
Use Python-mode dumps for BSON, not `model_dump(mode="json")`.
|
|
328
|
-
Pydantic integration preserves BSON instances in Python mode.
|
|
329
|
-
globally patch
|
|
312
|
+
Use Python-mode dumps for BSON, not `model_dump(mode="json")`. Elune's native
|
|
313
|
+
Pydantic integration preserves BSON instances in Python mode.
|
|
314
|
+
Kover does not globally patch Elune's classes or `uuid.UUID`.
|
|
330
315
|
|
|
331
316
|
### Decimal values
|
|
332
317
|
|
|
@@ -335,10 +320,10 @@ produces a `decimal` schema, but `model_dump()` retains the Python `Decimal`;
|
|
|
335
320
|
it needs a codec or explicit conversion for BSON encoding.
|
|
336
321
|
|
|
337
322
|
For domain models using `Decimal`, prefer the `DecimalCodec` example in the
|
|
338
|
-
[
|
|
323
|
+
[Elune README](https://github.com/megawattka/elune#custom-codecs) over manual
|
|
339
324
|
conversion or model serializers. Define that codec in your application and
|
|
340
325
|
register it with `CodecOptions(type_registry=TypeRegistry([DecimalCodec()]))`
|
|
341
|
-
(`CodecOptions` and `TypeRegistry` are imported from `
|
|
326
|
+
(`CodecOptions` and `TypeRegistry` are imported from `elune.codec_options`).
|
|
342
327
|
Pass these options as `codec_options=` to `from_uri()` or `make_client()`;
|
|
343
328
|
if you also use UUIDs, include their representation in the same options.
|
|
344
329
|
The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
@@ -346,12 +331,12 @@ The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
|
346
331
|
fit the precision and range of Decimal128. `DecimalCodec` is an example to
|
|
347
332
|
define, not a built-in class to import.
|
|
348
333
|
|
|
349
|
-
Alternatively, use `
|
|
334
|
+
Alternatively, use `elune.Decimal128` directly for stored values:
|
|
350
335
|
|
|
351
336
|
```python
|
|
352
337
|
from decimal import Decimal
|
|
353
338
|
|
|
354
|
-
from
|
|
339
|
+
from elune import Decimal128
|
|
355
340
|
|
|
356
341
|
from kover import Document
|
|
357
342
|
|
|
@@ -43,31 +43,17 @@ Runtime dependencies:
|
|
|
43
43
|
|
|
44
44
|
| Dependency | Minimum version |
|
|
45
45
|
| --- | --- |
|
|
46
|
-
| `
|
|
46
|
+
| `elune` | `0.5.0` |
|
|
47
47
|
| `dnspython` | `2.7.0` |
|
|
48
48
|
| `pydantic` | `2.14.3` |
|
|
49
49
|
| `typing-extensions` | `4.16.0` |
|
|
50
50
|
|
|
51
|
-
Kover uses
|
|
52
|
-
including its native Pydantic integration.
|
|
53
|
-
it: both provide the `bson` import namespace.
|
|
51
|
+
Kover uses [Elune](https://github.com/megawattka/elune) for BSON serialization,
|
|
52
|
+
including its native Pydantic integration.
|
|
54
53
|
|
|
55
54
|
## Installation
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```toml
|
|
60
|
-
[tool.uv.sources]
|
|
61
|
-
bson = { index = "bson" }
|
|
62
|
-
|
|
63
|
-
[[tool.uv.index]]
|
|
64
|
-
name = "bson"
|
|
65
|
-
url = "https://python.wattka.dev/"
|
|
66
|
-
explicit = true
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
For a separate application using uv, include the same BSON source/index mapping
|
|
70
|
-
in its `pyproject.toml`, then add Kover:
|
|
56
|
+
Install Kover using uv:
|
|
71
57
|
|
|
72
58
|
```bash
|
|
73
59
|
uv add kover
|
|
@@ -75,8 +61,7 @@ uv add kover
|
|
|
75
61
|
uv add "kover[snappy,zstd]"
|
|
76
62
|
```
|
|
77
63
|
|
|
78
|
-
`zlib` compression needs no extra dependency.
|
|
79
|
-
for packages mapped to it, rather than as a general package source.
|
|
64
|
+
`zlib` compression needs no extra dependency.
|
|
80
65
|
|
|
81
66
|
## Quick start
|
|
82
67
|
|
|
@@ -246,7 +231,7 @@ Native UUIDs require an explicit BSON representation. Use this client for the
|
|
|
246
231
|
`User` schema and CRUD examples below:
|
|
247
232
|
|
|
248
233
|
```python
|
|
249
|
-
from
|
|
234
|
+
from elune import CodecOptions, UuidRepresentation
|
|
250
235
|
|
|
251
236
|
from kover import from_uri
|
|
252
237
|
|
|
@@ -271,7 +256,7 @@ UUIDs as binary subtype 4 and decodes them back to `UUID`. The default
|
|
|
271
256
|
| `Model.model_mongodb_schema()` | Generate a `{"$jsonSchema": ...}` validator |
|
|
272
257
|
|
|
273
258
|
```python
|
|
274
|
-
from
|
|
259
|
+
from elune import ObjectId
|
|
275
260
|
|
|
276
261
|
user = User(username="alice", age=27)
|
|
277
262
|
assert user.object_id is None
|
|
@@ -289,9 +274,9 @@ automatically converted to camelCase: declare aliases explicitly, as with
|
|
|
289
274
|
`externalId` above.
|
|
290
275
|
See [documents and serialization](docs/documents.md) for details.
|
|
291
276
|
|
|
292
|
-
Use Python-mode dumps for BSON, not `model_dump(mode="json")`.
|
|
293
|
-
Pydantic integration preserves BSON instances in Python mode.
|
|
294
|
-
globally patch
|
|
277
|
+
Use Python-mode dumps for BSON, not `model_dump(mode="json")`. Elune's native
|
|
278
|
+
Pydantic integration preserves BSON instances in Python mode.
|
|
279
|
+
Kover does not globally patch Elune's classes or `uuid.UUID`.
|
|
295
280
|
|
|
296
281
|
### Decimal values
|
|
297
282
|
|
|
@@ -300,10 +285,10 @@ produces a `decimal` schema, but `model_dump()` retains the Python `Decimal`;
|
|
|
300
285
|
it needs a codec or explicit conversion for BSON encoding.
|
|
301
286
|
|
|
302
287
|
For domain models using `Decimal`, prefer the `DecimalCodec` example in the
|
|
303
|
-
[
|
|
288
|
+
[Elune README](https://github.com/megawattka/elune#custom-codecs) over manual
|
|
304
289
|
conversion or model serializers. Define that codec in your application and
|
|
305
290
|
register it with `CodecOptions(type_registry=TypeRegistry([DecimalCodec()]))`
|
|
306
|
-
(`CodecOptions` and `TypeRegistry` are imported from `
|
|
291
|
+
(`CodecOptions` and `TypeRegistry` are imported from `elune.codec_options`).
|
|
307
292
|
Pass these options as `codec_options=` to `from_uri()` or `make_client()`;
|
|
308
293
|
if you also use UUIDs, include their representation in the same options.
|
|
309
294
|
The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
@@ -311,12 +296,12 @@ The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
|
311
296
|
fit the precision and range of Decimal128. `DecimalCodec` is an example to
|
|
312
297
|
define, not a built-in class to import.
|
|
313
298
|
|
|
314
|
-
Alternatively, use `
|
|
299
|
+
Alternatively, use `elune.Decimal128` directly for stored values:
|
|
315
300
|
|
|
316
301
|
```python
|
|
317
302
|
from decimal import Decimal
|
|
318
303
|
|
|
319
|
-
from
|
|
304
|
+
from elune import Decimal128
|
|
320
305
|
|
|
321
306
|
from kover import Document
|
|
322
307
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Architecture
|
|
2
2
|
|
|
3
3
|
Kover is a Python 3.12+ `asyncio` MongoDB driver. It uses asyncio streams for
|
|
4
|
-
network I/O, Pydantic v2 for models,
|
|
4
|
+
network I/O, Pydantic v2 for models, Elune for BSON serialization, and
|
|
5
5
|
its own URI parser with asynchronous dnspython SRV/TXT discovery.
|
|
6
6
|
Application commands are not delegated to a PyMongo client or a thread pool;
|
|
7
7
|
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
from collections import deque
|
|
6
6
|
from typing import TYPE_CHECKING, Any, NoReturn, Self, cast
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from elune import Int64
|
|
9
9
|
|
|
10
10
|
from ._utils.mappings import maybe_to_dict
|
|
11
11
|
from .execution.context import CommandReply
|
|
@@ -9,7 +9,7 @@ import math
|
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
from typing import TYPE_CHECKING, Any, Final, Self
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from elune import Binary, ObjectId
|
|
13
13
|
|
|
14
14
|
from ..models import Delete, Index, IndexDirection
|
|
15
15
|
from .exceptions import GridFSFileNotFound, IncorrectGridFSData
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import datetime as dt # ruff: ignore[typing-only-standard-library-import]
|
|
6
6
|
from typing import Annotated
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from elune import Binary, ObjectId # ruff: ignore[typing-only-third-party-import]
|
|
9
9
|
from pydantic import Field
|
|
10
10
|
|
|
11
11
|
from ..schema.document import Document
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from elune import ObjectId # ruff: ignore[typing-only-third-party-import]
|
|
8
8
|
from pydantic import BaseModel, ConfigDict, Field
|
|
9
9
|
|
|
10
10
|
|
|
@@ -11,7 +11,7 @@ from .wire.codec import CommandCodec
|
|
|
11
11
|
from .wire.compression import ZLIB_COMPRESSOR_ID, get_context_by_id
|
|
12
12
|
|
|
13
13
|
if TYPE_CHECKING:
|
|
14
|
-
from
|
|
14
|
+
from elune import CodecOptions
|
|
15
15
|
|
|
16
16
|
from ..models.address import Address
|
|
17
17
|
from ..models.credentials import AuthCredentials
|
|
@@ -5,15 +5,15 @@ from __future__ import annotations
|
|
|
5
5
|
import struct
|
|
6
6
|
from typing import TYPE_CHECKING, Any, Final
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from elune import decode, encode
|
|
9
|
+
from elune.codec_options import DEFAULT_CODEC_OPTIONS
|
|
10
10
|
|
|
11
11
|
from .compression import ZLIB_COMPRESSOR_ID, get_context_by_id
|
|
12
12
|
|
|
13
13
|
if TYPE_CHECKING:
|
|
14
14
|
from collections.abc import Mapping
|
|
15
15
|
|
|
16
|
-
from
|
|
16
|
+
from elune.codec_options import CodecOptions
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
OP_MSG: Final[int] = 2013
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from elune import ObjectId # ruff: ignore[typing-only-third-party-import]
|
|
8
8
|
from pydantic import (
|
|
9
9
|
BaseModel,
|
|
10
10
|
ConfigDict,
|
|
@@ -6,7 +6,7 @@ from collections.abc import Callable
|
|
|
6
6
|
from functools import cached_property
|
|
7
7
|
from typing import TYPE_CHECKING, Any, cast, override
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from elune import (
|
|
10
10
|
Binary,
|
|
11
11
|
Code,
|
|
12
12
|
DatetimeMS,
|
|
@@ -42,7 +42,7 @@ if TYPE_CHECKING:
|
|
|
42
42
|
def _core_contract(value: Any) -> Any: # ruff: ignore[any-type]
|
|
43
43
|
"""Compare native BSON core contracts, not ambiguous JSON wire shapes.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Elune creates fresh Rust validator closures on every schema request.
|
|
46
46
|
Their names and the surrounding core schemas are stable; their identities
|
|
47
47
|
are not. Metadata and refs belong to the use site, not the type contract.
|
|
48
48
|
|
|
@@ -72,7 +72,7 @@ def _core_contract(value: Any) -> Any: # ruff: ignore[any-type]
|
|
|
72
72
|
class MongoDBSchemaGenerator(GenerateJsonSchema):
|
|
73
73
|
"""Generate strict MongoDB validators through copy-on-transform stages.
|
|
74
74
|
|
|
75
|
-
Native BSON core schemas are adapted locally, leaving
|
|
75
|
+
Native BSON core schemas are adapted locally, leaving Elune's Pydantic
|
|
76
76
|
validation and serialization untouched. References are expanded before
|
|
77
77
|
normalization, type mapping and compatibility checking. Unsupported
|
|
78
78
|
constraints raise ``SchemaGenerationException`` instead of disappearing.
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kover"
|
|
7
|
-
version = "3.2.
|
|
7
|
+
version = "3.2.1"
|
|
8
8
|
description = "A fully asynchronous, strongly typed MongoDB driver for Python."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "megawattka", email = "gunter56741@gmail.com" }]
|
|
@@ -18,7 +18,6 @@ keywords = [
|
|
|
18
18
|
"database",
|
|
19
19
|
"driver",
|
|
20
20
|
"pymongo",
|
|
21
|
-
"bson",
|
|
22
21
|
"odm",
|
|
23
22
|
]
|
|
24
23
|
classifiers = [
|
|
@@ -36,20 +35,12 @@ classifiers = [
|
|
|
36
35
|
"Typing :: Typed",
|
|
37
36
|
]
|
|
38
37
|
dependencies = [
|
|
39
|
-
"
|
|
38
|
+
"elune>=0.5.0",
|
|
40
39
|
"dnspython>=2.7.0",
|
|
41
40
|
"pydantic>=2.14.3",
|
|
42
41
|
"typing-extensions>=4.16.0",
|
|
43
42
|
]
|
|
44
43
|
|
|
45
|
-
[tool.uv.sources]
|
|
46
|
-
bson = { index = "bson" }
|
|
47
|
-
|
|
48
|
-
[[tool.uv.index]]
|
|
49
|
-
url = "https://python.wattka.dev/"
|
|
50
|
-
name = "bson"
|
|
51
|
-
explicit = true
|
|
52
|
-
|
|
53
44
|
[project.urls]
|
|
54
45
|
Homepage = "https://github.com/megawattka/kover"
|
|
55
46
|
Repository = "https://github.com/megawattka/kover"
|
|
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
|
|
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
|