mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-22 20:36:08 +00:00
fix: skip valkey-glide on Windows (#2333)
Skip the unsupported valkey-glide dependency on Windows while preserving automatic installation on supported platforms. Keep missing-client runtime and test paths safe, and update the Valkey integration documentation.
This commit is contained in:
@@ -31,8 +31,10 @@ Both are compatible with LangBot.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Valkey Search support is included when you install LangBot — the `valkey-glide` dependency is
|
Valkey Search support is included automatically on Linux and macOS. The official `valkey-glide`
|
||||||
declared in `pyproject.toml`. To install manually:
|
client does not currently publish a Windows package, so LangBot skips this optional dependency on
|
||||||
|
Windows; LangBot remains usable there, but the Valkey Search backend is unavailable. To install the
|
||||||
|
client manually on a supported platform:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install 'valkey-glide>=2.4.1,<3.0.0'
|
pip install 'valkey-glide>=2.4.1,<3.0.0'
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ dependencies = [
|
|||||||
"pgvector>=0.4.1",
|
"pgvector>=0.4.1",
|
||||||
"botocore>=1.42.39",
|
"botocore>=1.42.39",
|
||||||
"litellm>=1.0.0",
|
"litellm>=1.0.0",
|
||||||
"valkey-glide>=2.4.1,<3.0.0",
|
"valkey-glide>=2.4.1,<3.0.0; sys_platform != 'win32'", # No Windows wheels are published
|
||||||
]
|
]
|
||||||
keywords = [
|
keywords = [
|
||||||
"bot",
|
"bot",
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ class ValkeySearchVectorDatabase(VectorDatabase):
|
|||||||
def __init__(self, ap: app.Application):
|
def __init__(self, ap: app.Application):
|
||||||
if not VALKEY_SEARCH_AVAILABLE:
|
if not VALKEY_SEARCH_AVAILABLE:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"valkey-glide is not installed. Install it with: pip install 'valkey-glide>=2.4.1,<3.0.0'"
|
'valkey-glide is not installed or is unavailable on this platform. '
|
||||||
|
"On Linux or macOS, install it with: pip install 'valkey-glide>=2.4.1,<3.0.0'"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.ap = ap
|
self.ap = ap
|
||||||
|
|||||||
@@ -77,11 +77,12 @@ async def backend(valkey_config):
|
|||||||
ValkeySearchVectorDatabase,
|
ValkeySearchVectorDatabase,
|
||||||
VALKEY_SEARCH_AVAILABLE,
|
VALKEY_SEARCH_AVAILABLE,
|
||||||
)
|
)
|
||||||
from glide import ft
|
|
||||||
|
|
||||||
if not VALKEY_SEARCH_AVAILABLE:
|
if not VALKEY_SEARCH_AVAILABLE:
|
||||||
pytest.skip('valkey-glide not installed')
|
pytest.skip('valkey-glide not installed')
|
||||||
|
|
||||||
|
from glide import ft
|
||||||
|
|
||||||
ap = _make_ap(valkey_config)
|
ap = _make_ap(valkey_config)
|
||||||
db = ValkeySearchVectorDatabase(ap)
|
db = ValkeySearchVectorDatabase(ap)
|
||||||
client = await db._ensure_client()
|
client = await db._ensure_client()
|
||||||
|
|||||||
@@ -357,10 +357,13 @@ class TestCredentialsBuild:
|
|||||||
cred_calls.append(kwargs)
|
cred_calls.append(kwargs)
|
||||||
return ('CRED', kwargs)
|
return ('CRED', kwargs)
|
||||||
|
|
||||||
monkeypatch.setattr(mod, 'GlideClient', _FakeClient)
|
# These names are absent when the optional valkey-glide dependency is
|
||||||
monkeypatch.setattr(mod, 'ServerCredentials', _fake_credentials)
|
# unavailable (for example, on Windows), so allow the test doubles to
|
||||||
monkeypatch.setattr(mod, 'GlideClientConfiguration', lambda **kw: kw)
|
# create them on the module.
|
||||||
monkeypatch.setattr(mod, 'NodeAddress', lambda *a, **k: ('node', a, k))
|
monkeypatch.setattr(mod, 'GlideClient', _FakeClient, raising=False)
|
||||||
|
monkeypatch.setattr(mod, 'ServerCredentials', _fake_credentials, raising=False)
|
||||||
|
monkeypatch.setattr(mod, 'GlideClientConfiguration', lambda **kw: kw, raising=False)
|
||||||
|
monkeypatch.setattr(mod, 'NodeAddress', lambda *a, **k: ('node', a, k), raising=False)
|
||||||
return backend, created, cred_calls, warnings
|
return backend, created, cred_calls, warnings
|
||||||
|
|
||||||
async def test_username_without_password_fails_closed(self, monkeypatch):
|
async def test_username_without_password_fails_closed(self, monkeypatch):
|
||||||
|
|||||||
@@ -2084,7 +2084,7 @@ dependencies = [
|
|||||||
{ name = "tiktoken" },
|
{ name = "tiktoken" },
|
||||||
{ name = "urllib3" },
|
{ name = "urllib3" },
|
||||||
{ name = "uv" },
|
{ name = "uv" },
|
||||||
{ name = "valkey-glide" },
|
{ name = "valkey-glide", marker = "sys_platform != 'win32'" },
|
||||||
{ name = "websockets" },
|
{ name = "websockets" },
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2173,7 +2173,7 @@ requires-dist = [
|
|||||||
{ name = "tiktoken", specifier = ">=0.9.0" },
|
{ name = "tiktoken", specifier = ">=0.9.0" },
|
||||||
{ name = "urllib3", specifier = ">=2.7.0" },
|
{ name = "urllib3", specifier = ">=2.7.0" },
|
||||||
{ name = "uv", specifier = ">=0.11.15" },
|
{ name = "uv", specifier = ">=0.11.15" },
|
||||||
{ name = "valkey-glide", specifier = ">=2.4.1,<3.0.0" },
|
{ name = "valkey-glide", marker = "sys_platform != 'win32'", specifier = ">=2.4.1,<3.0.0" },
|
||||||
{ name = "websockets", specifier = ">=15.0.1" },
|
{ name = "websockets", specifier = ">=15.0.1" },
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5991,9 +5991,9 @@ name = "valkey-glide"
|
|||||||
version = "2.4.1"
|
version = "2.4.1"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "anyio" },
|
{ name = "anyio", marker = "sys_platform != 'win32'" },
|
||||||
{ name = "protobuf" },
|
{ name = "protobuf", marker = "sys_platform != 'win32'" },
|
||||||
{ name = "sniffio" },
|
{ name = "sniffio", marker = "sys_platform != 'win32'" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/72/a2/582b34c6acc8dc857c537f6007459cba48dfa0dc404789a657e5c1a998c0/valkey_glide-2.4.1.tar.gz", hash = "sha256:f1155d84156d11b90488aa67e90102f0bf98a45314f5b99308ac9074c05f7241", size = 898030, upload-time = "2026-05-28T21:41:55.881Z" }
|
sdist = { url = "https://files.pythonhosted.org/packages/72/a2/582b34c6acc8dc857c537f6007459cba48dfa0dc404789a657e5c1a998c0/valkey_glide-2.4.1.tar.gz", hash = "sha256:f1155d84156d11b90488aa67e90102f0bf98a45314f5b99308ac9074c05f7241", size = 898030, upload-time = "2026-05-28T21:41:55.881Z" }
|
||||||
wheels = [
|
wheels = [
|
||||||
|
|||||||
Reference in New Issue
Block a user