python312Packages.numpy_2: 2.0.1 -> 2.1.0 (#336284)

authored by

Doron Behar and committed by
GitHub
3188db0e ddc93e1e

+64 -49
+11 -12
pkgs/development/python-modules/llvmlite/default.nix
··· 11 11 setuptools, 12 12 13 13 # tests 14 - python, 14 + pytestCheckHook, 15 15 }: 16 16 17 17 buildPythonPackage rec { ··· 33 33 setuptools 34 34 ]; 35 35 36 - # Disable static linking 37 - # https://github.com/numba/llvmlite/issues/93 38 36 postPatch = '' 39 - substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" "" 40 - 41 - substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope" 37 + substituteInPlace llvmlite/tests/test_binding.py \ 38 + --replace-fail "test_linux" "nope" 42 39 ''; 43 40 44 41 # Set directory containing llvm-config binary ··· 46 43 export LLVM_CONFIG=${llvm.dev}/bin/llvm-config 47 44 ''; 48 45 49 - checkPhase = '' 50 - runHook preCheck 51 - ${python.executable} runtests.py 52 - runHook postCheck 46 + nativeCheckInputs = [ 47 + pytestCheckHook 48 + ]; 49 + # https://github.com/NixOS/nixpkgs/issues/255262 50 + preCheck = '' 51 + cd $out 53 52 ''; 54 53 55 54 __impureHostDeps = lib.optionals stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; 56 55 57 56 passthru.llvm = llvm; 58 57 59 - meta = with lib; { 58 + meta = { 60 59 changelog = "https://github.com/numba/llvmlite/blob/v${version}/CHANGE_LOG"; 61 60 description = "Lightweight LLVM python binding for writing JIT compilers"; 62 61 downloadPage = "https://github.com/numba/llvmlite"; 63 62 homepage = "http://llvmlite.pydata.org/"; 64 - license = licenses.bsd2; 63 + license = lib.licenses.bsd2; 65 64 }; 66 65 }
+51 -35
pkgs/development/python-modules/numba/default.nix
··· 7 7 python, 8 8 buildPythonPackage, 9 9 setuptools, 10 - numpy, 11 10 numpy_2, 12 11 llvmlite, 13 12 libcxx, ··· 17 16 runCommand, 18 17 writers, 19 18 numba, 19 + pytestCheckHook, 20 20 21 21 config, 22 22 ··· 27 27 28 28 # CUDA flags: 29 29 cudaSupport ? config.cudaSupport, 30 + testsWithoutSandbox ? false, 31 + doFullCheck ? false, 30 32 }: 31 33 32 34 let 33 35 cudatoolkit = cudaPackages.cuda_nvcc; 34 36 in 35 37 buildPythonPackage rec { 36 - version = "0.60.0"; 38 + version = "0.61.0dev0"; 37 39 pname = "numba"; 38 40 pyproject = true; 39 41 ··· 54 56 # that upstream relies on those strings to be valid, that's why we don't 55 57 # use `forceFetchGit = true;`.` If in the future we'll observe the hash 56 58 # changes too often, we can always use forceFetchGit, and inject the 57 - # relevant strings ourselves, using `sed` commands, in extraPostFetch. 58 - hash = "sha256-hUL281wHLA7wo8umzBNhiGJikyIF2loCzjLECuC+pO0="; 59 + # relevant strings ourselves, using `substituteInPlace`, in postFetch. 60 + hash = "sha256-KF9YQ6/FIfUQTJCAMgfIqnb/D8mdMbCC/tJvfYlSkgI="; 61 + # TEMPORARY: The way upstream knows it's source version is explained above, 62 + # and without this upstream sets the version in ${python.sitePackages} as 63 + # 0.61.0dev0, which causes dependent packages fail to find a valid 64 + # version of numba. 65 + postFetch = '' 66 + substituteInPlace $out/numba/_version.py \ 67 + --replace-fail \ 68 + 'git_refnames = " (tag: ${version})"' \ 69 + 'git_refnames = " (tag: 0.61.0, release0.61)"' 70 + ''; 59 71 }; 60 72 61 73 postPatch = '' ··· 69 81 70 82 build-system = [ 71 83 setuptools 72 - numpy_2 73 84 ]; 74 85 75 86 nativeBuildInputs = lib.optionals cudaSupport [ ··· 77 88 cudaPackages.cuda_nvcc 78 89 ]; 79 90 80 - buildInputs = lib.optionals cudaSupport [ cudaPackages.cuda_cudart ]; 91 + buildInputs = [ 92 + # Not propagating it, because it numba can work with either numpy_2 or numpy_1 93 + numpy_2 94 + ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ]; 81 95 82 96 dependencies = [ 83 - numpy 84 97 llvmlite 85 98 setuptools 86 99 ] ++ lib.optionals (pythonOlder "3.9") [ importlib-metadata ]; ··· 103 116 }) 104 117 ]; 105 118 106 - # run a smoke test in a temporary directory so that 107 - # a) Python picks up the installed library in $out instead of the build files 108 - # b) we have somewhere to put $HOME so some caching tests work 109 - # c) it doesn't take 6 CPU hours for the full suite 110 - checkPhase = '' 111 - runHook preCheck 112 - 113 - pushd $(mktemp -d) 114 - HOME=. ${python.interpreter} -m numba.runtests -m $NIX_BUILD_CORES numba.tests.test_usecases 115 - popd 119 + nativeCheckInputs = [ 120 + pytestCheckHook 121 + ]; 116 122 117 - runHook postCheck 123 + preCheck = '' 124 + export HOME="$(mktemp -d)" 125 + # https://github.com/NixOS/nixpkgs/issues/255262 126 + cd $out 118 127 ''; 119 128 129 + pytestFlagsArray = lib.optionals (!doFullCheck) [ 130 + # These are the most basic tests. Running all tests is too expensive, and 131 + # some of them fail (also differently on different platforms), so it will 132 + # be too hard to maintain such a `disabledTests` list. 133 + "${python.sitePackages}/numba/tests/test_usecases.py" 134 + ]; 135 + 136 + disabledTestPaths = lib.optionals (!testsWithoutSandbox) [ 137 + # See NOTE near passthru.tests.withoutSandbox 138 + "${python.sitePackages}/numba/cuda/tests" 139 + ]; 140 + 120 141 pythonImportsCheck = [ "numba" ]; 121 142 122 143 passthru.testers.cuda-detect = ··· 128 149 ''; 129 150 passthru.tests = { 130 151 # CONTRIBUTOR NOTE: numba also contains CUDA tests, though these cannot be run in 131 - # this sandbox environment. Consider running similar commands to those below outside the 132 - # sandbox manually if you have the appropriate hardware; support will be detected 133 - # and the corresponding tests enabled automatically. 134 - # Also, the full suite currently does not complete on anything but x86_64-linux. 135 - fullSuite = runCommand "${pname}-test" { } '' 136 - pushd $(mktemp -d) 137 - # pip and python in $PATH is needed for the test suite to pass fully 138 - PATH=${ 139 - python.withPackages (p: [ 140 - p.numba 141 - p.pip 142 - ]) 143 - }/bin:$PATH 144 - HOME=$PWD python -m numba.runtests -m $NIX_BUILD_CORES 145 - popd 146 - touch $out # stop Nix from complaining no output was generated and failing the build 147 - ''; 152 + # this sandbox environment. Consider building the derivation below with 153 + # --no-sandbox to get a view of how many tests succeed outside the sandbox. 154 + withoutSandbox = numba.override { 155 + doFullCheck = true; 156 + cudaSupport = true; 157 + testsWithoutSandbox = true; 158 + }; 159 + withSandbox = numba.override { 160 + cudaSupport = false; 161 + doFullCheck = true; 162 + testsWithoutSandbox = false; 163 + }; 148 164 }; 149 165 150 166 meta = with lib; {
+2 -2
pkgs/development/python-modules/numpy/2.nix
··· 58 58 in 59 59 buildPythonPackage rec { 60 60 pname = "numpy"; 61 - version = "2.0.1"; 61 + version = "2.1.0"; 62 62 pyproject = true; 63 63 64 64 disabled = pythonOlder "3.10"; ··· 66 66 src = fetchPypi { 67 67 inherit pname version; 68 68 extension = "tar.gz"; 69 - hash = "sha256-SFuHI1eWQQw1GaaZz+H6qwl+UJ6Q67BdzQmNsq6H57M="; 69 + hash = "sha256-fckNoAgffh2knsTjmO3mqOnMT16+X54GtEPtiJ7pqqI="; 70 70 }; 71 71 72 72 patches = lib.optionals python.hasDistutilsCxxPatch [