2021-02-14 03:07:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonAtLeast
|
|
|
|
, fetchFromGitHub
|
|
|
|
, attrs
|
|
|
|
, pexpect
|
|
|
|
, doCheck ? true
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
2020-05-09 10:55:46 +01:00
|
|
|
, sortedcontainers
|
2021-02-14 03:07:19 +00:00
|
|
|
, tzdata
|
2017-01-30 20:15:56 +00:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
2019-04-22 09:24:21 +01:00
|
|
|
# https://hypothesis.readthedocs.org/en/latest/packaging.html
|
2017-01-30 20:15:56 +00:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "hypothesis";
|
2021-02-14 03:07:19 +00:00
|
|
|
version = "5.49.0";
|
2017-01-30 20:15:56 +00:00
|
|
|
|
2018-07-19 17:36:05 +01:00
|
|
|
# Use github tarballs that includes tests
|
2017-01-30 20:15:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "HypothesisWorks";
|
2017-05-27 13:24:47 +01:00
|
|
|
repo = "hypothesis-python";
|
2018-07-19 17:36:05 +01:00
|
|
|
rev = "hypothesis-python-${version}";
|
2021-02-14 03:07:19 +00:00
|
|
|
sha256 = "1lr9a93vdx70s9i1zazazif5hy8fbqhvwqq402ygpf53yw4lgi2w";
|
2018-02-12 10:02:07 +00:00
|
|
|
};
|
2017-01-30 20:15:56 +00:00
|
|
|
|
2018-07-19 17:36:05 +01:00
|
|
|
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
|
|
|
|
|
2020-05-09 10:55:46 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
sortedcontainers
|
2021-02-14 03:07:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook pytest-xdist pexpect ]
|
|
|
|
++ lib.optional (pythonAtLeast "3.9") tzdata;
|
2017-01-30 20:15:56 +00:00
|
|
|
|
|
|
|
inherit doCheck;
|
|
|
|
|
2021-02-14 03:07:19 +00:00
|
|
|
# This file changes how pytest runs and breaks it
|
|
|
|
preCheck = ''
|
|
|
|
rm tox.ini
|
2017-01-30 20:15:56 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-14 03:07:19 +00:00
|
|
|
pytestFlagsArray = [ "tests/cover" ];
|
|
|
|
|
2018-02-12 10:02:07 +00:00
|
|
|
meta = with lib; {
|
2017-01-30 20:15:56 +00:00
|
|
|
description = "A Python library for property based testing";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/HypothesisWorks/hypothesis";
|
2017-01-30 20:15:56 +00:00
|
|
|
license = licenses.mpl20;
|
2021-02-14 03:07:19 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2017-01-30 20:15:56 +00:00
|
|
|
};
|
|
|
|
}
|