From 6d2cb963287f8bca8c1f5b6feaa2669372fb9d7d Mon Sep 17 00:00:00 2001 From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> Date: Tue, 28 Nov 2023 08:39:32 +0000 Subject: [PATCH] python311Packages.gentools: switch to pyproject; fix build --- .../python-modules/gentools/default.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/gentools/default.nix b/pkgs/development/python-modules/gentools/default.nix index c53dd68fb815..ce247e60ec92 100644 --- a/pkgs/development/python-modules/gentools/default.nix +++ b/pkgs/development/python-modules/gentools/default.nix @@ -1,10 +1,17 @@ -{ buildPythonPackage, lib, fetchFromGitHub, pytest -, typing ? null, funcsigs ? null, pythonOlder +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytestCheckHook +, pythonOlder +, typing ? null +, funcsigs ? null }: buildPythonPackage rec { pname = "gentools"; version = "1.2.1"; + pyproject = true; # Pypi doesn't ship the tests, so we fetch directly from GitHub src = fetchFromGitHub { @@ -14,12 +21,15 @@ buildPythonPackage rec { sha256 = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8="; }; + nativeBuildInputs = [ poetry-core ]; + propagatedBuildInputs = lib.optionals (pythonOlder "3.5") [ typing ] ++ lib.optionals (pythonOlder "3.4") [ funcsigs ]; - nativeCheckInputs = [ pytest ]; - checkPhase = "pytest"; + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportCheck = [ "gentools" ]; meta = with lib; { description = "Tools for generators, generator functions, and generator-based coroutines"; @@ -27,5 +37,4 @@ buildPythonPackage rec { homepage = "https://gentools.readthedocs.io/"; maintainers = with maintainers; [ mredaelli ]; }; - }