From ccedb3a95ef7a324626387fc9dcb5c3f5cdef105 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 19 Aug 2025 10:28:20 -0700 Subject: [PATCH 1/4] python3Packages.chromadb: pkgs.zstd -> custom zstd-c --- pkgs/development/python-modules/chromadb/default.nix | 4 ++-- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/chromadb/default.nix b/pkgs/development/python-modules/chromadb/default.nix index 8efba3b0d97a..4a351addae9e 100644 --- a/pkgs/development/python-modules/chromadb/default.nix +++ b/pkgs/development/python-modules/chromadb/default.nix @@ -11,8 +11,8 @@ protobuf, rustc, rustPlatform, - pkgs, # zstd hidden by python3Packages.zstd openssl, + zstd-c, # dependencies bcrypt, @@ -117,7 +117,7 @@ buildPythonPackage rec { buildInputs = [ openssl - pkgs.zstd + zstd-c ]; dependencies = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index afb3dbb3fda4..2966fa30f9b2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2520,7 +2520,7 @@ self: super: with self; { chroma-hnswlib = callPackage ../development/python-modules/chroma-hnswlib { }; - chromadb = callPackage ../development/python-modules/chromadb { }; + chromadb = callPackage ../development/python-modules/chromadb { zstd-c = pkgs.zstd; }; chromaprint = callPackage ../development/python-modules/chromaprint { }; From ef2c135062257b38aa03cb8aad8c39bd7fad1871 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 19 Aug 2025 10:28:20 -0700 Subject: [PATCH 2/4] python3Packages.chromadb: disable integration and distributed tests --- .../python-modules/chromadb/default.nix | 10 +++------- .../chromadb/disable-fastapi-fixtures.patch | 14 -------------- 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 pkgs/development/python-modules/chromadb/disable-fastapi-fixtures.patch diff --git a/pkgs/development/python-modules/chromadb/default.nix b/pkgs/development/python-modules/chromadb/default.nix index 4a351addae9e..eaaa7ab4bbac 100644 --- a/pkgs/development/python-modules/chromadb/default.nix +++ b/pkgs/development/python-modules/chromadb/default.nix @@ -88,11 +88,6 @@ buildPythonPackage rec { hash = "sha256-H+kXxA/6rKzYA19v7Zlx2HbIg/DGicD5FDIs0noVGSk="; }; - patches = [ - # The fastapi servers can't set up their networking in the test environment, so disable for testing - ./disable-fastapi-fixtures.patch - ]; - postPatch = '' # Nixpkgs is taking the version from `chromadb_rust_bindings` which is versioned independently substituteInPlace pyproject.toml \ @@ -188,9 +183,12 @@ buildPythonPackage rec { "-Wignore:PytestCollectionWarning" ]; + # Skip the distributed and integration tests + # See https://github.com/chroma-core/chroma/issues/5315 preCheck = '' (($(ulimit -n) < 1024)) && ulimit -n 1024 export HOME=$(mktemp -d) + export CHROMA_RUST_BINDINGS_TEST_ONLY=1 ''; disabledTests = [ @@ -209,8 +207,6 @@ buildPythonPackage rec { "test_collection_query_with_invalid_collection_throws" "test_collection_update_with_invalid_collection_throws" "test_default_embedding" - "test_invalid_index_params" - "test_peek" "test_persist_index_loading" "test_query_id_filtering_e2e" "test_query_id_filtering_medium_dataset" diff --git a/pkgs/development/python-modules/chromadb/disable-fastapi-fixtures.patch b/pkgs/development/python-modules/chromadb/disable-fastapi-fixtures.patch deleted file mode 100644 index 7c63ced3cf95..000000000000 --- a/pkgs/development/python-modules/chromadb/disable-fastapi-fixtures.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/chromadb/test/conftest.py b/chromadb/test/conftest.py -index efde1c382..163f55c57 100644 ---- a/chromadb/test/conftest.py -+++ b/chromadb/test/conftest.py -@@ -678,9 +678,6 @@ def sqlite_persistent(request: pytest.FixtureRequest) -> Generator[System, None, - - def system_fixtures() -> List[Callable[[], Generator[System, None, None]]]: - fixtures = [ -- fastapi, -- async_fastapi, -- fastapi_persistent, - sqlite_fixture, - sqlite_persistent_fixture, - ] From 493d9641ce77157c65ee45611cfe983f5662241a Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 19 Aug 2025 10:28:20 -0700 Subject: [PATCH 3/4] python3Packages.chromadb: 1.0.12 -> 1.0.20 --- .../python-modules/chromadb/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/chromadb/default.nix b/pkgs/development/python-modules/chromadb/default.nix index eaaa7ab4bbac..ef4ca8891759 100644 --- a/pkgs/development/python-modules/chromadb/default.nix +++ b/pkgs/development/python-modules/chromadb/default.nix @@ -7,11 +7,11 @@ # build inputs cargo, + openssl, pkg-config, protobuf, rustc, rustPlatform, - openssl, zstd-c, # dependencies @@ -33,6 +33,7 @@ orjson, overrides, posthog, + pybase64, pydantic, pypika, pyyaml, @@ -66,20 +67,20 @@ buildPythonPackage rec { pname = "chromadb"; - version = "1.0.12"; + version = "1.0.20"; pyproject = true; src = fetchFromGitHub { owner = "chroma-core"; repo = "chroma"; tag = version; - hash = "sha256-Q4PhJTRNzJeVx6DIPWirnI9KksNb8vfOtqb/q9tSK3c="; + hash = "sha256-jwgm1IXAyctLzUi9GZfgRMiqAuq1BwpcZp/UMlV2t7g="; }; cargoDeps = rustPlatform.fetchCargoVendor { inherit src; name = "${pname}-${version}-vendor"; - hash = "sha256-+Ea2aRrsBGfVCLdOF41jeMehJhMurc8d0UKrpR6ndag="; + hash = "sha256-A4I0xAGmwF9Th+g8bWEmhCRTAp4Q6GYkejHKDqoczY4="; }; # Can't use fetchFromGitHub as the build expects a zipfile @@ -96,6 +97,7 @@ buildPythonPackage rec { pythonRelaxDeps = [ "fastapi" + "posthog" ]; build-system = [ @@ -134,6 +136,7 @@ buildPythonPackage rec { orjson overrides posthog + pybase64 pydantic pypika pyyaml @@ -187,10 +190,13 @@ buildPythonPackage rec { # See https://github.com/chroma-core/chroma/issues/5315 preCheck = '' (($(ulimit -n) < 1024)) && ulimit -n 1024 - export HOME=$(mktemp -d) export CHROMA_RUST_BINDINGS_TEST_ONLY=1 ''; + enabledTestPaths = [ + "chromadb/test" + ]; + disabledTests = [ # Tests are flaky / timing sensitive "test_fastapi_server_token_authn_allows_when_it_should_allow" @@ -211,6 +217,11 @@ buildPythonPackage rec { "test_query_id_filtering_e2e" "test_query_id_filtering_medium_dataset" "test_query_id_filtering_small_dataset" + # Deadlocks intermittently + "test_app" + # Depends on specific floating-point precision + "test_base64_conversion_is_identity_f16" + # No such file or directory: 'openssl' "test_ssl_self_signed_without_ssl_verify" "test_ssl_self_signed" @@ -227,6 +238,8 @@ buildPythonPackage rec { "chromadb/test/ef/test_onnx_mini_lm_l6_v2.py" "chromadb/test/ef/test_voyageai_ef.py" "chromadb/test/property/" + "chromadb/test/distributed" + "chromadb/test/ef" "chromadb/test/property/test_cross_version_persist.py" "chromadb/test/stress/" "chromadb/test/test_api.py" From b887ca4634f716858aba3bf1e59d6b78bb3b99b1 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 19 Aug 2025 10:28:20 -0700 Subject: [PATCH 4/4] python3Packages.chromadb: remove obsolete test exclusions Audited test exclusions to see which could be removed. --- .../python-modules/chromadb/default.nix | 42 ++++--------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/pkgs/development/python-modules/chromadb/default.nix b/pkgs/development/python-modules/chromadb/default.nix index ef4ca8891759..b2a791d5a281 100644 --- a/pkgs/development/python-modules/chromadb/default.nix +++ b/pkgs/development/python-modules/chromadb/default.nix @@ -180,7 +180,6 @@ buildPythonPackage rec { }; pytestFlags = [ - "-x" # these are slow tests, so stop on the first failure "-v" "-Wignore:DeprecationWarning" "-Wignore:PytestCollectionWarning" @@ -198,61 +197,36 @@ buildPythonPackage rec { ]; disabledTests = [ - # Tests are flaky / timing sensitive - "test_fastapi_server_token_authn_allows_when_it_should_allow" - "test_fastapi_server_token_authn_rejects_when_it_should_reject" - - # Issue with event loop - "test_http_client_bw_compatibility" - - # httpx ReadError - "test_not_existing_collection_delete" - - # Tests launch a server and try to connect to it - # These either have https connection errors or name resolution errors + # Failure in name resolution "test_collection_query_with_invalid_collection_throws" "test_collection_update_with_invalid_collection_throws" "test_default_embedding" "test_persist_index_loading" - "test_query_id_filtering_e2e" - "test_query_id_filtering_medium_dataset" - "test_query_id_filtering_small_dataset" + # Deadlocks intermittently "test_app" + # Depends on specific floating-point precision "test_base64_conversion_is_identity_f16" + # No such file or directory: 'openssl' "test_ssl_self_signed_without_ssl_verify" "test_ssl_self_signed" - - # Apparent race condition with sqlite - # See https://github.com/chroma-core/chroma/issues/4661 - "test_multithreaded_get_or_create" ]; disabledTestPaths = [ # Tests require network access - "bin/rust_python_compat_test.py" - "chromadb/test/configurations/test_collection_configuration.py" - "chromadb/test/ef/test_default_ef.py" - "chromadb/test/ef/test_onnx_mini_lm_l6_v2.py" - "chromadb/test/ef/test_voyageai_ef.py" - "chromadb/test/property/" "chromadb/test/distributed" "chromadb/test/ef" "chromadb/test/property/test_cross_version_persist.py" - "chromadb/test/stress/" - "chromadb/test/test_api.py" + "chromadb/test/stress" - # Tests time out (waiting for server) - "chromadb/test/test_cli.py" - - # Cannot find protobuf file while loading test - "chromadb/test/distributed/test_log_failover.py" + # Excessively slow + "chromadb/test/property/test_add.py" + "chromadb/test/property/test_persist.py" # ValueError: An instance of Chroma already exists for ephemeral with different settings "chromadb/test/test_chroma.py" - "chromadb/test/ef/test_multimodal_ef.py" ]; __darwinAllowLocalNetworking = true;