From 93201c2d232a6c5c61474b8a0bad978757e2972a Mon Sep 17 00:00:00 2001 From: Pyrox Date: Fri, 26 Jul 2024 13:20:38 -0400 Subject: [PATCH 1/2] python312Packages.pypass: Remove nose dependency --- .../python-modules/pypass/default.nix | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/pypass/default.nix b/pkgs/development/python-modules/pypass/default.nix index 3a2fc269ceda478..911861a65151829 100644 --- a/pkgs/development/python-modules/pypass/default.nix +++ b/pkgs/development/python-modules/pypass/default.nix @@ -8,11 +8,10 @@ git, gnugrep, gnupg, - nose, pbr, pexpect, pythonAtLeast, - pythonOlder, + pytestCheckHook, substituteAll, tree, xclip, @@ -55,26 +54,21 @@ buildPythonPackage rec { pexpect ]; - doCheck = pythonOlder "3.12"; - - nativeCheckInputs = [ nose ]; + nativeCheckInputs = [ pytestCheckHook ]; # Configuration so that the tests work preCheck = '' - HOME=$TEMP ${git}/bin/git config --global user.email "nix-builder@nixos.org" - HOME=$TEMP ${git}/bin/git config --global user.name "Nix Builder" - HOME=$TEMP ${git}/bin/git config --global pull.ff only - HOME=$TEMP make setup_gpg + export HOME=$(mktemp -d) + export GNUPGHOME=pypass/tests/gnupg + ${git}/bin/git config --global user.email "nix-builder@nixos.org" + ${git}/bin/git config --global user.name "Nix Builder" + ${git}/bin/git config --global pull.ff only + make setup_gpg ''; - # Run tests but exclude the test that uses clipboard as I wasn't able to make - # it work - probably the X clipboard just doesn't work in the build - # environment.. - checkPhase = '' - runHook preCheck - HOME=$TEMP GNUPGHOME=pypass/tests/gnupg nosetests -v --exclude=test_show_clip . - runHook postCheck - ''; + # Presumably this test needs the X clipboard, which we don't have + # as the test environment is non-graphical. + disabledTests = [ "test_show_clip" ]; meta = with lib; { broken = stdenv.isDarwin; From 38ba83534f09ad3bc44d85c18ae1447302e5fc7d Mon Sep 17 00:00:00 2001 From: Pyrox Date: Fri, 26 Jul 2024 13:20:55 -0400 Subject: [PATCH 2/2] python312Packages.pypass: Modernize --- .../python-modules/pypass/default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pypass/default.nix b/pkgs/development/python-modules/pypass/default.nix index 911861a65151829..784a5e213c3baca 100644 --- a/pkgs/development/python-modules/pypass/default.nix +++ b/pkgs/development/python-modules/pypass/default.nix @@ -12,6 +12,7 @@ pexpect, pythonAtLeast, pytestCheckHook, + setuptools, substituteAll, tree, xclip, @@ -22,11 +23,11 @@ buildPythonPackage rec { pname = "pypass"; version = "0.2.1"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "1nm4mj7pd7gz4ghic6b3wrnd1b59hd1f0axavdabfl79wy511l7r"; + hash = "sha256-+dAQiufpULdU26or4EKDqazQbOZjGRbhI/+ddo+spNo="; }; # Set absolute nix store paths to the executables that pypass uses @@ -46,9 +47,11 @@ buildPythonPackage rec { substituteInPlace requirements.txt --replace "enum34" "" ''; + build-system = [ setuptools ]; + nativeBuildInputs = [ pbr ]; - propagatedBuildInputs = [ + dependencies = [ click colorama pexpect @@ -70,13 +73,13 @@ buildPythonPackage rec { # as the test environment is non-graphical. disabledTests = [ "test_show_clip" ]; - meta = with lib; { + meta = { broken = stdenv.isDarwin; description = "Password manager pass in Python"; mainProgram = "pypass"; homepage = "https://github.com/aviau/python-pass"; - license = licenses.gpl3Plus; - platforms = platforms.all; - maintainers = with maintainers; [ jluttine ]; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ jluttine ]; }; }