depot/third_party/nixpkgs/pkgs/development/python-modules/pykeepass/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

58 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
argon2-cffi,
construct,
lxml,
pycryptodomex,
pyotp,
unittestCheckHook,
}:
buildPythonPackage rec {
pname = "pykeepass";
version = "4.0.7";
pyproject = true;
src = fetchFromGitHub {
owner = "libkeepass";
repo = "pykeepass";
rev = "v${version}";
hash = "sha256-qUNMjnIhQpUSQY0kN9bA4IxQx8fiFIA6p8rPqNqdjNo=";
};
postPatch = ''
# https://github.com/libkeepass/pykeepass/pull/378
substituteInPlace pyproject.toml \
--replace-fail 'packages = ["pykeepass"]' 'packages = ["pykeepass", "pykeepass.kdbx_parsing"]'
'';
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
argon2-cffi
construct
lxml
pycryptodomex
setuptools
];
propagatedNativeBuildInputs = [ argon2-cffi ];
nativeCheckInputs = [
pyotp
unittestCheckHook
];
pythonImportsCheck = [ "pykeepass" ];
meta = with lib; {
homepage = "https://github.com/libkeepass/pykeepass";
changelog = "https://github.com/libkeepass/pykeepass/blob/${src.rev}/CHANGELOG.rst";
description = "Python library to interact with keepass databases (supports KDBX3 and KDBX4)";
license = licenses.gpl3Only;
maintainers = with maintainers; [ dotlambda ];
};
}