2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonAtLeast
|
|
|
|
, fetchFromGitHub
|
|
|
|
, attrs
|
|
|
|
, pexpect
|
|
|
|
, doCheck ? true
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
2020-06-02 18:00:15 +00:00
|
|
|
, sortedcontainers
|
2021-03-09 03:18:52 +00:00
|
|
|
, tzdata
|
2022-02-10 20:34:41 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
|
|
# https://hypothesis.readthedocs.org/en/latest/packaging.html
|
|
|
|
|
|
|
|
# Hypothesis has optional dependencies on the following libraries
|
|
|
|
# pytz fake_factory django numpy pytest
|
|
|
|
# If you need these, you can just add them to your environment.
|
|
|
|
|
|
|
|
pname = "hypothesis";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "6.35.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "HypothesisWorks";
|
|
|
|
repo = "hypothesis-python";
|
|
|
|
rev = "hypothesis-python-${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "08wph7q3c08480ma2p7m7mamy0g7g7r5jqpwdyhdga4cfg734527";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
|
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
sortedcontainers
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
checkInputs = [
|
|
|
|
pexpect
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ lib.optional (pythonAtLeast "3.9") [
|
|
|
|
tzdata
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit doCheck;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
# This file changes how pytest runs and breaks it
|
|
|
|
preCheck = ''
|
|
|
|
rm tox.ini
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests/cover"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"hypothesis"
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-02-10 20:34:41 +00:00
|
|
|
description = "Library for property based testing";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/HypothesisWorks/hypothesis";
|
|
|
|
license = licenses.mpl20;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|