at master 946 B view raw
1{ 2 lib, 3 buildPythonPackage, 4 callPackage, 5 faiss-build, 6 numpy, 7 packaging, 8 setuptools, 9 pip, 10}: 11 12buildPythonPackage { 13 inherit (faiss-build) pname version; 14 pyproject = true; 15 16 src = "${lib.getOutput "dist" faiss-build}"; 17 18 postPatch = '' 19 mkdir dist 20 mv *.whl dist/ 21 ''; 22 23 build-system = [ 24 setuptools 25 pip 26 ]; 27 28 dependencies = [ 29 numpy 30 packaging 31 ]; 32 33 # E.g. cuda libraries; needed because reference scanning 34 # can't see inside the wheels 35 inherit (faiss-build) buildInputs; 36 37 dontBuild = true; 38 39 pythonImportsCheck = [ "faiss" ]; 40 41 passthru = { 42 inherit (faiss-build) cudaSupport cudaPackages pythonSupport; 43 44 tests = { 45 pytest = callPackage ./pytest.nix { inherit faiss-build; }; 46 }; 47 }; 48 49 meta = lib.pipe (faiss-build.meta or { }) [ 50 (lib.flip builtins.removeAttrs [ "mainProgram" ]) 51 (m: m // { description = "Bindings for faiss, the similarity search library"; }) 52 ]; 53}