1{ stdenv 2, lib 3, buildPythonPackage 4, cargo 5, cffi 6, fetchPypi 7, glean-parser 8, iso8601 9, pytest-localserver 10, pytestCheckHook 11, pythonOlder 12, rustc 13, rustPlatform 14, semver 15, setuptools-rust 16}: 17 18buildPythonPackage rec { 19 pname = "glean-sdk"; 20 version = "51.2.0"; 21 22 disabled = pythonOlder "3.6"; 23 24 src = fetchPypi { 25 inherit pname version; 26 hash = "sha256-4EXCYthMabdmxWYltcnO0UTNeAYXwXQeRfwxt1WD3Ug="; 27 }; 28 29 cargoDeps = rustPlatform.fetchCargoTarball { 30 inherit src; 31 name = "${pname}-${version}"; 32 hash = "sha256-qOGoonutuIY+0UVaVSVVt0NbqEICdNs3qHWG0Epmkl0="; 33 }; 34 35 nativeBuildInputs = [ 36 cargo 37 rustc 38 rustPlatform.cargoSetupHook 39 setuptools-rust 40 ]; 41 42 propagatedBuildInputs = [ 43 cffi 44 glean-parser 45 iso8601 46 semver 47 ]; 48 49 checkInputs = [ 50 pytest-localserver 51 pytestCheckHook 52 ]; 53 54 disabledTests = [ 55 # RuntimeError: No ping received. 56 "test_client_activity_api" 57 ]; 58 59 postPatch = '' 60 substituteInPlace glean-core/python/setup.py \ 61 --replace "glean_parser==5.0.1" "glean_parser>=5.0.1" 62 ''; 63 64 pythonImportsCheck = [ 65 "glean" 66 ]; 67 68 meta = with lib; { 69 broken = stdenv.isDarwin; 70 description = "Telemetry client libraries and are a part of the Glean project"; 71 homepage = "https://mozilla.github.io/glean/book/index.html"; 72 license = licenses.mpl20; 73 maintainers = []; 74 }; 75}