nixpkgs/pkgs/development/python-modules/google-auth-oauthlib/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

65 lines
1.5 KiB
Nix

{
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.hostPlatform.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";
};
}