nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, setuptools-scm
7, importlib-metadata
8, dbus-python
9, jeepney
10, secretstorage
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "keyring";
16 version = "23.0.1";
17 disabled = pythonOlder "3.6";
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "045703609dd3fccfcdb27da201684278823b72af515aedec1a8515719a038cb8";
22 };
23
24 nativeBuildInputs = [
25 setuptools-scm
26 ];
27
28 propagatedBuildInputs = [
29 # this should be optional, however, it has a different API
30 importlib-metadata # see https://github.com/jaraco/keyring/issues/503#issuecomment-798973205
31
32 dbus-python
33 jeepney
34 secretstorage
35 ];
36
37 pythonImportsCheck = [
38 "keyring"
39 "keyring.backend"
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 ];
45
46 # Keychain communications isn't possible in our build environment
47 # keyring.errors.KeyringError: Can't get password from keychain: (-25307, 'Unknown Error')
48 disabledTests = lib.optionals (stdenv.isDarwin) [
49 "test_multiprocess_get"
50 "test_multiprocess_get_after_native_get"
51 ];
52
53 disabledTestPaths = [
54 "tests/backends/test_macOS.py"
55 ];
56
57 meta = with lib; {
58 description = "Store and access your passwords safely";
59 homepage = "https://github.com/jaraco/keyring";
60 license = licenses.mit;
61 maintainers = with maintainers; [ lovek323 dotlambda ];
62 platforms = platforms.unix;
63 };
64}