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