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