1{ stdenv
2, lib
3, fetchFromGitHub
4, buildPythonPackage
5, pkgconfig
6, gmp
7, pari
8, mpfr
9, fplll
10, cython
11, cysignals
12, numpy
13, pytest
14}:
15
16buildPythonPackage rec {
17 pname = "fpylll";
18 version = "0.5.9";
19
20 src = fetchFromGitHub {
21 owner = "fplll";
22 repo = "fpylll";
23 rev = version;
24 hash = "sha256-T6l6hKzRDevlLyLu5H+bnEdl0OhsPer1coCDiftbPAk=";
25 };
26
27 buildInputs = [
28 gmp
29 pari
30 mpfr
31 fplll
32 ];
33
34 propagatedBuildInputs = [
35 cython
36 cysignals
37 numpy
38 ];
39
40 nativeBuildInputs = [
41 pkgconfig
42 ];
43
44 nativeCheckInputs = [
45 pytest
46 ];
47
48 checkPhase = ''
49 # Since upstream introduced --doctest-modules in
50 # https://github.com/fplll/fpylll/commit/9732fdb40cf1bd43ad1f60762ec0a8401743fc79,
51 # it is necessary to ignore import mismatches. Not sure why, but the files
52 # should be identical anyway.
53 PY_IGNORE_IMPORTMISMATCH=1 pytest
54 '';
55
56 meta = with lib; {
57 description = "A Python interface for fplll";
58 changelog = "https://github.com/fplll/fpylll/releases/tag/${version}";
59 homepage = "https://github.com/fplll/fpylll";
60 maintainers = teams.sage.members;
61 license = licenses.gpl2Plus;
62 };
63}