nixpkgs/pkgs/development/python-modules/glean-sdk/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

68 lines
1.4 KiB
Nix

{
stdenv,
lib,
buildPythonPackage,
fetchFromGitHub,
glean-parser,
pytest-localserver,
pytestCheckHook,
rustPlatform,
semver,
setuptools,
}:
buildPythonPackage rec {
pname = "glean-sdk";
version = "60.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "mozilla";
repo = "glean";
rev = "v${version}";
hash = "sha256-C3wQdxPNBPQN6eUK6Vq0bA6Wpqb28e9BTBf7c/hTQxU=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-XqOCHnvM64kZNifU5Wt/bFAvyRVy28ozWSwlvm/sMk8=";
};
build-system = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
setuptools
];
dependencies = [
glean-parser
semver
];
nativeCheckInputs = [
pytest-localserver
pytestCheckHook
];
pytestFlagsArray = [ "glean-core/python/tests" ];
disabledTests = [
# RuntimeError: No ping received.
"test_client_activity_api"
"test_flipping_upload_enabled_respects_order_of_events"
# A warning causes this test to fail
"test_get_language_tag_reports_the_tag_for_the_default_locale"
];
pythonImportsCheck = [ "glean" ];
meta = {
broken = stdenv.hostPlatform.isDarwin;
description = "Telemetry client libraries and are a part of the Glean project";
homepage = "https://mozilla.github.io/glean/book/index.html";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ melling ];
};
}