linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / hypothesis / default.nix
blobe956cb9cc46fcbb0fc4a76b1e4d7ea245a785a3a
1 { lib
2 , buildPythonPackage
3 , pythonAtLeast
4 , fetchFromGitHub
5 , attrs
6 , pexpect
7 , doCheck ? true
8 , pytestCheckHook
9 , pytest-xdist
10 , sortedcontainers
11 , tzdata
13 buildPythonPackage rec {
14   # https://hypothesis.readthedocs.org/en/latest/packaging.html
16   # Hypothesis has optional dependencies on the following libraries
17   # pytz fake_factory django numpy pytest
18   # If you need these, you can just add them to your environment.
20   pname = "hypothesis";
21   version = "5.49.0";
23   # Use github tarballs that includes tests
24   src = fetchFromGitHub {
25     owner = "HypothesisWorks";
26     repo = "hypothesis-python";
27     rev = "hypothesis-python-${version}";
28     sha256 = "1lr9a93vdx70s9i1zazazif5hy8fbqhvwqq402ygpf53yw4lgi2w";
29   };
31   postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
33   propagatedBuildInputs = [
34     attrs
35     sortedcontainers
36   ];
38   checkInputs = [ pytestCheckHook pytest-xdist pexpect ]
39     ++ lib.optional (pythonAtLeast "3.9") tzdata;
41   inherit doCheck;
43   # This file changes how pytest runs and breaks it
44   preCheck = ''
45     rm tox.ini
46   '';
48   pytestFlagsArray = [ "tests/cover" ];
50   meta = with lib; {
51     description = "A Python library for property based testing";
52     homepage = "https://github.com/HypothesisWorks/hypothesis";
53     license = licenses.mpl20;
54     maintainers = with maintainers; [ SuperSandro2000 ];
55   };