1{
2 lib,
3 stdenv,
4 aiohttp,
5 aioresponses,
6 buildPythonPackage,
7 cachetools,
8 cryptography,
9 fetchPypi,
10 flask,
11 freezegun,
12 grpcio,
13 mock,
14 pyasn1-modules,
15 pyjwt,
16 pyopenssl,
17 pytest-asyncio,
18 pytest-localserver,
19 pytestCheckHook,
20 pythonOlder,
21 pyu2f,
22 requests,
23 responses,
24 rsa,
25 setuptools,
26}:
27
28buildPythonPackage rec {
29 pname = "google-auth";
30 version = "2.38.0";
31 pyproject = true;
32
33 disabled = pythonOlder "3.7";
34
35 src = fetchPypi {
36 pname = "google_auth";
37 inherit version;
38 hash = "sha256-goURNgfTuAo/FUO3WWJEe6ign+hXg0MqeE/e72rAlMQ=";
39 };
40
41 build-system = [ setuptools ];
42
43 dependencies = [
44 cachetools
45 pyasn1-modules
46 rsa
47 ];
48
49 optional-dependencies = {
50 aiohttp = [
51 aiohttp
52 requests
53 ];
54 enterprise_cert = [
55 cryptography
56 pyopenssl
57 ];
58 pyopenssl = [
59 cryptography
60 pyopenssl
61 ];
62 pyjwt = [
63 cryptography
64 pyjwt
65 ];
66 reauth = [ pyu2f ];
67 requests = [ requests ];
68 };
69
70 nativeCheckInputs = [
71 aioresponses
72 flask
73 freezegun
74 grpcio
75 mock
76 pytest-asyncio
77 pytest-localserver
78 pytestCheckHook
79 responses
80 ] ++ lib.flatten (lib.attrValues optional-dependencies);
81
82 pythonImportsCheck = [
83 "google.auth"
84 "google.oauth2"
85 ];
86
87 pytestFlagsArray = [
88 # cryptography 44 compat issue
89 "--deselect=tests/transport/test__mtls_helper.py::TestDecryptPrivateKey::test_success"
90 ];
91
92 __darwinAllowLocalNetworking = true;
93
94 meta = with lib; {
95 description = "Google Auth Python Library";
96 longDescription = ''
97 This library simplifies using Google's various server-to-server
98 authentication mechanisms to access Google APIs.
99 '';
100 homepage = "https://github.com/googleapis/google-auth-library-python";
101 changelog = "https://github.com/googleapis/google-auth-library-python/blob/v${version}/CHANGELOG.md";
102 license = licenses.asl20;
103 maintainers = [ ];
104 };
105}