1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, attrs
5, exceptiongroup
6, pexpect
7, doCheck ? true
8, pytestCheckHook
9, pytest-xdist
10, sortedcontainers
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "hypothesis";
16 version = "6.54.5";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "HypothesisWorks";
23 repo = "hypothesis";
24 rev = "hypothesis-python-${version}";
25 hash = "sha256-mr8ctmAzRgWNVpW+PZlOhaQ0l28P0U8PxvjoVjfHX78=";
26 };
27
28 postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
29
30 propagatedBuildInputs = [
31 attrs
32 sortedcontainers
33 ] ++ lib.optionals (pythonOlder "3.11") [
34 exceptiongroup
35 ];
36
37 checkInputs = [
38 pexpect
39 pytest-xdist
40 pytestCheckHook
41 ];
42
43 inherit doCheck;
44
45 # This file changes how pytest runs and breaks it
46 preCheck = ''
47 rm tox.ini
48 '';
49
50 pytestFlagsArray = [
51 "tests/cover"
52 ];
53
54 pythonImportsCheck = [
55 "hypothesis"
56 ];
57
58 meta = with lib; {
59 description = "Library for property based testing";
60 homepage = "https://github.com/HypothesisWorks/hypothesis";
61 license = licenses.mpl20;
62 maintainers = with maintainers; [ SuperSandro2000 ];
63 };
64}