2021-04-26 19:14:03 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
2024-01-02 11:29:13 +00:00
|
|
|
, installShellFiles
|
2021-04-26 19:14:03 +00:00
|
|
|
, setuptools-scm
|
2024-01-02 11:29:13 +00:00
|
|
|
, shtab
|
2020-04-24 23:36:52 +00:00
|
|
|
, importlib-metadata
|
2021-04-26 19:14:03 +00:00
|
|
|
, dbus-python
|
2023-08-04 22:07:22 +00:00
|
|
|
, jaraco-classes
|
2021-04-26 19:14:03 +00:00
|
|
|
, jeepney
|
2020-04-24 23:36:52 +00:00
|
|
|
, secretstorage
|
2021-04-26 19:14:03 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "keyring";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "24.3.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2023-08-10 07:59:29 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-wzJ7b/r8DovvvbWXys20ko/+XBIS92RfGG5tmVeomNs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
nativeBuildInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
installShellFiles
|
2021-04-26 19:14:03 +00:00
|
|
|
setuptools-scm
|
2024-01-02 11:29:13 +00:00
|
|
|
shtab
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
jaraco-classes
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2021-04-26 19:14:03 +00:00
|
|
|
jeepney
|
|
|
|
secretstorage
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.12") [
|
2022-09-30 11:47:45 +00:00
|
|
|
importlib-metadata
|
2020-06-15 15:56:04 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd keyring \
|
|
|
|
--bash <($out/bin/keyring --print-completion bash) \
|
|
|
|
--zsh <($out/bin/keyring --print-completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"keyring"
|
|
|
|
"keyring.backend"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-26 19:14:03 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/backends/test_macOS.py"
|
2023-07-15 17:15:38 +00:00
|
|
|
]
|
|
|
|
# These tests fail when sandboxing is enabled because they are unable to get a password from keychain.
|
|
|
|
++ lib.optional stdenv.isDarwin "tests/test_multiprocess.py";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Store and access your passwords safely";
|
2021-04-26 19:14:03 +00:00
|
|
|
homepage = "https://github.com/jaraco/keyring";
|
2023-08-10 07:59:29 +00:00
|
|
|
changelog = "https://github.com/jaraco/keyring/blob/v${version}/NEWS.rst";
|
2021-04-26 19:14:03 +00:00
|
|
|
license = licenses.mit;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "keyring";
|
2021-04-26 19:14:03 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|