1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 msal,
6 portalocker,
7 setuptools,
8 stdenv,
9 pythonOlder,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "msal-extensions";
15 version = "1.3.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "AzureAD";
22 repo = "microsoft-authentication-extensions-for-python";
23 tag = version;
24 hash = "sha256-LRopszB8+8N9EajSmZvz0MTomp/qWZ5O3q00AHimZbY=";
25 };
26
27 build-system = [ setuptools ];
28
29 pythonRelaxDeps = [ "portalocker" ];
30
31 dependencies = [
32 msal
33 portalocker
34 ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 disabledTests = [
39 # `from gi.repository import Secret` fails to find libsecret
40 "test_token_cache_roundtrip_with_persistence_builder"
41 "test_libsecret_persistence"
42 "test_nonexistent_libsecret_persistence"
43 # network access
44 "test_token_cache_roundtrip_with_file_persistence"
45 ]
46 ++ lib.optionals stdenv.hostPlatform.isDarwin [
47 # msal_extensions.osx.KeychainError
48 "test_keychain_roundtrip"
49 "test_keychain_persistence"
50 ];
51
52 pythonImportsCheck = [ "msal_extensions" ];
53
54 meta = with lib; {
55 description = "Microsoft Authentication Library Extensions (MSAL-Extensions) for Python";
56 homepage = "https://github.com/AzureAD/microsoft-authentication-extensions-for-python";
57 changelog = "https://github.com/AzureAD/microsoft-authentication-extensions-for-python/releases/tag/${version}";
58 license = licenses.mit;
59 maintainers = with maintainers; [ kamadorueda ];
60 };
61}