1{ lib
2, stdenv
3, buildPythonPackage
4, fastnumbers
5, fetchFromGitHub
6, hypothesis
7, numpy
8, pytestCheckHook
9, pythonOlder
10, setuptools
11, typing-extensions
12}:
13
14buildPythonPackage rec {
15 pname = "fastnumbers";
16 version = "5.0.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "SethMMorton";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-y9QnFh44zHC+CSlYtKPmkhLSFBUquYZv4qP/pQxu9e0=";
26 };
27
28 nativeBuildInputs = [
29 setuptools
30 ];
31
32 propagatedBuildInputs = [
33 typing-extensions
34 ];
35
36 # Tests fail due to numeric precision differences on ARM
37 # See https://github.com/SethMMorton/fastnumbers/issues/28
38 doCheck = !stdenv.hostPlatform.isAarch;
39
40 nativeCheckInputs = [
41 hypothesis
42 numpy
43 pytestCheckHook
44 ];
45
46 pythonImportsCheck = [
47 "fastnumbers"
48 ];
49
50 meta = with lib; {
51 description = "Python module for number conversion";
52 homepage = "https://github.com/SethMMorton/fastnumbers";
53 changelog = "https://github.com/SethMMorton/fastnumbers/blob/${version}/CHANGELOG.md";
54 license = licenses.mit;
55 maintainers = with maintainers; [ fab ];
56 };
57}