1{ buildPythonPackage, lib, fetchFromGitHub, pytest
2, typing ? null, funcsigs ? null, pythonOlder
3}:
4
5buildPythonPackage rec {
6 pname = "gentools";
7 version = "1.1.0";
8
9 # Pypi doesn't ship the tests, so we fetch directly from GitHub
10 src = fetchFromGitHub {
11 owner = "ariebovenberg";
12 repo = pname;
13 rev = "v${version}";
14 sha256 = "1sm6cqi7fv2k3pc68r7wvvjjz8y6cjmz8bvxgqfa4v4wxibwnwrl";
15 };
16
17 propagatedBuildInputs =
18 lib.optionals (pythonOlder "3.5") [ typing ] ++
19 lib.optionals (pythonOlder "3.4") [ funcsigs ];
20
21 nativeCheckInputs = [ pytest ];
22 checkPhase = "pytest";
23
24 meta = with lib; {
25 description = "Tools for generators, generator functions, and generator-based coroutines";
26 license = licenses.mit;
27 homepage = "https://gentools.readthedocs.io/";
28 maintainers = with maintainers; [ mredaelli ];
29 };
30
31}