lol

Merge pull request #199910 from tpwrules/upgrade-numba

Closes https://github.com/NixOS/nixpkgs/issues/197045

authored by

Martin Weinelt and committed by
GitHub
555be4e7 5a880f03

+47 -18
+7 -10
pkgs/development/python-modules/numba/cuda_path.patch
··· 1 1 diff --git a/numba/cuda/cuda_paths.py b/numba/cuda/cuda_paths.py 2 - index b9988bc..a642680 100644 2 + index 0da435d33..7b1fde087 100644 3 3 --- a/numba/cuda/cuda_paths.py 4 4 +++ b/numba/cuda/cuda_paths.py 5 5 @@ -24,10 +24,7 @@ def _find_valid_path(options): ··· 14 14 ] 15 15 by, libdir = _find_valid_path(options) 16 16 return by, libdir 17 - @@ -35,18 +32,16 @@ def _get_libdevice_path_decision(): 17 + @@ -35,16 +32,14 @@ def _get_libdevice_path_decision(): 18 18 19 19 def _nvvm_lib_dir(): 20 20 if IS_WIN32: 21 21 - return 'nvvm', 'bin' 22 22 + return 'bin', 23 - elif IS_OSX: 24 - - return 'nvvm', 'lib' 25 - + return 'lib', 26 23 else: 27 24 - return 'nvvm', 'lib64' 28 25 + return 'lib64', ··· 33 30 - ('Conda environment', get_conda_ctk()), 34 31 - ('CUDA_HOME', get_cuda_home(*_nvvm_lib_dir())), 35 32 - ('System', get_system_ctk(*_nvvm_lib_dir())), 36 - + ('Nix store', get_nix_ctk(*_nvvm_lib_dir())), 33 + + ('Nix store', get_nix_ctk(*_nvvm_lib_dir())), 37 34 ] 38 35 by, path = _find_valid_path(options) 39 36 return by, path 40 - @@ -74,14 +69,12 @@ def _cudalib_path(): 41 - elif IS_OSX: 42 - return 'lib' 37 + @@ -64,14 +59,12 @@ def _cudalib_path(): 38 + if IS_WIN32: 39 + return 'bin' 43 40 else: 44 41 - return 'lib64' 45 42 + return 'lib' ··· 54 51 ] 55 52 by, libdir = _find_valid_path(options) 56 53 return by, libdir 57 - @@ -92,6 +85,22 @@ def _get_cudalib_dir(): 54 + @@ -82,6 +75,22 @@ def _get_cudalib_dir(): 58 55 return _env_path_tuple(by, libdir) 59 56 60 57
+40 -8
pkgs/development/python-modules/numba/default.nix
··· 11 11 , libcxx 12 12 , importlib-metadata 13 13 , substituteAll 14 + , runCommand 15 + , fetchpatch 14 16 15 17 # CUDA-only dependencies: 16 18 , addOpenGLRunpath ? null ··· 23 25 let 24 26 inherit (cudaPackages) cudatoolkit; 25 27 in buildPythonPackage rec { 26 - version = "0.56.2"; 28 + version = "0.56.4"; 27 29 pname = "numba"; 28 30 format = "setuptools"; 29 31 disabled = pythonOlder "3.6" || pythonAtLeast "3.11"; 30 32 31 33 src = fetchPypi { 32 34 inherit pname version; 33 - hash = "sha256-NJLwpdCeJX/FIfU3emxrkH7sGSDRRznwskWLnSmUalo="; 35 + hash = "sha256-Mtn+9BLIFIPX7+DOts9NMxD96LYkqc7MoA95BXOslu4="; 34 36 }; 35 37 36 38 postPatch = '' ··· 55 57 cudatoolkit.lib 56 58 ]; 57 59 58 - patches = lib.optionals cudaSupport [ 60 + patches = [ 61 + # fix failure in test_cache_invalidate (numba.tests.test_caching.TestCache) 62 + # remove when upgrading past version 0.56 63 + (fetchpatch { 64 + name = "fix-test-cache-invalidate-readonly.patch"; 65 + url = "https://github.com/numba/numba/commit/993e8c424055a7677b2755b184fc9e07549713b9.patch"; 66 + hash = "sha256-IhIqRLmP8gazx+KWIyCxZrNLMT4jZT8CWD3KcH4KjOo="; 67 + }) 68 + ] ++ lib.optionals cudaSupport [ 59 69 (substituteAll { 60 70 src = ./cuda_path.patch; 61 71 cuda_toolkit_path = cudatoolkit; ··· 70 80 done 71 81 ''; 72 82 73 - # Copy test script into $out and run the test suite. 83 + # run a smoke test in a temporary directory so that 84 + # a) Python picks up the installed library in $out instead of the build files 85 + # b) we have somewhere to put $HOME so some caching tests work 86 + # c) it doesn't take 6 CPU hours for the full suite 74 87 checkPhase = '' 75 - ${python.interpreter} -m numba.runtests 76 - ''; 88 + runHook preCheck 77 89 78 - # ImportError: cannot import name '_typeconv' 79 - doCheck = false; 90 + pushd $(mktemp -d) 91 + HOME=. ${python.interpreter} -m numba.runtests -m $NIX_BUILD_CORES numba.tests.test_usecases 92 + popd 93 + 94 + runHook postCheck 95 + ''; 80 96 81 97 pythonImportsCheck = [ 82 98 "numba" 83 99 ]; 100 + 101 + passthru.tests = { 102 + # CONTRIBUTOR NOTE: numba also contains CUDA tests, though these cannot be run in 103 + # this sandbox environment. Consider running similar commands to those below outside the 104 + # sandbox manually if you have the appropriate hardware; support will be detected 105 + # and the corresponding tests enabled automatically. 106 + # Also, the full suite currently does not complete on anything but x86_64-linux. 107 + fullSuite = runCommand "${pname}-test" {} '' 108 + pushd $(mktemp -d) 109 + # pip and python in $PATH is needed for the test suite to pass fully 110 + PATH=${python.withPackages (p: [ p.numba p.pip ])}/bin:$PATH 111 + HOME=$PWD python -m numba.runtests -m $NIX_BUILD_CORES 112 + popd 113 + touch $out # stop Nix from complaining no output was generated and failing the build 114 + ''; 115 + }; 84 116 85 117 meta = with lib; { 86 118 description = "Compiling Python code using LLVM";