Merge pull request #245792 from samuela/samuela/flax

python3Packages.flax: fix build

authored by

Samuel Ainsworth and committed by
GitHub
878e3aae f7505dcd

+68 -3
+13 -3
pkgs/development/python-modules/flax/default.nix
··· 10 , optax 11 , pytest-xdist 12 , pytestCheckHook 13 , tensorflow 14 , fetchpatch 15 , rich 16 }: ··· 26 hash = "sha256-Vv68BK83gTIKj0r9x+twdhqmRYziD0vxQCdHkYSeTak="; 27 }; 28 29 - buildInputs = [ jaxlib ]; 30 31 propagatedBuildInputs = [ 32 jax ··· 35 numpy 36 optax 37 rich 38 ]; 39 40 pythonImportsCheck = [ 41 "flax" ··· 64 # `tensorflow_datasets`, `vocabulary`) so the benefits of trying to run them 65 # would be limited anyway. 66 "examples/*" 67 ]; 68 69 disabledTests = [ ··· 88 changelog = "https://github.com/google/flax/releases/tag/v${version}"; 89 license = licenses.asl20; 90 maintainers = with maintainers; [ ndl ]; 91 - # Requires orbax which is not available 92 - broken = true; 93 }; 94 }
··· 10 , optax 11 , pytest-xdist 12 , pytestCheckHook 13 + , pythonRelaxDepsHook 14 , tensorflow 15 + , tensorstore 16 , fetchpatch 17 , rich 18 }: ··· 28 hash = "sha256-Vv68BK83gTIKj0r9x+twdhqmRYziD0vxQCdHkYSeTak="; 29 }; 30 31 + nativeBuildInputs = [ jaxlib pythonRelaxDepsHook ]; 32 33 propagatedBuildInputs = [ 34 jax ··· 37 numpy 38 optax 39 rich 40 + tensorstore 41 ]; 42 + 43 + # See https://github.com/google/flax/pull/2882. 44 + pythonRemoveDeps = [ "orbax" ]; 45 46 pythonImportsCheck = [ 47 "flax" ··· 70 # `tensorflow_datasets`, `vocabulary`) so the benefits of trying to run them 71 # would be limited anyway. 72 "examples/*" 73 + 74 + # See https://github.com/google/flax/issues/3232. 75 + "tests/jax_utils_test.py" 76 + 77 + # Requires orbax which is not packaged as of 2023-07-27. 78 + "tests/checkpoints_test.py" 79 ]; 80 81 disabledTests = [ ··· 100 changelog = "https://github.com/google/flax/releases/tag/v${version}"; 101 license = licenses.asl20; 102 maintainers = with maintainers; [ ndl ]; 103 }; 104 }
+53
pkgs/development/python-modules/tensorstore/default.nix
···
··· 1 + { autoPatchelfHook 2 + , buildPythonPackage 3 + , fetchPypi 4 + , lib 5 + , numpy 6 + , python 7 + , stdenv 8 + }: 9 + 10 + let 11 + pythonVersionNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion; 12 + systemToPlatform = { 13 + "x86_64-linux" = "manylinux_2_17_x86_64.manylinux2014_x86_64"; 14 + "aarch64-darwin" = "macosx_11_0_arm64"; 15 + }; 16 + hashes = { 17 + "310-x86_64-linux" = "sha256-Zuy2zBLV950CMbdtpLNpIWqnXHw2jkjrZG48eGtm42w="; 18 + "311-x86_64-linux" = "sha256-Bg5j8QB5z8Ju4bEQsZDojJHTJ4UoQF1pkd4ma83Sc/s="; 19 + "310-aarch64-darwin" = "sha256-6Tta4ru1TnobFa4FXWz8fm9rAxF0G09Y2Pj/KaQPVnE="; 20 + "311-aarch64-darwin" = "sha256-Sb0tv9ZPQJ4n9b0ybpjJWpreQPZvSC5Sd7CXuUwHCn0="; 21 + }; 22 + in 23 + buildPythonPackage rec { 24 + pname = "tensorstore"; 25 + version = "0.1.40"; 26 + format = "wheel"; 27 + 28 + # The source build involves some wonky Bazel stuff. 29 + src = fetchPypi { 30 + inherit pname version; 31 + format = "wheel"; 32 + python = "cp${pythonVersionNoDot}"; 33 + abi = "cp${pythonVersionNoDot}"; 34 + dist = "cp${pythonVersionNoDot}"; 35 + platform = systemToPlatform.${stdenv.system} or (throw "unsupported system"); 36 + hash = hashes."${pythonVersionNoDot}-${stdenv.system}" or (throw "unsupported system/python version combination"); 37 + }; 38 + 39 + nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; 40 + 41 + propagatedBuildInputs = [ numpy ]; 42 + 43 + pythonImportsCheck = [ "tensorstore" ]; 44 + 45 + meta = with lib; { 46 + description = "Library for reading and writing large multi-dimensional arrays"; 47 + homepage = "https://google.github.io/tensorstore"; 48 + changelog = "https://github.com/google/tensorstore/releases/tag/v${version}"; 49 + license = licenses.asl20; 50 + sourceProvenance = [ sourceTypes.binaryNativeCode ]; 51 + maintainers = with maintainers; [ samuela ]; 52 + }; 53 + }
+2
pkgs/top-level/python-packages.nix
··· 12468 12469 tensorrt = callPackage ../development/python-modules/tensorrt { }; 12470 12471 tellduslive = callPackage ../development/python-modules/tellduslive { }; 12472 12473 termcolor = callPackage ../development/python-modules/termcolor { };
··· 12468 12469 tensorrt = callPackage ../development/python-modules/tensorrt { }; 12470 12471 + tensorstore = callPackage ../development/python-modules/tensorstore { }; 12472 + 12473 tellduslive = callPackage ../development/python-modules/tellduslive { }; 12474 12475 termcolor = callPackage ../development/python-modules/termcolor { };