diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2017-11-05 10:45:54 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2017-11-05 10:45:54 +0100 |
commit | 07eeeb36008b63c8edfc75fce79beb028cd5c1e4 (patch) | |
tree | 815bfac4b5ee67fc223ea785e965c2680bac4db0 /pkgs/development/python-modules/hypothesis | |
parent | 37d5539aeb10973aba9c84f5214625c85e9c39b4 (diff) |
Python: move expressions in python-modules to their own folders
Diffstat (limited to 'pkgs/development/python-modules/hypothesis')
-rw-r--r-- | pkgs/development/python-modules/hypothesis/default.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix new file mode 100644 index 0000000000000..ab56cde9c131d --- /dev/null +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -0,0 +1,44 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, python +, pythonOlder, pythonAtLeast, enum34 +, doCheck ? true, pytest, pytest_xdist, flake8, flaky +}: +buildPythonPackage rec { + # http://hypothesis.readthedocs.org/en/latest/packaging.html + + # Hypothesis has optional dependencies on the following libraries + # pytz fake_factory django numpy pytest + # If you need these, you can just add them to your environment. + + version = "3.11.1"; + pname = "hypothesis"; + name = "${pname}-${version}"; + + # Upstream prefers github tarballs + src = fetchFromGitHub { + owner = "HypothesisWorks"; + repo = "hypothesis-python"; + rev = "${version}"; + sha256 = "0damf6zbm0db2a3gfwrbbj92yal576wpmhhchc0w0np8vdnax70n"; + }; + + checkInputs = stdenv.lib.optionals doCheck [ pytest pytest_xdist flake8 flaky ]; + propagatedBuildInputs = stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ]; + + inherit doCheck; + + # https://github.com/DRMacIver/hypothesis/issues/300 + checkPhase = '' + rm tox.ini # This file changes how py.test runs and breaks it + py.test tests/cover + ''; + + # Unsupport by upstream on certain versions + # https://github.com/HypothesisWorks/hypothesis-python/issues/477 + disabled = pythonOlder "3.4" && pythonAtLeast "2.8"; + + meta = with stdenv.lib; { + description = "A Python library for property based testing"; + homepage = https://github.com/DRMacIver/hypothesis; + license = licenses.mpl20; + }; +} |