1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 google-api-core,
6 grpc-google-iam-v1,
7 libcst,
8 mock,
9 proto-plus,
10 protobuf,
11 pytest-asyncio,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "google-cloud-iot";
18 version = "2.9.2";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-pLQgcwR89F+9jcSDtW/5+6Gy+Wk7XQf4iD49vDPkN9U=";
26 };
27
28 propagatedBuildInputs = [
29 google-api-core
30 grpc-google-iam-v1
31 libcst
32 proto-plus
33 protobuf
34 ] ++ google-api-core.optional-dependencies.grpc;
35
36 nativeCheckInputs = [
37 mock
38 pytest-asyncio
39 pytestCheckHook
40 ];
41
42 # including_default_value_fields was deprecated, the new version is called
43 # always_print_fields_with_no_presence
44 postPatch = ''
45 substituteInPlace "tests/unit/gapic/iot_v1/test_device_manager.py" \
46 --replace-fail "including_default_value_fields" "always_print_fields_with_no_presence"
47 substituteInPlace "google/cloud/iot_v1/services/device_manager/transports/rest.py" \
48 --replace-fail "including_default_value_fields" "always_print_fields_with_no_presence"
49 '';
50
51 disabledTests = [
52 # requires credentials
53 "test_list_device_registries"
54 ];
55
56 pythonImportsCheck = [
57 "google.cloud.iot"
58 "google.cloud.iot_v1"
59 ];
60
61 meta = with lib; {
62 description = "Cloud IoT API API client library";
63 homepage = "https://github.com/googleapis/python-iot";
64 changelog = "https://github.com/googleapis/python-iot/blob/v${version}/CHANGELOG.md";
65 license = licenses.asl20;
66 maintainers = [ ];
67 };
68}