···1111, libcxx
1212, importlib-metadata
1313, substituteAll
1414+, runCommand
1515+, fetchpatch
14161517# CUDA-only dependencies:
1618, addOpenGLRunpath ? null
···2325let
2426 inherit (cudaPackages) cudatoolkit;
2527in buildPythonPackage rec {
2626- version = "0.56.2";
2828+ version = "0.56.4";
2729 pname = "numba";
2830 format = "setuptools";
2931 disabled = pythonOlder "3.6" || pythonAtLeast "3.11";
30323133 src = fetchPypi {
3234 inherit pname version;
3333- hash = "sha256-NJLwpdCeJX/FIfU3emxrkH7sGSDRRznwskWLnSmUalo=";
3535+ hash = "sha256-Mtn+9BLIFIPX7+DOts9NMxD96LYkqc7MoA95BXOslu4=";
3436 };
35373638 postPatch = ''
···5557 cudatoolkit.lib
5658 ];
57595858- patches = lib.optionals cudaSupport [
6060+ patches = [
6161+ # fix failure in test_cache_invalidate (numba.tests.test_caching.TestCache)
6262+ # remove when upgrading past version 0.56
6363+ (fetchpatch {
6464+ name = "fix-test-cache-invalidate-readonly.patch";
6565+ url = "https://github.com/numba/numba/commit/993e8c424055a7677b2755b184fc9e07549713b9.patch";
6666+ hash = "sha256-IhIqRLmP8gazx+KWIyCxZrNLMT4jZT8CWD3KcH4KjOo=";
6767+ })
6868+ ] ++ lib.optionals cudaSupport [
5969 (substituteAll {
6070 src = ./cuda_path.patch;
6171 cuda_toolkit_path = cudatoolkit;
···7080 done
7181 '';
72827373- # Copy test script into $out and run the test suite.
8383+ # run a smoke test in a temporary directory so that
8484+ # a) Python picks up the installed library in $out instead of the build files
8585+ # b) we have somewhere to put $HOME so some caching tests work
8686+ # c) it doesn't take 6 CPU hours for the full suite
7487 checkPhase = ''
7575- ${python.interpreter} -m numba.runtests
7676- '';
8888+ runHook preCheck
77897878- # ImportError: cannot import name '_typeconv'
7979- doCheck = false;
9090+ pushd $(mktemp -d)
9191+ HOME=. ${python.interpreter} -m numba.runtests -m $NIX_BUILD_CORES numba.tests.test_usecases
9292+ popd
9393+9494+ runHook postCheck
9595+ '';
80968197 pythonImportsCheck = [
8298 "numba"
8399 ];
100100+101101+ passthru.tests = {
102102+ # CONTRIBUTOR NOTE: numba also contains CUDA tests, though these cannot be run in
103103+ # this sandbox environment. Consider running similar commands to those below outside the
104104+ # sandbox manually if you have the appropriate hardware; support will be detected
105105+ # and the corresponding tests enabled automatically.
106106+ # Also, the full suite currently does not complete on anything but x86_64-linux.
107107+ fullSuite = runCommand "${pname}-test" {} ''
108108+ pushd $(mktemp -d)
109109+ # pip and python in $PATH is needed for the test suite to pass fully
110110+ PATH=${python.withPackages (p: [ p.numba p.pip ])}/bin:$PATH
111111+ HOME=$PWD python -m numba.runtests -m $NIX_BUILD_CORES
112112+ popd
113113+ touch $out # stop Nix from complaining no output was generated and failing the build
114114+ '';
115115+ };
8411685117 meta = with lib; {
86118 description = "Compiling Python code using LLVM";