1{ lib, buildPythonPackage, fetchFromGitHub
2, isPy3k, attrs, coverage, enum34
3, doCheck ? true, pytest, pytest_xdist, 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.66.2";
13 pname = "hypothesis";
14
15 # Use github tarballs that includes tests
16 src = fetchFromGitHub {
17 owner = "HypothesisWorks";
18 repo = "hypothesis-python";
19 rev = "hypothesis-python-${version}";
20 sha256 = "17ywbwa76z7f0pgash0003fvm25fsj7hxdrdiprdbv99y3i8bm88";
21 };
22
23 postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
24
25 propagatedBuildInputs = [ attrs coverage ] ++ lib.optional (!isPy3k) [ enum34 ];
26
27 checkInputs = [ pytest pytest_xdist flaky mock ];
28 inherit doCheck;
29
30 checkPhase = ''
31 rm tox.ini # This file changes how py.test runs and breaks it
32 py.test tests/cover
33 '';
34
35 meta = with lib; {
36 description = "A Python library for property based testing";
37 homepage = https://github.com/HypothesisWorks/hypothesis;
38 license = licenses.mpl20;
39 };
40}