2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2022-02-10 20:34:41 +00:00
|
|
|
, stdenv
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, hypothesis
|
2023-03-15 16:39:30 +00:00
|
|
|
, numpy
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-03-15 16:39:30 +00:00
|
|
|
, setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
, typing-extensions
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastnumbers";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "5.1.0";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SethMMorton";
|
|
|
|
repo = pname;
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-TC9+xOvskABpChlrSJcHy6O7D7EnIKL6Ekt/vaLBX2E=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# Tests fail due to numeric precision differences on ARM
|
|
|
|
# See https://github.com/SethMMorton/fastnumbers/issues/28
|
2022-08-12 12:06:08 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isAarch;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
hypothesis
|
2023-03-15 16:39:30 +00:00
|
|
|
numpy
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--hypothesis-profile=standard"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"fastnumbers"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module for number conversion";
|
|
|
|
homepage = "https://github.com/SethMMorton/fastnumbers";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/SethMMorton/fastnumbers/blob/${version}/CHANGELOG.md";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|