2021-01-25 08:26:54 +00:00
|
|
|
{ lib, python3, fetchFromGitHub }:
|
2019-06-24 23:59:55 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python3.pkgs) buildPythonApplication pytest mock pexpect;
|
2019-09-12 03:12:39 +00:00
|
|
|
repo = "lesspass";
|
2019-06-24 23:59:55 +00:00
|
|
|
in
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "lesspass-cli";
|
2020-09-09 07:18:14 +00:00
|
|
|
version = "9.1.9";
|
2019-06-24 23:59:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-09-12 03:12:39 +00:00
|
|
|
owner = repo;
|
|
|
|
repo = repo;
|
2019-06-24 23:59:55 +00:00
|
|
|
rev = version;
|
2020-09-09 07:18:14 +00:00
|
|
|
sha256 = "126zk248s9r72qk9b8j27yvb8gglw49kazwz0sd69b5kkxvhz2dh";
|
2019-06-24 23:59:55 +00:00
|
|
|
};
|
2023-07-25 13:27:31 +00:00
|
|
|
sourceRoot = "${src.name}/cli";
|
2019-06-24 23:59:55 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ pytest mock pexpect ];
|
2019-06-24 23:59:55 +00:00
|
|
|
checkPhase = ''
|
|
|
|
mv lesspass lesspass.hidden # ensure we're testing against *installed* package
|
|
|
|
pytest tests
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-06-24 23:59:55 +00:00
|
|
|
description = "Stateless password manager";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "lesspass";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://lesspass.com";
|
2019-06-24 23:59:55 +00:00
|
|
|
maintainers = with maintainers; [ jasoncarr ];
|
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|