about summary refs log tree commit diff
path: root/pkgs/development/python-modules/google-auth-oauthlib/default.nix
blob: 3f1b3a06d0d4a9581299a25a4703f3e293f90b49 (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
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  click,
  mock,
  pytestCheckHook,
  google-auth,
  requests-oauthlib,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "google-auth-oauthlib";
  version = "1.2.1";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    pname = "google_auth_oauthlib";
    inherit version;
    hash = "sha256-r9DK0JKi6qU82OgphVfW3hA0xstKdAUAtTV7ZIr5cmM=";
  };

  build-system = [ setuptools ];

  dependencies = [
    google-auth
    requests-oauthlib
  ];

  optional-dependencies = {
    tool = [ click ];
  };

  nativeCheckInputs = [
    mock
    pytestCheckHook
  ] ++ optional-dependencies.tool;

  disabledTests =
    [
      # Flaky test. See https://github.com/NixOS/nixpkgs/issues/288424#issuecomment-1941609973.
      "test_run_local_server_occupied_port"
    ]
    ++ lib.optionals stdenv.isDarwin [
      # This test fails if the hostname is not associated with an IP (e.g., in `/etc/hosts`).
      "test_run_local_server_bind_addr"
    ];

  pythonImportsCheck = [ "google_auth_oauthlib" ];

  meta = with lib; {
    description = "Google Authentication Library: oauthlib integration";
    homepage = "https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib";
    changelog = "https://github.com/googleapis/google-auth-library-python-oauthlib/blob/v${version}/CHANGELOG.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ terlar ];
    mainProgram = "google-oauthlib-tool";
  };
}