1{ buildPythonPackage, fetchurl, isPyPy, gmp, pythonAtLeast } :
2
3let
4 pname = "gmpy";
5 version = "1.17";
6in
7
8buildPythonPackage {
9 inherit pname version;
10
11 # Python 3.11 has finally made changes to its C API for which gmpy 1.17,
12 # published in 2013, would require patching. It seems unlikely that any
13 # patches will be forthcoming.
14 disabled = isPyPy || pythonAtLeast "3.11";
15
16 src = fetchurl {
17 url = "mirror://pypi/g/gmpy/${pname}-${version}.zip";
18 sha256 = "1a79118a5332b40aba6aa24b051ead3a31b9b3b9642288934da754515da8fa14";
19 };
20
21 buildInputs = [ gmp ];
22
23 meta = {
24 description = "GMP or MPIR interface to Python 2.4+ and 3.x";
25 homepage = "https://github.com/aleaxit/gmpy/";
26 };
27}