From 9a0c44f908b171648341d35087cb86487c9ad331 Mon Sep 17 00:00:00 2001 From: Siddharth Balyan <52913345+alt-glitch@users.noreply.github.com> Date: Fri, 10 Apr 2026 17:29:56 -0700 Subject: [PATCH] fix(nix): gate matrix extra to Linux in [all] profile (#7461) * fix(nix): gate matrix extra to Linux in [all] profile matrix-nio[e2e] depends on python-olm which is upstream-broken on modern macOS (Clang 21+, archived libolm). Previously the [matrix] extra was completely excluded from [all], meaning NixOS users (who install via [all]) had no Matrix support at all. Add a sys_platform == 'linux' marker so [all] pulls in [matrix] on Linux (where python-olm builds fine) while still skipping it on macOS. This fixes the NixOS setup path without breaking macOS installs. Update the regression test to verify the Linux-gated marker is present rather than just checking matrix is absent from [all]. Fixes #4594 * chore: regenerate uv.lock with matrix-on-linux in [all] --- pyproject.toml | 8 ++++---- tests/test_project_metadata.py | 13 ++++++++++--- uv.lock | 19 +++++++++++++++++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1afb24cb2..9e84d676a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,10 +88,10 @@ all = [ "hermes-agent[modal]", "hermes-agent[daytona]", "hermes-agent[messaging]", - # matrix excluded: python-olm (required by matrix-nio[e2e]) is upstream-broken - # on modern macOS (archived libolm, C++ errors with Clang 21+). Including it - # here causes the entire [all] install to fail, dropping all other extras. - # Users who need Matrix can install manually: pip install 'hermes-agent[matrix]' + # matrix: python-olm (required by matrix-nio[e2e]) is upstream-broken on + # modern macOS (archived libolm, C++ errors with Clang 21+). On Linux the + # [matrix] extra's own marker pulls in the [e2e] variant automatically. + "hermes-agent[matrix]; sys_platform == 'linux'", "hermes-agent[cron]", "hermes-agent[cli]", "hermes-agent[dev]", diff --git a/tests/test_project_metadata.py b/tests/test_project_metadata.py index 476834099..2d7d0f100 100644 --- a/tests/test_project_metadata.py +++ b/tests/test_project_metadata.py @@ -11,12 +11,19 @@ def _load_optional_dependencies(): return project["optional-dependencies"] -def test_matrix_extra_exists_but_excluded_from_all(): +def test_matrix_extra_linux_only_in_all(): """matrix-nio[e2e] depends on python-olm which is upstream-broken on modern macOS (archived libolm, C++ errors with Clang 21+). The [matrix] extra is - kept for opt-in install but deliberately excluded from [all] so one broken - upstream dep doesn't nuke every other extra during ``hermes update``.""" + included in [all] but gated to Linux via a platform marker so that + ``hermes update`` doesn't fail on macOS.""" optional_dependencies = _load_optional_dependencies() assert "matrix" in optional_dependencies + # Must NOT be unconditional — python-olm has no macOS wheels. assert "hermes-agent[matrix]" not in optional_dependencies["all"] + # Must be present with a Linux platform marker. + linux_gated = [ + dep for dep in optional_dependencies["all"] + if "matrix" in dep and "linux" in dep + ] + assert linux_gated, "expected hermes-agent[matrix] with sys_platform=='linux' marker in [all]" diff --git a/uv.lock b/uv.lock index 7691ea984..ab6e7d84a 100644 --- a/uv.lock +++ b/uv.lock @@ -1661,7 +1661,7 @@ dependencies = [ { name = "fal-client" }, { name = "fire" }, { name = "firecrawl-py" }, - { name = "httpx" }, + { name = "httpx", extra = ["socks"] }, { name = "jinja2" }, { name = "openai" }, { name = "parallel-web" }, @@ -1691,6 +1691,8 @@ all = [ { name = "faster-whisper" }, { name = "honcho-ai" }, { name = "lark-oapi" }, + { name = "markdown", marker = "sys_platform == 'linux'" }, + { name = "matrix-nio", extra = ["e2e"], marker = "sys_platform == 'linux'" }, { name = "mcp" }, { name = "mistralai" }, { name = "modal" }, @@ -1827,6 +1829,7 @@ requires-dist = [ { name = "hermes-agent", extras = ["homeassistant"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["honcho"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["honcho"], marker = "extra == 'termux'" }, + { name = "hermes-agent", extras = ["matrix"], marker = "sys_platform == 'linux' and extra == 'all'" }, { name = "hermes-agent", extras = ["mcp"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["mcp"], marker = "extra == 'termux'" }, { name = "hermes-agent", extras = ["messaging"], marker = "extra == 'all'" }, @@ -1839,7 +1842,7 @@ requires-dist = [ { name = "hermes-agent", extras = ["tts-premium"], marker = "extra == 'all'" }, { name = "hermes-agent", extras = ["voice"], marker = "extra == 'all'" }, { name = "honcho-ai", marker = "extra == 'honcho'", specifier = ">=2.0.1,<3" }, - { name = "httpx", specifier = ">=0.28.1,<1" }, + { name = "httpx", extras = ["socks"], specifier = ">=0.28.1,<1" }, { name = "jinja2", specifier = ">=3.1.5,<4" }, { name = "lark-oapi", marker = "extra == 'feishu'", specifier = ">=1.5.3,<2" }, { name = "markdown", marker = "extra == 'matrix'", specifier = ">=3.6,<4" }, @@ -2033,6 +2036,9 @@ wheels = [ http2 = [ { name = "h2" }, ] +socks = [ + { name = "socksio" }, +] [[package]] name = "httpx-sse" @@ -4500,6 +4506,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, ] +[[package]] +name = "socksio" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f8/5c/48a7d9495be3d1c651198fd99dbb6ce190e2274d0f28b9051307bdec6b85/socksio-1.0.0.tar.gz", hash = "sha256:f88beb3da5b5c38b9890469de67d0cb0f9d494b78b106ca1845f96c10b91c4ac", size = 19055, upload-time = "2020-04-17T15:50:34.664Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/37/c3/6eeb6034408dac0fa653d126c9204ade96b819c936e136c5e8a6897eee9c/socksio-1.0.0-py3-none-any.whl", hash = "sha256:95dc1f15f9b34e8d7b16f06d74b8ccf48f609af32ab33c608d08761c5dcbb1f3", size = 12763, upload-time = "2020-04-17T15:50:31.878Z" }, +] + [[package]] name = "sounddevice" version = "0.5.5"