summary refs log blame commit diff
path: root/pkgs/tools/security/lesspass-cli/default.nix
blob: 76732170079cf9519903f28c89603e8938cda314 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11



                                                                    
                    





                            

                 

























                                                                                              
{ stdenv, python3, fetchFromGitHub }:

let
  inherit (python3.pkgs) buildPythonApplication pytest mock pexpect;
  repo = "lesspass";
in
buildPythonApplication rec {
  pname = "lesspass-cli";
  version = "9.0.0";

  src = fetchFromGitHub {
    owner = repo;
    repo = repo;
    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";
    homepage = https://lesspass.com;
    maintainers = with maintainers; [ jasoncarr ];
    license = licenses.gpl3;
  };
}