Skip to content

Commit

Permalink
fix: Remove package dependency litestar
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyonY committed Jan 21, 2024
1 parent 6eeb3f7 commit f810636
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion flaxkv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from .core import LevelDBDict, LMDBDict, RemoteDBDict

__version__ = "0.2.7"
__version__ = "0.2.7.1"

__all__ = [
"FlaxKV",
Expand Down
8 changes: 7 additions & 1 deletion flaxkv/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import time
import traceback
from pathlib import Path
from typing import Dict
from uuid import uuid4

import msgspec
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions flaxkv/serve/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test = [
"pytest",
"pytest-aiohttp",
"uvicorn",
"httpx",
"httpx[http2]",
"pandas",
"hypercorn",
"uvloop; sys_platform == 'linux'",
Expand All @@ -61,11 +61,11 @@ server = [
"hypercorn",
"uvloop; sys_platform == 'linux'",
"litestar>=2.5.0",
"httpx",
"httpx[http2]",
]

client = [
"httpx",
"httpx[http2]",
]


Expand Down

0 comments on commit f810636

Please sign in to comment.