From 93edfffab6b9c0b279dce1891bb31c3d3970e06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 30 Apr 2021 16:53:36 +0200 Subject: [PATCH 1/2] pythonPackages.pykeepass: run tests --- .../python-modules/pykeepass/default.nix | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pykeepass/default.nix b/pkgs/development/python-modules/pykeepass/default.nix index 294e47872fc..6e73501bfb0 100644 --- a/pkgs/development/python-modules/pykeepass/default.nix +++ b/pkgs/development/python-modules/pykeepass/default.nix @@ -1,15 +1,18 @@ -{ lib, fetchPypi, buildPythonPackage +{ lib, fetchFromGitHub, buildPythonPackage , lxml, pycryptodomex, construct , argon2_cffi, dateutil, future +, python }: buildPythonPackage rec { pname = "pykeepass"; version = "4.0.0"; - src = fetchPypi { - inherit pname version; - sha256 = "1b41b3277ea4e044556e1c5a21866ea4dfd36e69a4c0f14272488f098063178f"; + src = fetchFromGitHub { + owner = "libkeepass"; + repo = "pykeepass"; + rev = version; + sha256 = "1zw5hjk90zfxpgq2fz4h5qzw3kmvdnlfbd32gw57l034hmz2i08v"; }; postPatch = '' @@ -21,13 +24,15 @@ buildPythonPackage rec { argon2_cffi dateutil future ]; - # no tests in PyPI tarball - doCheck = false; + checkPhase = '' + ${python.interpreter} -m unittest tests.tests + ''; - meta = { - homepage = "https://github.com/pschmitt/pykeepass"; + meta = with lib; { + homepage = "https://github.com/libkeepass/pykeepass"; + changelog = "https://github.com/libkeepass/pykeepass/blob/${version}/CHANGELOG.rst"; description = "Python library to interact with keepass databases (supports KDBX3 and KDBX4)"; - license = lib.licenses.gpl3; + license = licenses.gpl3Only; + maintainers = with maintainers; [ dotlambda ]; }; - } From 93507828b235e3c1775c80653b1cbe22cc55efa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 30 Apr 2021 17:16:28 +0200 Subject: [PATCH 2/2] passExtensions.pass-import: fix tests --- pkgs/tools/security/pass/extensions/import.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/pass/extensions/import.nix b/pkgs/tools/security/pass/extensions/import.nix index be2492112c3..655bee41ba6 100644 --- a/pkgs/tools/security/pass/extensions/import.nix +++ b/pkgs/tools/security/pass/extensions/import.nix @@ -17,9 +17,14 @@ python3Packages.buildPythonApplication rec { sha256 = "sha256-nH2xAqWfMT+Brv3z9Aw6nbvYqArEZjpM28rKsRPihqA="; }; - # by default, tries to install scripts/pimport, which is a bash wrapper around "python -m pass_import ..." - # This is a better way to do the same, and takes advantage of the existing Nix python environments patches = [ + (fetchpatch { + name = "support-for-keepass-4.0.0.patch"; + url = "https://github.com/roddhjav/pass-import/commit/86cfb1bb13a271fefe1e70f24be18e15a83a04d8.patch"; + sha256 = "0mrlblqlmwl9gqs2id4rl4sivrcclsv6zyc6vjqi78kkqmnwzhxh"; + }) + # by default, tries to install scripts/pimport, which is a bash wrapper around "python -m pass_import ..." + # This is a better way to do the same, and takes advantage of the existing Nix python environments # from https://github.com/roddhjav/pass-import/pull/138 (fetchpatch { name = "pass-import-pr-138-pimport-entrypoint.patch";