1{ buildPythonPackage, lib, fetchFromGitHub, pytest 2, typing ? null, funcsigs ? null, pythonOlder 3}: 4 5buildPythonPackage rec { 6 pname = "gentools"; 7 version = "1.2.1"; 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 = "refs/tags/v${version}"; 14 sha256 = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8="; 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}