1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, gmpy2
5, isPyPy
6, setuptools
7, pytestCheckHook
8}:
9
10buildPythonPackage rec {
11 pname = "mpmath";
12 version = "1.3.0";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "mpmath";
17 repo = "mpmath";
18 rev = "refs/tags/${version}";
19 hash = "sha256-9BGcaC3TyolGeO65/H42T/WQY6z5vc1h+MA+8MGFChU=";
20 };
21
22 nativeBuildInputs = [
23 setuptools
24 ];
25
26 passthru.optional-dependencies = {
27 gmpy = lib.optionals (!isPyPy) [
28 gmpy2
29 ];
30 };
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 meta = with lib; {
37 homepage = "https://mpmath.org/";
38 description = "A pure-Python library for multiprecision floating arithmetic";
39 license = licenses.bsd3;
40 maintainers = with maintainers; [ lovek323 ];
41 platforms = platforms.unix;
42 };
43}