1{ lib, fetchFromGitHub, buildPythonPackage
2, lxml, pycryptodomex, construct
3, argon2-cffi, python-dateutil, future
4, python
5}:
6
7buildPythonPackage rec {
8 pname = "pykeepass";
9 version = "4.0.3";
10
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "libkeepass";
15 repo = "pykeepass";
16 rev = "v${version}";
17 hash = "sha256-HyveBBsd1OFWoY3PgqqaKRLBhsxgFv8PRAxEF6r+bf4=";
18 };
19
20 postPatch = ''
21 substituteInPlace setup.py --replace "==" ">="
22 '';
23
24 propagatedBuildInputs = [
25 lxml pycryptodomex construct
26 argon2-cffi python-dateutil future
27 ];
28
29 propagatedNativeBuildInputs = [ argon2-cffi ];
30
31 checkPhase = ''
32 ${python.interpreter} -m unittest tests.tests
33 '';
34
35 pythonImportsCheck = [ "pykeepass" ];
36
37 meta = with lib; {
38 homepage = "https://github.com/libkeepass/pykeepass";
39 changelog = "https://github.com/libkeepass/pykeepass/blob/${src.rev}/CHANGELOG.rst";
40 description = "Python library to interact with keepass databases (supports KDBX3 and KDBX4)";
41 license = licenses.gpl3Only;
42 maintainers = with maintainers; [ dotlambda ];
43 };
44}