From 6d489a3eb4556735fab0fa4ce84be86e2594ef83 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 25 Jan 2021 15:45:52 +0800 Subject: [PATCH] xkcdpass: py2 -> py3, add manpage and run tests --- .../python-modules/xkcdpass/default.nix | 19 ++++++++++++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/xkcdpass/default.nix b/pkgs/development/python-modules/xkcdpass/default.nix index 280ce5a790a..e372a843cf8 100644 --- a/pkgs/development/python-modules/xkcdpass/default.nix +++ b/pkgs/development/python-modules/xkcdpass/default.nix @@ -1,6 +1,8 @@ { lib , buildPythonPackage , fetchPypi +, pytestCheckHook +, installShellFiles }: buildPythonPackage rec { @@ -12,14 +14,21 @@ buildPythonPackage rec { sha256 = "0ghsjs5bxl996pap910q9s21nywb26mfpjd92rbfywbnj8f2k2cy"; }; - # No tests included - # https://github.com/redacted/XKCD-password-generator/issues/32 - doCheck = false; + nativeBuildInputs = [ installShellFiles ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "xkcdpass" ]; + + postInstall = '' + installManPage *.? + install -Dm444 -t $out/share/doc/${pname} README* + ''; meta = with lib; { - homepage = "https://pypi.python.org/pypi/xkcdpass/"; description = "Generate secure multiword passwords/passphrases, inspired by XKCD"; + homepage = "https://pypi.python.org/pypi/xkcdpass/"; license = licenses.bsd3; + maintainers = with maintainers; [ peterhoeg ]; }; - } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4fd88228462..7cfc754d311 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3805,7 +3805,7 @@ in wsl-open = callPackage ../tools/misc/wsl-open { }; - xkcdpass = with pythonPackages; toPythonApplication xkcdpass; + xkcdpass = with python3Packages; toPythonApplication xkcdpass; xob = callPackage ../tools/X11/xob { };