Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / glean-sdk / default.nix
blob22ac0e96ea9a3cb55b738157cfbd8c0a582693a7
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , cargo
5 , cffi
6 , fetchPypi
7 , glean-parser
8 , iso8601
9 , lmdb
10 , pkg-config
11 , pytest-localserver
12 , pytestCheckHook
13 , python
14 , pythonOlder
15 , rustc
16 , rustPlatform
17 , semver
18 , setuptools-rust
21 buildPythonPackage rec {
22   pname = "glean-sdk";
23   version = "52.7.0";
25   disabled = pythonOlder "3.6";
27   src = fetchPypi {
28     inherit pname version;
29     hash = "sha256-sLjdGHiS7Co/oA9gQyAFkD14tAYjmwjWcPr4CRrzw/0=";
30   };
32   cargoDeps = rustPlatform.fetchCargoTarball {
33     inherit src;
34     name = "${pname}-${version}";
35     hash = "sha256-5TlgWcLmjklxhtDbB0aRF71iIRTJwetFj1Jii1DGdvU=";
36   };
38   nativeBuildInputs = [
39     cargo
40     pkg-config
41     rustc
42     rustPlatform.cargoSetupHook
43     setuptools-rust
44   ];
46   buildInputs = [
47     lmdb
48   ];
50   propagatedBuildInputs = [
51     cffi
52     glean-parser
53     iso8601
54     semver
55   ];
57   nativeCheckInputs = [
58     pytest-localserver
59     pytestCheckHook
60   ];
62   disabledTests = [
63     # RuntimeError: No ping received.
64     "test_client_activity_api"
65     "test_flipping_upload_enabled_respects_order_of_events"
66   ];
68   postInstallCheck = lib.optionalString (stdenv.hostPlatform.parsed.kernel.execFormat == lib.systems.parse.execFormats.elf) ''
69     readelf -a $out/${python.sitePackages}/glean/libglean_ffi.so | grep -F 'Shared library: [liblmdb.so'
70   '';
72   pythonImportsCheck = [
73     "glean"
74   ];
76   meta = with lib; {
77     broken = stdenv.isDarwin;
78     description = "Telemetry client libraries and are a part of the Glean project";
79     homepage = "https://mozilla.github.io/glean/book/index.html";
80     license = licenses.mpl20;
81     maintainers = with maintainers; [ melling ];
82   };