diff --git a/pkgs/development/python-modules/gentools/default.nix b/pkgs/development/python-modules/gentools/default.nix index c53dd68fb815a..6d2ae215eafac 100644 --- a/pkgs/development/python-modules/gentools/default.nix +++ b/pkgs/development/python-modules/gentools/default.nix @@ -1,31 +1,47 @@ -{ buildPythonPackage, lib, fetchFromGitHub, pytest -, typing ? null, funcsigs ? null, pythonOlder +{ lib +, buildPythonPackage +, fetchFromGitHub +, importlib-metadata +, poetry-core +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "gentools"; version = "1.2.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; - # Pypi doesn't ship the tests, so we fetch directly from GitHub src = fetchFromGitHub { owner = "ariebovenberg"; - repo = pname; + repo = "gentools"; rev = "refs/tags/v${version}"; - sha256 = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8="; + hash = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8="; }; - propagatedBuildInputs = - lib.optionals (pythonOlder "3.5") [ typing ] ++ - lib.optionals (pythonOlder "3.4") [ funcsigs ]; + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ + importlib-metadata + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; - nativeCheckInputs = [ pytest ]; - checkPhase = "pytest"; + pythonImportCheck = [ + "gentools" + ]; meta = with lib; { description = "Tools for generators, generator functions, and generator-based coroutines"; - license = licenses.mit; homepage = "https://gentools.readthedocs.io/"; + changelog = "https://github.com/ariebovenberg/gentools/blob/v${version}/CHANGELOG.rst"; + license = licenses.mit; maintainers = with maintainers; [ mredaelli ]; }; - }