1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 setuptools,
7 click,
8 mock,
9 pytestCheckHook,
10 google-auth,
11 requests-oauthlib,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "google-auth-oauthlib";
17 version = "1.2.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchPypi {
23 pname = "google_auth_oauthlib";
24 inherit version;
25 hash = "sha256-r9DK0JKi6qU82OgphVfW3hA0xstKdAUAtTV7ZIr5cmM=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 google-auth
32 requests-oauthlib
33 ];
34
35 optional-dependencies = {
36 tool = [ click ];
37 };
38
39 nativeCheckInputs = [
40 mock
41 pytestCheckHook
42 ] ++ optional-dependencies.tool;
43
44 disabledTests =
45 [
46 # Flaky test. See https://github.com/NixOS/nixpkgs/issues/288424#issuecomment-1941609973.
47 "test_run_local_server_occupied_port"
48 ]
49 ++ lib.optionals stdenv.hostPlatform.isDarwin [
50 # This test fails if the hostname is not associated with an IP (e.g., in `/etc/hosts`).
51 "test_run_local_server_bind_addr"
52 ];
53
54 pythonImportsCheck = [ "google_auth_oauthlib" ];
55
56 meta = with lib; {
57 description = "Google Authentication Library: oauthlib integration";
58 homepage = "https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib";
59 changelog = "https://github.com/googleapis/google-auth-library-python-oauthlib/blob/v${version}/CHANGELOG.md";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ terlar ];
62 mainProgram = "google-oauthlib-tool";
63 };
64}