Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970{ lib, runCommand, python, writableTmpDirAsHomeHook, xvfb-run, pkgs,}:
let testRoot = ./.; fs = lib.fileset;
testFiles = lib.pipe testRoot [ (fs.fileFilter (file: file.hasExt "py")) (fs.toList) ];
brokenTests = [ # FIX: # scipy.sparse.linalg._eigen.arpack.arpack.ArpackNoConvergence: ARPACK # error -1: No convergence (20221 iterations, 1/3 eigenvectors converged) ./resonant-cavity.py ];
# /path/to/foo.py -> "foo" nameOf = file: lib.removeSuffix ".py" (lib.baseNameOf file);
mkTest = file: runCommand "test-${nameOf file}" { nativeBuildInputs = let pyEnv = python.withPackages (ps: with ps; [ emerge ]);
# Since we're calling this file using python's `callPackage`, it tries to use # `python3Packages.mesa` rather than the toplevel one. However, the former has # been removed because it's broken. # # As a workaround, we're getting the toplevel `mesa` through `pkgs`. mesa = pkgs.mesa; in [ pyEnv writableTmpDirAsHomeHook xvfb-run mesa.llvmpipeHook # OpenGL context ];
env.EMERGE_MP_SOLVER = lib.optionalString python.pkgs.emerge.cudaSupport "CUDSS"; env.NUMBA_DISABLE_JIT = 1; # quite slow and won't be cached anyways
meta.broken = lib.elem file brokenTests; } '' xvfb-run python ${file} mkdir -p $out cp *.png $out '';
testAttrs = lib.listToAttrs ( map (file: { name = nameOf file; value = mkTest file; }) testFiles );intestAttrs