summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/msal-extensions/default.nix
blob: 10bb61220bf3ab83b3921b900d4528fbec059bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  msal,
  portalocker,
  setuptools,
  stdenv,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "msal-extensions";
  version = "1.3.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "AzureAD";
    repo = "microsoft-authentication-extensions-for-python";
    tag = version;
    hash = "sha256-LRopszB8+8N9EajSmZvz0MTomp/qWZ5O3q00AHimZbY=";
  };

  build-system = [ setuptools ];

  pythonRelaxDeps = [ "portalocker" ];

  dependencies = [
    msal
    portalocker
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    # `from gi.repository import Secret` fails to find libsecret
    "test_token_cache_roundtrip_with_persistence_builder"
    "test_libsecret_persistence"
    "test_nonexistent_libsecret_persistence"
    # network access
    "test_token_cache_roundtrip_with_file_persistence"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    #  msal_extensions.osx.KeychainError
    "test_keychain_roundtrip"
    "test_keychain_persistence"
  ];

  pythonImportsCheck = [ "msal_extensions" ];

  meta = {
    description = "Microsoft Authentication Library Extensions (MSAL-Extensions) for Python";
    homepage = "https://github.com/AzureAD/microsoft-authentication-extensions-for-python";
    changelog = "https://github.com/AzureAD/microsoft-authentication-extensions-for-python/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ kamadorueda ];
  };
}