Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / tensorstore / default.nix
blob7ad175d7007726b17c9eeed4db0d51ba3a32c1b2
1 { autoPatchelfHook
2 , buildPythonPackage
3 , fetchPypi
4 , lib
5 , ml-dtypes
6 , numpy
7 , python
8 , stdenv
9 }:
11 let
12   pythonVersionNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
13   systemToPlatform = {
14     "x86_64-linux" = "manylinux_2_17_x86_64.manylinux2014_x86_64";
15     "aarch64-darwin" = "macosx_11_0_arm64";
16   };
17   hashes = {
18     "310-x86_64-linux" = "sha256-1b6w9wgT6fffTTpJ3MxdPSrFD7Xaby6prQYFljVn4x4=";
19     "311-x86_64-linux" = "sha256-8+HlzaxH30gB5N+ZKR0Oq+yswhq5gjiSF9jVsg8U22E=";
20     "312-x86_64-linux" = "sha256-e8iEQzB4D3RSXgrcPC4me/vsFKoXf1QFNZfQ7968zQE=";
21     "310-aarch64-darwin" = "sha256-2C60yJk/Pbx2woV7hzEmWGzNKWWnySDfTPm247PWIRA=";
22     "311-aarch64-darwin" = "sha256-rdLB7l/8ZYjV589qKtORiyu1rC7W30wzrsz1uihNRpk=";
23     "312-aarch64-darwin" = "sha256-DpbYMIbqceQeiL7PYwnvn9jLtv8EmfHXmxvPfZCw914=";
24   };
26 buildPythonPackage rec {
27   pname = "tensorstore";
28   version = "0.1.53";
29   format = "wheel";
31   # The source build involves some wonky Bazel stuff.
32   src = fetchPypi {
33     inherit pname version;
34     format = "wheel";
35     python = "cp${pythonVersionNoDot}";
36     abi = "cp${pythonVersionNoDot}";
37     dist = "cp${pythonVersionNoDot}";
38     platform = systemToPlatform.${stdenv.system} or (throw "unsupported system");
39     hash = hashes."${pythonVersionNoDot}-${stdenv.system}" or (throw "unsupported system/python version combination");
40   };
42   nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
44   propagatedBuildInputs = [
45     ml-dtypes
46     numpy
47   ];
49   pythonImportsCheck = [ "tensorstore" ];
51   meta = with lib; {
52     description = "Library for reading and writing large multi-dimensional arrays";
53     homepage = "https://google.github.io/tensorstore";
54     changelog = "https://github.com/google/tensorstore/releases/tag/v${version}";
55     license = licenses.asl20;
56     sourceProvenance = [ sourceTypes.binaryNativeCode ];
57     maintainers = with maintainers; [ samuela ];
58   };