summary refs log tree commit diff
path: root/pkgs/development/python-modules/google-auth/default.nix
blob: 203053d53cd7cf02ed326fa4f66b4f1c25f45c4c (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, cachetools
, flask
, freezegun
, mock
, oauth2client
, pyasn1-modules
, pyu2f
, pytest-localserver
, responses
, rsa
, pyopenssl
}:

buildPythonPackage rec {
  pname = "google-auth";
  version = "2.6.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-rRYPweqPGeMxoWoUp589ZD2BOmlTS6lhHSyA3BBDna0=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "cachetools>=2.0.0,<5.0" "cachetools"
  '';

  propagatedBuildInputs = [
    cachetools
    pyasn1-modules
    rsa
    pyopenssl
    pyu2f
  ];

  checkInputs = [
    flask
    freezegun
    mock
    oauth2client
    pytestCheckHook
    pytest-localserver
    responses
  ];

  pythonImportsCheck = [
    "google.auth"
    "google.oauth2"
  ];

  disabledTests = lib.optionals stdenv.isDarwin [
    "test_request_with_timeout_success"
    "test_request_with_timeout_failure"
    "test_request_headers"
    "test_request_error"
    "test_request_basic"
  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
    # E MemoryError: Cannot allocate write+execute memory for ffi.callback().
    # You might be running on a system that prevents this.
    # For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
    "test_configure_mtls_channel_with_callback"
    "test_configure_mtls_channel_with_metadata"
    "TestDecryptPrivateKey"
    "TestMakeMutualTlsHttp"
    "TestMutualTlsAdapter"
  ];

  meta = with lib; {
    description = "Google Auth Python Library";
    longDescription = ''
      This library simplifies using Google’s various server-to-server
      authentication mechanisms to access Google APIs.
    '';
    homepage = "https://github.com/googleapis/google-auth-library-python";
    changelog = "https://github.com/googleapis/google-auth-library-python/blob/v${version}/CHANGELOG.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}