From c3928d527cc4927e24430a495a803666e74055a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Dec 2021 22:46:45 +0000 Subject: [PATCH 1/3] python39Packages.argh: fix tests --- .../python-modules/argh/default.nix | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/argh/default.nix b/pkgs/development/python-modules/argh/default.nix index bbe120ec14fe..fd9ff184000f 100644 --- a/pkgs/development/python-modules/argh/default.nix +++ b/pkgs/development/python-modules/argh/default.nix @@ -1,11 +1,10 @@ { lib , buildPythonPackage , fetchPypi -, pytest -, py -, mock -, glibcLocales +, fetchpatch , iocapture +, mock +, pytestCheckHook }: buildPythonPackage rec { @@ -17,18 +16,27 @@ buildPythonPackage rec { sha256 = "e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65"; }; - checkInputs = [ pytest py mock glibcLocales iocapture ]; + patches = [ + # https://github.com/neithere/argh/issues/148 + (fetchpatch { + name = "argh-0.26.2-fix-py3.9-msgs.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch?id=6f194f12a2e30aad7da347848f7b0187e188f983"; + sha256 = "nBmhF2PXVeS7cBNujzip6Bb601LRHrjmhlGKFr/++Oo="; + }) + ]; - checkPhase = '' - export LANG="en_US.UTF-8" - py.test - ''; + checkInputs = [ + iocapture + mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "argh" ]; meta = with lib; { - homepage = "https://github.com/neithere/argh/"; + homepage = "https://github.com/neithere/argh"; description = "An unobtrusive argparse wrapper with natural syntax"; - license = licenses.lgpl2; + license = licenses.lgpl3Plus; maintainers = with maintainers; [ domenkozar ]; }; - } From 957f1f72439dc987afb4c76358a93aaa1094fd04 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 28 Dec 2021 01:56:45 +0100 Subject: [PATCH 2/3] barman: drop argh dependency It is not required anymore and breaks the package with argh being broken. --- pkgs/tools/misc/barman/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/misc/barman/default.nix b/pkgs/tools/misc/barman/default.nix index c9a561c8729f..699a38f3a879 100644 --- a/pkgs/tools/misc/barman/default.nix +++ b/pkgs/tools/misc/barman/default.nix @@ -20,7 +20,6 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = with python3Packages; [ argcomplete - argh azure-identity azure-storage-blob boto3 From d7d609790a94b3b5f7a2c6107b151264f6d83b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 28 Dec 2021 09:35:57 +0000 Subject: [PATCH 3/3] yrd: use python3 --- pkgs/tools/networking/yrd/default.nix | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/networking/yrd/default.nix b/pkgs/tools/networking/yrd/default.nix index 75a89b859fe8..1aace6aefbb5 100644 --- a/pkgs/tools/networking/yrd/default.nix +++ b/pkgs/tools/networking/yrd/default.nix @@ -1,27 +1,37 @@ -{ lib, fetchFromGitHub, pythonPackages }: +{ lib +, python3 +, fetchFromGitHub +}: -let +python3.pkgs.buildPythonApplication rec { pname = "yrd"; version = "0.5.3"; - sha256 = "1yx1hr8z4cvlb3yi24dwafs0nxq41k4q477jc9q24w61a0g662ps"; - -in pythonPackages.buildPythonApplication { - name = "${pname}-${version}"; src = fetchFromGitHub { owner = "kpcyrd"; repo = pname; rev = "v${version}"; - inherit sha256; + sha256 = "1yx1hr8z4cvlb3yi24dwafs0nxq41k4q477jc9q24w61a0g662ps"; }; - propagatedBuildInputs = with pythonPackages; [ argh ]; + propagatedBuildInputs = with python3.pkgs; [ + argh + requests + ]; + + checkInputs = with python3.pkgs; [ + nose + ]; + + checkPhase = '' + nosetests -v yrd + ''; meta = with lib; { description = "Cjdns swiss army knife"; maintainers = with maintainers; [ akru ]; platforms = platforms.linux; - license = licenses.gpl3; + license = licenses.gpl3Only; homepage = "https://github.com/kpcyrd/yrd"; }; }