Unverified Commit c841bb40 authored by Someone's avatar Someone Committed by GitHub
Browse files

Merge pull request #330687 from SomeoneSerge/fix/faiss-eval

faiss.passthru.tests: unbreak eval
parents fcb2a4a5 670ac560
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -137,7 +137,9 @@ stdenv.mkDerivation {
          ''
            demo_ivfpq_indexing && touch $out
          '';
    } // lib.optionalAttrs pythonSupport { pytest = pythonPackages.callPackage ./tests.nix { }; };
      pythonFaiss = pythonPackages.faiss;
      pytest = pythonPackages.faiss.tests.pytest;
    };
  };

  meta = with lib; {
+9 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  callPackage,
  faiss-build,
  numpy,
  packaging,
@@ -39,6 +40,14 @@ buildPythonPackage {

  pythonImportsCheck = [ "faiss" ];

  passthru = {
    inherit (faiss-build) cudaSupport cudaPackages pythonSupport;

    tests = {
      pytest = callPackage ./pytest.nix { inherit faiss-build; };
    };
  };

  meta = lib.pipe (faiss-build.meta or { }) [
    (lib.flip builtins.removeAttrs [ "mainProgram" ])
    (m: m // { description = "Bindings for faiss, the similarity search library"; })
+14 −11
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, faiss
, scipy
, pytestCheckHook
{
  lib,
  buildPythonPackage,
  faiss,
  faiss-build,
  scipy,
  pytestCheckHook,
}:

assert faiss.pythonSupport;
@@ -13,15 +15,13 @@ buildPythonPackage {

  format = "other";

  src = "${faiss.src}/tests";
  src = "${faiss-build.src}/tests";

  dontBuild = true;
  dontInstall = true;

  # Tests that need GPUs and would fail in the sandbox
  disabledTestPaths = lib.optionals faiss.cudaSupport [
    "test_contrib.py"
  ];
  disabledTestPaths = lib.optionals faiss.cudaSupport [ "test_contrib.py" ];

  disabledTests = [
    # https://github.com/facebookresearch/faiss/issues/2836
@@ -32,6 +32,9 @@ buildPythonPackage {
    faiss
    pytestCheckHook
    scipy
  ] ++
  faiss.extra-requires.all;
  ];

  meta = faiss.meta // {
    description = "Faiss test suite";
  };
}