2019-06-25 00:59:55 +01:00
|
|
|
{ stdenv, python3, fetchFromGitHub }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python3.pkgs) buildPythonApplication pytest mock pexpect;
|
2019-09-12 04:12:39 +01:00
|
|
|
repo = "lesspass";
|
2019-06-25 00:59:55 +01:00
|
|
|
in
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "lesspass-cli";
|
|
|
|
version = "9.0.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-09-12 04:12:39 +01:00
|
|
|
owner = repo;
|
|
|
|
repo = repo;
|
2019-06-25 00:59:55 +01:00
|
|
|
rev = version;
|
|
|
|
sha256 = "1mdv0c0fn4d72iigy8hz4s7kf7q3pg4gjjadxwxyjwsalapnsapk";
|
|
|
|
};
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Stateless password manager";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://lesspass.com";
|
2019-06-25 00:59:55 +01:00
|
|
|
maintainers = with maintainers; [ jasoncarr ];
|
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|