1{
2 lib,
3 stdenv,
4 buildPythonPackage,
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.1.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "SethMMorton";
23 repo = "fastnumbers";
24 tag = version;
25 hash = "sha256-TC9+xOvskABpChlrSJcHy6O7D7EnIKL6Ekt/vaLBX2E=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [ typing-extensions ];
31
32 # Tests fail due to numeric precision differences on ARM
33 # See https://github.com/SethMMorton/fastnumbers/issues/28
34 doCheck = !stdenv.hostPlatform.isAarch;
35
36 nativeCheckInputs = [
37 hypothesis
38 numpy
39 pytestCheckHook
40 ];
41
42 pytestFlags = [ "--hypothesis-profile=standard" ];
43
44 pythonImportsCheck = [ "fastnumbers" ];
45
46 meta = with lib; {
47 description = "Python module for number conversion";
48 homepage = "https://github.com/SethMMorton/fastnumbers";
49 changelog = "https://github.com/SethMMorton/fastnumbers/blob/${version}/CHANGELOG.md";
50 license = licenses.mit;
51 maintainers = with maintainers; [ fab ];
52 };
53}