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