2021-02-05 17:12:51 +00:00
|
|
|
{ lib, python3, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python3.pkgs) buildPythonApplication pytest mock pexpect;
|
|
|
|
repo = "lesspass";
|
|
|
|
in
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "lesspass-cli";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "9.1.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = repo;
|
|
|
|
repo = repo;
|
|
|
|
rev = version;
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "126zk248s9r72qk9b8j27yvb8gglw49kazwz0sd69b5kkxvhz2dh";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
sourceRoot = "source/cli";
|
|
|
|
|
|
|
|
# some tests are designed to run against code in the source directory - adapt to run against
|
|
|
|
# *installed* code
|
|
|
|
postPatch = ''
|
|
|
|
for f in tests/test_functional.py tests/test_interaction.py ; do
|
|
|
|
substituteInPlace $f --replace "lesspass/core.py" "-m lesspass.core"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytest mock pexpect ];
|
|
|
|
checkPhase = ''
|
|
|
|
mv lesspass lesspass.hidden # ensure we're testing against *installed* package
|
|
|
|
pytest tests
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Stateless password manager";
|
|
|
|
homepage = "https://lesspass.com";
|
|
|
|
maintainers = with maintainers; [ jasoncarr ];
|
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|