diff --git a/flaxkv/__init__.py b/flaxkv/__init__.py index d6cba89..c2ee1f6 100644 --- a/flaxkv/__init__.py +++ b/flaxkv/__init__.py @@ -19,7 +19,7 @@ from .core import LevelDBDict, LMDBDict, RemoteDBDict -__version__ = "0.2.7" +__version__ = "0.2.7.1" __all__ = [ "FlaxKV", diff --git a/flaxkv/manager.py b/flaxkv/manager.py index 2352101..be66c64 100644 --- a/flaxkv/manager.py +++ b/flaxkv/manager.py @@ -23,6 +23,7 @@ import time import traceback from pathlib import Path +from typing import Dict from uuid import uuid4 import msgspec @@ -32,6 +33,12 @@ from .pack import decode, decode_key, encode +class StructUpdateData(msgspec.Struct): + type: str + data: Dict[bytes, bytes] + time: float + + class DBManager: def __init__( self, db_type: str, root_path_or_url: str, db_name: str, rebuild=False, **kwargs @@ -238,7 +245,6 @@ def __init__( backoff=2, ) def attach_db(self, event: threading.Event): - from .serve.interface import StructUpdateData with self.client.stream( "POST", diff --git a/flaxkv/serve/interface.py b/flaxkv/serve/interface.py index 7c30a8a..dfeca50 100644 --- a/flaxkv/serve/interface.py +++ b/flaxkv/serve/interface.py @@ -55,9 +55,3 @@ class StructDeleteBatchData(msgspec.Struct): keys: List[bytes] client_id: str time: float - - -class StructUpdateData(msgspec.Struct): - type: str - data: Dict[bytes, bytes] - time: float diff --git a/pyproject.toml b/pyproject.toml index bbda4f7..c110bbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ test = [ "pytest", "pytest-aiohttp", "uvicorn", - "httpx", + "httpx[http2]", "pandas", "hypercorn", "uvloop; sys_platform == 'linux'", @@ -61,11 +61,11 @@ server = [ "hypercorn", "uvloop; sys_platform == 'linux'", "litestar>=2.5.0", - "httpx", + "httpx[http2]", ] client = [ - "httpx", + "httpx[http2]", ]