about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/gentools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/gentools/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/gentools/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/gentools/default.nix b/nixpkgs/pkgs/development/python-modules/gentools/default.nix
new file mode 100644
index 000000000000..129eaae340a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/gentools/default.nix
@@ -0,0 +1,31 @@
+{ buildPythonPackage, lib, fetchFromGitHub, pytest
+, typing, funcsigs, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "gentools";
+  version = "1.1.0";
+
+  # Pypi doesn't ship the tests, so we fetch directly from GitHub
+  src = fetchFromGitHub {
+    owner = "ariebovenberg";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1sm6cqi7fv2k3pc68r7wvvjjz8y6cjmz8bvxgqfa4v4wxibwnwrl";
+  };
+
+  propagatedBuildInputs =
+    lib.optionals (pythonOlder "3.5") [ typing ] ++
+    lib.optionals (pythonOlder "3.4") [ funcsigs ];
+
+  checkInputs = [ pytest ];
+  checkPhase = "pytest";
+
+  meta = with lib; {
+    description = "Tools for generators, generator functions, and generator-based coroutines";
+    license = licenses.mit;
+    homepage = "https://gentools.readthedocs.io/";
+    maintainers = with maintainers; [ mredaelli ];
+  };
+
+}