Files
nixpkgs/pkgs/development/python-modules/faiss/default.nix
NAHO c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00

54 lines
937 B
Nix

{
lib,
buildPythonPackage,
callPackage,
faiss-build,
numpy,
packaging,
setuptools,
pip,
}:
buildPythonPackage {
inherit (faiss-build) pname version;
pyproject = true;
src = "${lib.getOutput "dist" faiss-build}";
postPatch = ''
mkdir dist
mv *.whl dist/
'';
build-system = [
setuptools
pip
];
dependencies = [
numpy
packaging
];
# E.g. cuda libraries; needed because reference scanning
# can't see inside the wheels
inherit (faiss-build) buildInputs;
dontBuild = true;
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 removeAttrs [ "mainProgram" ])
(m: m // { description = "Bindings for faiss, the similarity search library"; })
];
}