about summary refs log tree commit diff
path: root/pkgs/development/python2-modules/hypothesis
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2022-01-16 07:34:26 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2022-01-16 10:00:16 +0100
commitae18d68b6b117528e6cd72325ead36b48562d43f (patch)
tree9f9d765a7208d5d436184dc3656b164fd0581f7f /pkgs/development/python2-modules/hypothesis
parent2027fb600d891379c53c4762463e65d040359682 (diff)
downloadnixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar.gz
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar.bz2
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar.lz
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar.xz
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.tar.zst
nixlib-ae18d68b6b117528e6cd72325ead36b48562d43f.zip
python2.pkgs: move expressions into python2-modules/ folder
Another step in further separating python2 from python3.
Diffstat (limited to 'pkgs/development/python2-modules/hypothesis')
-rw-r--r--pkgs/development/python2-modules/hypothesis/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python2-modules/hypothesis/default.nix b/pkgs/development/python2-modules/hypothesis/default.nix
new file mode 100644
index 000000000000..47bc8860bc54
--- /dev/null
+++ b/pkgs/development/python2-modules/hypothesis/default.nix
@@ -0,0 +1,45 @@
+{ lib, buildPythonPackage, fetchFromGitHub
+, isPy3k, attrs, coverage, enum34, pexpect
+, doCheck ? true, pytest, pytest-xdist, flaky, mock
+, sortedcontainers
+}:
+buildPythonPackage rec {
+  # https://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 = "4.57.1";
+  pname = "hypothesis";
+
+  # Use github tarballs that includes tests
+  src = fetchFromGitHub {
+    owner = "HypothesisWorks";
+    repo = "hypothesis-python";
+    rev = "hypothesis-python-${version}";
+    sha256 = "1qcpcrk6892hzyjsdr581pw6i4fj9035nv89mcjrcrzcmycdlfds";
+  };
+
+  postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
+
+  propagatedBuildInputs = [
+    attrs
+    coverage
+    sortedcontainers
+  ] ++ lib.optional (!isPy3k) enum34;
+
+  checkInputs = [ pytest pytest-xdist flaky mock pexpect ];
+  inherit doCheck;
+
+  checkPhase = ''
+    rm tox.ini # This file changes how py.test runs and breaks it
+    py.test tests/cover
+  '';
+
+  meta = with lib; {
+    description = "A Python library for property based testing";
+    homepage = "https://github.com/HypothesisWorks/hypothesis";
+    license = licenses.mpl20;
+  };
+}