1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 google-api-core,
11 google-cloud-logging,
12 proto-plus,
13 protobuf,
14
15 # testing
16 google-cloud-testutils,
17 mock,
18 pytest-asyncio,
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "google-cloud-error-reporting";
24 version = "1.11.1";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "googleapis";
29 repo = "python-error-reporting";
30 tag = "v${version}";
31 hash = "sha256-z1ogY4W4RGKv0h2jW0jVpIHUY1X3P0Vw++3jYtnYTRA=";
32 };
33
34 build-system = [ setuptools ];
35
36 pythonRelaxDeps = [ "protobuf" ];
37
38 dependencies = [
39 google-api-core
40 google-cloud-logging
41 proto-plus
42 protobuf
43 ] ++ google-api-core.optional-dependencies.grpc;
44
45 nativeCheckInputs = [
46 google-cloud-testutils
47 mock
48 pytest-asyncio
49 pytestCheckHook
50 ];
51
52 disabledTests = [
53 # Tests require credentials
54 "test_report_error_event"
55 "test_report_exception"
56 # Import is already tested
57 "test_namespace_package_compat"
58 ];
59
60 preCheck = ''
61 # prevent google directory from shadowing google imports
62 rm -r google
63 '';
64
65 pythonImportsCheck = [
66 "google.cloud.error_reporting"
67 "google.cloud.errorreporting_v1beta1"
68 ];
69
70 meta = {
71 description = "Stackdriver Error Reporting API client library";
72 homepage = "https://github.com/googleapis/python-error-reporting";
73 changelog = "https://github.com/googleapis/python-error-reporting/blob/v${version}/CHANGELOG.md";
74 license = lib.licenses.asl20;
75 maintainers = [ lib.maintainers.sarahec ];
76 };
77}