diff --git a/pkgs/development/python-modules/snappy/default.nix b/pkgs/development/python-modules/snappy/default.nix index b9927c1aeb8b..7c733a29279b 100644 --- a/pkgs/development/python-modules/snappy/default.nix +++ b/pkgs/development/python-modules/snappy/default.nix @@ -1,16 +1,22 @@ { lib, stdenv, - fetchpatch, + fetchFromGitHub, python, buildPythonPackage, - fetchFromGitHub, + fetchpatch, + + # build-time dependencies setuptools, - cypari, cython, + + # non-Python runtime dependencies + libGL, + + # Python runtime dependencies + cypari, fxrays, ipython, - libGL, low-index, packaging, pickleshare, @@ -20,9 +26,16 @@ snappy-15-knots, snappy-manifolds, spherogram, + tkinter-gl, + + # documentation sphinxHook, sphinx-rtd-theme, - tkinter-gl, + + # tests + runCommand, + sage, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { @@ -58,7 +71,7 @@ buildPythonPackage rec { postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' substituteInPlace setup.py \ - --replace-fail "/usr/include/GL" "${libGL.dev}/include/GL" + --replace-fail "/usr/include/GL" "${lib.getDev libGL}/include/GL" substituteInPlace freedesktop/share/applications/snappy.desktop \ --replace-fail "Exec=/usr/bin/env python3 -m snappy.app" "Exec=SnapPy" '' @@ -117,6 +130,25 @@ buildPythonPackage rec { runHook postCheck ''; + passthru.tests.sage = + let + sage' = sage.override { + extraPythonPackages = ps: [ ps.snappy ]; + requireSageTests = false; + }; + in + runCommand "snappy-sage-tests" + { + nativeBuildInputs = [ + sage' + writableTmpDirAsHomeHook + ]; + } + '' + sage -python -m snappy.test --skip-gui + touch $out + ''; + meta = { description = "Studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures"; changelog = "https://snappy.computop.org/news.html";