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 1/3] 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 c53dd68fb815a..ce247e60ec921 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 ]; }; - } From 2a5388a54e6dad4828647c53c180d69df7683605 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 28 Nov 2023 10:04:15 +0100 Subject: [PATCH 2/3] python311Packages.gentools: add changelog to meta --- pkgs/development/python-modules/gentools/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/gentools/default.nix b/pkgs/development/python-modules/gentools/default.nix index ce247e60ec921..8fbf4a788fe9f 100644 --- a/pkgs/development/python-modules/gentools/default.nix +++ b/pkgs/development/python-modules/gentools/default.nix @@ -13,12 +13,11 @@ buildPythonPackage rec { version = "1.2.1"; pyproject = true; - # 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="; }; nativeBuildInputs = [ poetry-core ]; @@ -33,8 +32,9 @@ buildPythonPackage rec { 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 ]; }; } From f3c44905d8f10582ca81dfff509705e3c961c796 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 28 Nov 2023 10:07:27 +0100 Subject: [PATCH 3/3] python311Packages.gentools: adjust inputs - disable on unsupported Python releases --- .../python-modules/gentools/default.nix | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/gentools/default.nix b/pkgs/development/python-modules/gentools/default.nix index 8fbf4a788fe9f..6d2ae215eafac 100644 --- a/pkgs/development/python-modules/gentools/default.nix +++ b/pkgs/development/python-modules/gentools/default.nix @@ -1,11 +1,10 @@ { lib , buildPythonPackage , fetchFromGitHub +, importlib-metadata , poetry-core , pytestCheckHook , pythonOlder -, typing ? null -, funcsigs ? null }: buildPythonPackage rec { @@ -13,6 +12,8 @@ buildPythonPackage rec { version = "1.2.1"; pyproject = true; + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "ariebovenberg"; repo = "gentools"; @@ -20,15 +21,21 @@ buildPythonPackage rec { hash = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8="; }; - nativeBuildInputs = [ poetry-core ]; + nativeBuildInputs = [ + poetry-core + ]; - propagatedBuildInputs = - lib.optionals (pythonOlder "3.5") [ typing ] ++ - lib.optionals (pythonOlder "3.4") [ funcsigs ]; + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ + importlib-metadata + ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + ]; - pythonImportCheck = [ "gentools" ]; + pythonImportCheck = [ + "gentools" + ]; meta = with lib; { description = "Tools for generators, generator functions, and generator-based coroutines";