nixpkgs/pkgs/development/python-modules/fastnumbers/default.nix
Sandro Jäckel 222222fd76
python310Packages.fastnumbers: disable hypothesis too slow healthcheck through upstream defined profiles
log lines I have:

last 10 log lines:
> tests/test_fastnumbers.py:1330: in test_given_unicode_digit_returns_true
>     @parametrize("func", get_funcs(funcs), ids=funcs)
> E   hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Only produced 9 valid examples in 1.26 seconds (0 invalid ones and 0 exceeded maximum size). Try decreasing size of the data you're generating (with e.g. max_size or max_leaves parameters).
> E   See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.too_slow to the suppress_health_check settings for this test.
> ---------------------------------- Hypothesis ----------------------------------
> You can add @seed(21402865096374572269346745328342401108) to this test or run pytest with --hypothesis-seed=21402865096374572269346745328342401108 to reproduce this failure.
> =========================== short test summary info ============================
> FAILED tests/test_fastnumbers.py::TestCheckingFunctions::test_given_unicode_digit_returns_true[check_int] - hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Onl...
> ============ 1 failed, 1838 passed, 1 skipped in 383.89s (0:06:23) =============
> /nix/store/37p8gq9zijbw6pj3lpi1ckqiv18j2g62-stdenv-linux/setup: line 1594: pop_var_context: head of shell_variables not a function context
For full logs, run 'nix log /nix/store/avsxawhbbrfmp0128i5qfsqkzxka343z-python3.10-fastnumbers-5.0.1.drv'.
2023-06-27 18:11:51 +02:00

61 lines
1.2 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, hypothesis
, numpy
, pytestCheckHook
, pythonOlder
, setuptools
, typing-extensions
}:
buildPythonPackage rec {
pname = "fastnumbers";
version = "5.0.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "SethMMorton";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-y9QnFh44zHC+CSlYtKPmkhLSFBUquYZv4qP/pQxu9e0=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
typing-extensions
];
# Tests fail due to numeric precision differences on ARM
# See https://github.com/SethMMorton/fastnumbers/issues/28
doCheck = !stdenv.hostPlatform.isAarch;
nativeCheckInputs = [
hypothesis
numpy
pytestCheckHook
];
pytestFlagsArray = [
"--hypothesis-profile=standard"
];
pythonImportsCheck = [
"fastnumbers"
];
meta = with lib; {
description = "Python module for number conversion";
homepage = "https://github.com/SethMMorton/fastnumbers";
changelog = "https://github.com/SethMMorton/fastnumbers/blob/${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}