1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 attrs, 6 coverage, 7 pexpect, 8 doCheck ? true, 9 pytest, 10 pytest-xdist, 11 flaky, 12 mock, 13 sortedcontainers, 14}: 15buildPythonPackage rec { 16 # https://hypothesis.readthedocs.org/en/latest/packaging.html 17 18 # Hypothesis has optional dependencies on the following libraries 19 # pytz fake_factory django numpy pytest 20 # If you need these, you can just add them to your environment. 21 22 version = "4.57.1"; 23 format = "setuptools"; 24 pname = "hypothesis"; 25 26 # Use github tarballs that includes tests 27 src = fetchFromGitHub { 28 owner = "HypothesisWorks"; 29 repo = "hypothesis-python"; 30 rev = "hypothesis-python-${version}"; 31 sha256 = "1qcpcrk6892hzyjsdr581pw6i4fj9035nv89mcjrcrzcmycdlfds"; 32 }; 33 34 postUnpack = "sourceRoot=$sourceRoot/hypothesis-python"; 35 36 propagatedBuildInputs = [ 37 attrs 38 coverage 39 sortedcontainers 40 ]; 41 42 nativeCheckInputs = [ 43 pytest 44 pytest-xdist 45 flaky 46 mock 47 pexpect 48 ]; 49 inherit doCheck; 50 51 checkPhase = '' 52 rm tox.ini # This file changes how py.test runs and breaks it 53 py.test tests/cover 54 ''; 55 56 meta = with lib; { 57 description = "Python library for property based testing"; 58 homepage = "https://github.com/HypothesisWorks/hypothesis"; 59 license = licenses.mpl20; 60 }; 61}