Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 79 lines 1.6 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 isPyPy, 7 pythonOlder, 8 setuptools, 9 gmp, 10 mpfr, 11 libmpc, 12 pytestCheckHook, 13 hypothesis, 14 cython, 15 mpmath, 16 # Reverse dependency 17 sage, 18}: 19 20buildPythonPackage rec { 21 pname = "gmpy2"; 22 version = "2.2.0a2"; 23 pyproject = true; 24 25 disabled = isPyPy || pythonOlder "3.7"; 26 27 src = fetchFromGitHub { 28 owner = "aleaxit"; 29 repo = "gmpy"; 30 rev = "refs/tags/gmpy2-${version}"; 31 hash = "sha256-luLEDEY1cezhzZo4fXmM/MUg2YyAaz7n0HwSpbNayP8="; 32 }; 33 34 build-system = [ setuptools ]; 35 36 buildInputs = [ 37 gmp 38 mpfr 39 libmpc 40 ]; 41 42 # make relative imports in tests work properly 43 preCheck = '' 44 rm gmpy2 -r 45 ''; 46 47 nativeCheckInputs = [ 48 pytestCheckHook 49 hypothesis 50 cython 51 mpmath 52 ]; 53 54 disabledTests = 55 lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ 56 # issue with some overflow logic 57 "test_mpz_to_bytes" 58 "test_mpz_from_bytes" 59 ] 60 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 61 # TypeError: mpq() requires numeric or string argument 62 # not sure why it only fails on Darwin 63 "test_mpq_from_Decimal" 64 ]; 65 66 pythonImportsCheck = [ "gmpy2" ]; 67 68 passthru.tests = { 69 inherit sage; 70 }; 71 72 meta = { 73 changelog = "https://github.com/aleaxit/gmpy/blob/${src.rev}/docs/history.rst"; 74 description = "Interface to GMP, MPFR, and MPC for Python 3.7+"; 75 homepage = "https://github.com/aleaxit/gmpy/"; 76 license = lib.licenses.lgpl3Plus; 77 maintainers = with lib.maintainers; [ tomasajt ]; 78 }; 79}