kiba-core 0.5.3.dev80__tar.gz → 0.5.3.dev82__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.
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.github/workflows/deploy.yml +1 -1
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.github/workflows/pull-request.yml +3 -3
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/CHANGELOG.md +1 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/PKG-INFO +9 -9
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/request_context.py +1 -1
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/locks/lock.py +2 -2
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/store/database.py +4 -4
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/store/saver.py +2 -2
- kiba_core-0.5.3.dev82/core/util/typing_util.py +28 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/kiba_core.egg-info/PKG-INFO +9 -9
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/kiba_core.egg-info/requires.txt +8 -8
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/pyproject.toml +10 -10
- kiba_core-0.5.3.dev82/uv.lock +3719 -0
- kiba_core-0.5.3.dev80/core/util/typing_util.py +0 -7
- kiba_core-0.5.3.dev80/uv.lock +0 -3494
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.github/pull_request_template.md +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.github/workflows/publish.yml +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.github/workflows/release.yml +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/.gitignore +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/Dockerfile +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/README.md +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/api_request.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/api_response.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/authorizer.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/default_routes.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/health.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/json_route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/database_connection_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/exception_handling_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/logging_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/origin_ip_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/middleware/server_headers_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/openapi.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/rate_limit.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/route_auth.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/route_metadata.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/api/streaming_json_route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/aws_requester.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/caching/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/caching/cache.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/caching/dict_cache.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/caching/file_cache.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/cron/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/cron/api_request_cron_job_processor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/cron/cron_executor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/cron/cron_job_processor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/cron/model.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/exceptions.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/http/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/http/basic_authentication.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/http/jwt.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/http/rest_method.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/locks/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/locks/model.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/locks/sql.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/logging.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/notifications/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/notifications/discord_client.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/notifications/notification_client.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/notifications/slack_client.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/py.typed +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/aqs.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/cosmos.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/message_queue.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/message_queue_processor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/model.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/sql.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/queues/sqs.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/requester/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/requester/requester.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/s3_manager.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/service_client.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/store/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/store/entity_repository.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/store/retriever.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/async_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/chain_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/date_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/dict_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/file_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/hashing_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/http_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/json_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/list_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/process_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/string_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/url_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/util/value_holder.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/web3/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/web3/eth_client.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/web3/eth_client_registry.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/core/web3/multicall3.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/kiba_core.egg-info/SOURCES.txt +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/kiba_core.egg-info/dependency_links.txt +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/kiba_core.egg-info/top_level.txt +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/makefile +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/setup.cfg +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_api_response.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_authorizer.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_exception_handling_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_json_route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_openapi.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_origin_ip_middleware.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_rate_limit.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_request_context.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/api/test_streaming_json_route.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/caching/test_dict_cache.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/caching/test_file_cache.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/cron/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/cron/test_cron_executor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/locks/test_sql_lock.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/conftest.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/test_aqs_queue.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/test_cosmos_queue.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/test_message_queue_processor.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/test_sql_queue.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/queues/test_sqs_queue.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/requester/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/requester/test_requester.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/test_database.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/test_entity_repository.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/test_exceptions.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/test_logging.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_async_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_chain_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_date_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_dict_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_file_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_json_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_list_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_process_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_string_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/util/test_url_util.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/web3/__init__.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/web3/test_eth_client_registry.py +0 -0
- {kiba_core-0.5.3.dev80 → kiba_core-0.5.3.dev82}/tests/web3/test_rest_eth_client.py +0 -0
|
@@ -12,11 +12,11 @@ jobs:
|
|
|
12
12
|
DOCKER_IMAGE: core
|
|
13
13
|
steps:
|
|
14
14
|
- name: Check out the repo
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v7
|
|
16
16
|
- name: Set up Docker Buildx
|
|
17
|
-
uses: docker/setup-buildx-action@
|
|
17
|
+
uses: docker/setup-buildx-action@v4
|
|
18
18
|
- name: Build docker image
|
|
19
|
-
uses: docker/build-push-action@
|
|
19
|
+
uses: docker/build-push-action@v7
|
|
20
20
|
with:
|
|
21
21
|
context: .
|
|
22
22
|
load: true
|
|
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
|
+
- [MINOR] Added `UNDEFINED`, `Undefined` and `UpdateValue[T]` to `core.util.typing_util` for partial updates: `UpdateValue[T]` is `T` or the `UNDEFINED` sentinel, so an update can tell "not provided" apart from an explicit `None`. Use it as a pydantic field default (`title: UpdateValue[str | None] = UNDEFINED`); request input never validates to `UNDEFINED` (a JSON `"UNDEFINED"` stays a string), and `x is not UNDEFINED` narrows `x` to `T` for type checkers
|
|
11
12
|
- [MINOR] Added `core.store.entity_repository.EntityRepository`, which reads and writes rows of a table as pydantic models: `create`, `update`, `upsert`, `upsert_many` (postgres and sqlite), `delete`, `list_many`, `get_first`, `get`, `get_one` and `get_one_or_none`. It exposes UUID columns as strings and datetimes as aware utc datetimes, dumps pydantic values in JSON columns, generates ids for UUID primary keys and stamps `createdDate`/`updatedDate` when the table has them; subclasses can override `_convert_value_from_db`/`_convert_value_to_db` for other columns
|
|
12
13
|
- [MINOR] Added `UUIDFieldFilter` (accepts `uuid.UUID` or `str` values) and module-level `apply_orders`, `apply_field_filters` and `get_field_filters_conditions` (conditions usable on selects, updates and deletes) to `core.store.retriever`; `Retriever` now uses them
|
|
13
14
|
- [PATCH] Updated `DateFieldFilter` to convert values to utc for the column (naive for columns without a timezone, aware otherwise) so aware datetimes in any timezone compare correctly
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiba-core
|
|
3
|
-
Version: 0.5.3.
|
|
3
|
+
Version: 0.5.3.dev82
|
|
4
4
|
Summary: Kiba Labs' python utilities
|
|
5
5
|
Project-URL: repository, https://github.com/kibalabs/core-py
|
|
6
6
|
Requires-Python: <4,>=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: aiofiles>=25.1.0
|
|
9
|
-
Requires-Dist: pydantic>=2.
|
|
10
|
-
Requires-Dist: orjson>=3.
|
|
9
|
+
Requires-Dist: pydantic>=2.14.1
|
|
10
|
+
Requires-Dist: orjson>=3.13.0
|
|
11
11
|
Provides-Extra: api
|
|
12
|
-
Requires-Dist: fastapi>=0.
|
|
13
|
-
Requires-Dist: uvicorn[standard]>=0.
|
|
12
|
+
Requires-Dist: fastapi>=0.143.0; extra == "api"
|
|
13
|
+
Requires-Dist: uvicorn[standard]>=0.54.0; extra == "api"
|
|
14
14
|
Provides-Extra: core-api
|
|
15
15
|
Requires-Dist: starlette>=1.7.0; extra == "core-api"
|
|
16
|
-
Requires-Dist: uvicorn[standard]>=0.
|
|
16
|
+
Requires-Dist: uvicorn[standard]>=0.54.0; extra == "core-api"
|
|
17
17
|
Provides-Extra: storage
|
|
18
18
|
Requires-Dist: aiobotocore>=3.9.2; extra == "storage"
|
|
19
19
|
Provides-Extra: queues
|
|
@@ -25,10 +25,10 @@ Requires-Dist: azure-storage-queue[aio]>=12.18.0; extra == "queue-aqs"
|
|
|
25
25
|
Provides-Extra: queue-cosmos
|
|
26
26
|
Requires-Dist: azure-cosmos>=4.17.1; extra == "queue-cosmos"
|
|
27
27
|
Provides-Extra: database-psql
|
|
28
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.1.
|
|
29
|
-
Requires-Dist: asyncpg>=0.
|
|
28
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.1.4; extra == "database-psql"
|
|
29
|
+
Requires-Dist: asyncpg>=0.32.0; extra == "database-psql"
|
|
30
30
|
Provides-Extra: database-sqlite
|
|
31
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.1.
|
|
31
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.1.4; extra == "database-sqlite"
|
|
32
32
|
Requires-Dist: aiosqlite>=0.22.1; extra == "database-sqlite"
|
|
33
33
|
Provides-Extra: requester
|
|
34
34
|
Requires-Dist: httpx2>=2.13.1; extra == "requester"
|
|
@@ -30,7 +30,7 @@ class RequestContextHolder[RequestContextType: RequestContext]:
|
|
|
30
30
|
return value
|
|
31
31
|
|
|
32
32
|
@contextmanager
|
|
33
|
-
def use_value(self, value: RequestContextType) -> typing.
|
|
33
|
+
def use_value(self, value: RequestContextType) -> typing.Generator[RequestContextType]:
|
|
34
34
|
token = self._valueContext.set(value)
|
|
35
35
|
try:
|
|
36
36
|
yield value
|
|
@@ -2,7 +2,7 @@ import abc
|
|
|
2
2
|
import asyncio
|
|
3
3
|
import contextlib
|
|
4
4
|
from abc import ABC
|
|
5
|
-
from collections.abc import
|
|
5
|
+
from collections.abc import AsyncGenerator
|
|
6
6
|
|
|
7
7
|
from core import logging
|
|
8
8
|
from core.exceptions import LockedException
|
|
@@ -55,7 +55,7 @@ class Lock(ABC):
|
|
|
55
55
|
return
|
|
56
56
|
|
|
57
57
|
@contextlib.asynccontextmanager
|
|
58
|
-
async def with_lock(self, name: str, ttlSeconds: int = 60, maxWaitSeconds: float = 0) ->
|
|
58
|
+
async def with_lock(self, name: str, ttlSeconds: int = 60, maxWaitSeconds: float = 0) -> AsyncGenerator[LockLease]:
|
|
59
59
|
lease = await self.acquire(name=name, ttlSeconds=ttlSeconds, maxWaitSeconds=maxWaitSeconds)
|
|
60
60
|
keepAliveTask = asyncio.create_task(self._keep_alive(lease=lease))
|
|
61
61
|
try:
|
|
@@ -3,7 +3,7 @@ import contextvars
|
|
|
3
3
|
import datetime
|
|
4
4
|
import typing
|
|
5
5
|
import weakref
|
|
6
|
-
from collections.abc import
|
|
6
|
+
from collections.abc import AsyncGenerator
|
|
7
7
|
from typing import TypeVarTuple
|
|
8
8
|
|
|
9
9
|
import sqlalchemy
|
|
@@ -80,7 +80,7 @@ class Database:
|
|
|
80
80
|
raise InternalServerErrorException(message=f'Database.now does not support dialect: {dialectName}')
|
|
81
81
|
|
|
82
82
|
@contextlib.asynccontextmanager
|
|
83
|
-
async def create_transaction(self) ->
|
|
83
|
+
async def create_transaction(self) -> AsyncGenerator[DatabaseConnection]:
|
|
84
84
|
if not self._engine:
|
|
85
85
|
raise InternalServerErrorException(message='Engine has not been established. Please called collect() first.')
|
|
86
86
|
async with self._engine.begin() as connection:
|
|
@@ -102,7 +102,7 @@ class Database:
|
|
|
102
102
|
# uncaught exception raised whilst parallel queries are running.
|
|
103
103
|
# We have the forced reconnect at the bottom just to catch for this wierd case.
|
|
104
104
|
@contextlib.asynccontextmanager
|
|
105
|
-
async def create_context_connection(self) ->
|
|
105
|
+
async def create_context_connection(self) -> AsyncGenerator[DatabaseConnection]:
|
|
106
106
|
if not self._engine:
|
|
107
107
|
raise InternalServerErrorException(message='Engine has not been established. Please called collect() first.')
|
|
108
108
|
if self._get_context_connection() is not None:
|
|
@@ -128,7 +128,7 @@ class Database:
|
|
|
128
128
|
# transaction's uncommitted writes and will block forever on rows the outer transaction has written, so
|
|
129
129
|
# callers must commit their writes before entering. Violations are logged (with the caller's stack) for now.
|
|
130
130
|
@contextlib.asynccontextmanager
|
|
131
|
-
async def create_isolated_context_connection(self) ->
|
|
131
|
+
async def create_isolated_context_connection(self) -> AsyncGenerator[DatabaseConnection]:
|
|
132
132
|
if not self._engine:
|
|
133
133
|
raise InternalServerErrorException(message='Engine has not been established. Please called collect() first.')
|
|
134
134
|
outerConnection = self._get_context_connection()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import contextlib
|
|
2
|
-
from collections.abc import
|
|
2
|
+
from collections.abc import AsyncGenerator
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
@@ -35,7 +35,7 @@ class Saver:
|
|
|
35
35
|
self.database = database
|
|
36
36
|
|
|
37
37
|
@contextlib.asynccontextmanager
|
|
38
|
-
async def create_transaction(self) ->
|
|
38
|
+
async def create_transaction(self) -> AsyncGenerator[DatabaseConnection]:
|
|
39
39
|
async with self.database.create_transaction() as connection:
|
|
40
40
|
yield connection
|
|
41
41
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
import typing
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from collections.abc import Sequence
|
|
5
|
+
|
|
6
|
+
from pydantic import GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import core_schema
|
|
8
|
+
|
|
9
|
+
JsonBaseType = str | int | float | bool | None
|
|
10
|
+
type Json = dict[str, 'Json'] | Mapping[str, 'Json'] | list['Json'] | Sequence['Json'] | JsonBaseType
|
|
11
|
+
type JsonObject = dict[str, 'Json']
|
|
12
|
+
type JsonList = list['Json']
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Undefined(enum.Enum):
|
|
16
|
+
UNDEFINED = 'UNDEFINED'
|
|
17
|
+
|
|
18
|
+
def __repr__(self) -> str:
|
|
19
|
+
return 'UNDEFINED'
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def __get_pydantic_core_schema__(cls, sourceType: typing.Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: # type: ignore[explicit-any]
|
|
23
|
+
# NOTE(krishan711): only the default can be UNDEFINED, input values (e.g. "UNDEFINED" in json) must never validate to it
|
|
24
|
+
return core_schema.is_instance_schema(cls)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
UNDEFINED: typing.Final = Undefined.UNDEFINED
|
|
28
|
+
type UpdateValue[T] = T | Undefined
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiba-core
|
|
3
|
-
Version: 0.5.3.
|
|
3
|
+
Version: 0.5.3.dev82
|
|
4
4
|
Summary: Kiba Labs' python utilities
|
|
5
5
|
Project-URL: repository, https://github.com/kibalabs/core-py
|
|
6
6
|
Requires-Python: <4,>=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: aiofiles>=25.1.0
|
|
9
|
-
Requires-Dist: pydantic>=2.
|
|
10
|
-
Requires-Dist: orjson>=3.
|
|
9
|
+
Requires-Dist: pydantic>=2.14.1
|
|
10
|
+
Requires-Dist: orjson>=3.13.0
|
|
11
11
|
Provides-Extra: api
|
|
12
|
-
Requires-Dist: fastapi>=0.
|
|
13
|
-
Requires-Dist: uvicorn[standard]>=0.
|
|
12
|
+
Requires-Dist: fastapi>=0.143.0; extra == "api"
|
|
13
|
+
Requires-Dist: uvicorn[standard]>=0.54.0; extra == "api"
|
|
14
14
|
Provides-Extra: core-api
|
|
15
15
|
Requires-Dist: starlette>=1.7.0; extra == "core-api"
|
|
16
|
-
Requires-Dist: uvicorn[standard]>=0.
|
|
16
|
+
Requires-Dist: uvicorn[standard]>=0.54.0; extra == "core-api"
|
|
17
17
|
Provides-Extra: storage
|
|
18
18
|
Requires-Dist: aiobotocore>=3.9.2; extra == "storage"
|
|
19
19
|
Provides-Extra: queues
|
|
@@ -25,10 +25,10 @@ Requires-Dist: azure-storage-queue[aio]>=12.18.0; extra == "queue-aqs"
|
|
|
25
25
|
Provides-Extra: queue-cosmos
|
|
26
26
|
Requires-Dist: azure-cosmos>=4.17.1; extra == "queue-cosmos"
|
|
27
27
|
Provides-Extra: database-psql
|
|
28
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.1.
|
|
29
|
-
Requires-Dist: asyncpg>=0.
|
|
28
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.1.4; extra == "database-psql"
|
|
29
|
+
Requires-Dist: asyncpg>=0.32.0; extra == "database-psql"
|
|
30
30
|
Provides-Extra: database-sqlite
|
|
31
|
-
Requires-Dist: sqlalchemy[asyncio]>=2.1.
|
|
31
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.1.4; extra == "database-sqlite"
|
|
32
32
|
Requires-Dist: aiosqlite>=0.22.1; extra == "database-sqlite"
|
|
33
33
|
Provides-Extra: requester
|
|
34
34
|
Requires-Dist: httpx2>=2.13.1; extra == "requester"
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
aiofiles>=25.1.0
|
|
2
|
-
pydantic>=2.
|
|
3
|
-
orjson>=3.
|
|
2
|
+
pydantic>=2.14.1
|
|
3
|
+
orjson>=3.13.0
|
|
4
4
|
|
|
5
5
|
[api]
|
|
6
|
-
fastapi>=0.
|
|
7
|
-
uvicorn[standard]>=0.
|
|
6
|
+
fastapi>=0.143.0
|
|
7
|
+
uvicorn[standard]>=0.54.0
|
|
8
8
|
|
|
9
9
|
[core-api]
|
|
10
10
|
starlette>=1.7.0
|
|
11
|
-
uvicorn[standard]>=0.
|
|
11
|
+
uvicorn[standard]>=0.54.0
|
|
12
12
|
|
|
13
13
|
[cron]
|
|
14
14
|
apscheduler<4,>=3.11.3
|
|
15
15
|
|
|
16
16
|
[database-psql]
|
|
17
|
-
sqlalchemy[asyncio]>=2.1.
|
|
18
|
-
asyncpg>=0.
|
|
17
|
+
sqlalchemy[asyncio]>=2.1.4
|
|
18
|
+
asyncpg>=0.32.0
|
|
19
19
|
|
|
20
20
|
[database-sqlite]
|
|
21
|
-
sqlalchemy[asyncio]>=2.1.
|
|
21
|
+
sqlalchemy[asyncio]>=2.1.4
|
|
22
22
|
aiosqlite>=0.22.1
|
|
23
23
|
|
|
24
24
|
[queue-aqs]
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "kiba-core"
|
|
3
|
-
version = "0.5.3.
|
|
3
|
+
version = "0.5.3.dev82"
|
|
4
4
|
description = "Kiba Labs' python utilities"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12, <4"
|
|
7
7
|
dependencies = [
|
|
8
8
|
"aiofiles>=25.1.0",
|
|
9
|
-
"pydantic>=2.
|
|
10
|
-
"orjson>=3.
|
|
9
|
+
"pydantic>=2.14.1",
|
|
10
|
+
"orjson>=3.13.0",
|
|
11
11
|
]
|
|
12
12
|
|
|
13
13
|
[project.optional-dependencies]
|
|
14
14
|
api = [
|
|
15
|
-
"fastapi>=0.
|
|
16
|
-
"uvicorn[standard]>=0.
|
|
15
|
+
"fastapi>=0.143.0",
|
|
16
|
+
"uvicorn[standard]>=0.54.0",
|
|
17
17
|
]
|
|
18
18
|
core-api = [
|
|
19
19
|
"starlette>=1.7.0",
|
|
20
|
-
"uvicorn[standard]>=0.
|
|
20
|
+
"uvicorn[standard]>=0.54.0",
|
|
21
21
|
]
|
|
22
22
|
storage = [
|
|
23
23
|
"aiobotocore>=3.9.2",
|
|
@@ -36,11 +36,11 @@ queue-cosmos = [
|
|
|
36
36
|
"azure-cosmos>=4.17.1",
|
|
37
37
|
]
|
|
38
38
|
database-psql = [
|
|
39
|
-
"sqlalchemy[asyncio]>=2.1.
|
|
40
|
-
"asyncpg>=0.
|
|
39
|
+
"sqlalchemy[asyncio]>=2.1.4",
|
|
40
|
+
"asyncpg>=0.32.0",
|
|
41
41
|
]
|
|
42
42
|
database-sqlite = [
|
|
43
|
-
"sqlalchemy[asyncio]>=2.1.
|
|
43
|
+
"sqlalchemy[asyncio]>=2.1.4",
|
|
44
44
|
"aiosqlite>=0.22.1",
|
|
45
45
|
]
|
|
46
46
|
requester = [
|
|
@@ -59,7 +59,7 @@ types = [
|
|
|
59
59
|
|
|
60
60
|
[dependency-groups]
|
|
61
61
|
dev = [
|
|
62
|
-
"kiba-build==0.1.11.
|
|
62
|
+
"kiba-build==0.1.11.dev17",
|
|
63
63
|
]
|
|
64
64
|
|
|
65
65
|
[project.urls]
|