summary refs log tree commit diff
path: root/pkgs/development/python-modules/hypothesis
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2017-11-05 10:45:54 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2017-11-05 10:45:54 +0100
commit07eeeb36008b63c8edfc75fce79beb028cd5c1e4 (patch)
tree815bfac4b5ee67fc223ea785e965c2680bac4db0 /pkgs/development/python-modules/hypothesis
parent37d5539aeb10973aba9c84f5214625c85e9c39b4 (diff)
downloadnixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.gz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.bz2
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.lz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.xz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.zst
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.zip
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.nix44
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 000000000000..ab56cde9c131
--- /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;
+  };
+}