From 22cf1ad92d71ccc4df8b2578cf9b5951bff18e5a Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Fri, 10 Nov 2023 18:50:30 -0800 Subject: [PATCH 1/7] Update protobuf version. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a263fa4..ef33236 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ protobuf==3.20.3 pyzmq==25.1.0 edgepi-python-sdk==1.2.13 -edgepi-rpc-protobuf==1.0.15 +edgepi-rpc-protobuf==1.0.16 From a42de85a668e0db0bfed79a8d276c14b3b7ece14 Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Fri, 10 Nov 2023 19:55:20 -0800 Subject: [PATCH 2/7] Update sdk. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ef33236..fee7384 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ protobuf==3.20.3 pyzmq==25.1.0 -edgepi-python-sdk==1.2.13 +edgepi-python-sdk==1.2.15 edgepi-rpc-protobuf==1.0.16 From 7fbbd85d910f147f6bbacd6167b7473ddf739a37 Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Wed, 15 Nov 2023 11:39:40 -0800 Subject: [PATCH 3/7] Update protobuf naming. --- edgepi_rpc_client/client_rpc_channel.py | 2 +- edgepi_rpc_client/services/adc/adc_pb_enums.py | 2 +- edgepi_rpc_client/services/adc/client_adc_service.py | 2 +- edgepi_rpc_client/services/dac/client_dac_service.py | 2 +- edgepi_rpc_client/services/dac/dac_pb_enums.py | 2 +- edgepi_rpc_client/services/din/client_din_service.py | 2 +- edgepi_rpc_client/services/din/din_pb_enums.py | 2 +- edgepi_rpc_client/services/dout/client_dout_service.py | 2 +- edgepi_rpc_client/services/dout/dout_pb_enums.py | 2 +- edgepi_rpc_client/services/led/client_led_service.py | 2 +- edgepi_rpc_client/services/led/led_pb_enums.py | 2 +- edgepi_rpc_client/services/pwm/client_pwm_service.py | 2 +- edgepi_rpc_client/services/pwm/pwm_pb_enums.py | 2 +- edgepi_rpc_client/services/relay/client_relay_service.py | 2 +- edgepi_rpc_client/services/tc/client_tc_service.py | 2 +- edgepi_rpc_client/services/tc/tc_pb_enums.py | 2 +- tests/integration/test_error_handling.py | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/edgepi_rpc_client/client_rpc_channel.py b/edgepi_rpc_client/client_rpc_channel.py index 6200229..5752812 100644 --- a/edgepi_rpc_client/client_rpc_channel.py +++ b/edgepi_rpc_client/client_rpc_channel.py @@ -3,7 +3,7 @@ import logging from google.protobuf import service import zmq -from edgepirpc.protos import rpc_pb2 as rpc_pb +from python_rpc.protobufs import rpc_pb2 as rpc_pb _logger = logging.getLogger(__name__) logging.basicConfig( diff --git a/edgepi_rpc_client/services/adc/adc_pb_enums.py b/edgepi_rpc_client/services/adc/adc_pb_enums.py index 6abeeb7..aa3dbcd 100644 --- a/edgepi_rpc_client/services/adc/adc_pb_enums.py +++ b/edgepi_rpc_client/services/adc/adc_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf adc enums""" from enum import Enum -from edgepirpc.protos import adc_pb2 as adc_pb +from python_rpc.protobufs import adc_pb2 as adc_pb # pylint: disable=no-member class AnalogIn(Enum): diff --git a/edgepi_rpc_client/services/adc/client_adc_service.py b/edgepi_rpc_client/services/adc/client_adc_service.py index 22e24d7..f247623 100644 --- a/edgepi_rpc_client/services/adc/client_adc_service.py +++ b/edgepi_rpc_client/services/adc/client_adc_service.py @@ -2,7 +2,7 @@ Client for adc service """ import logging -from edgepirpc.protos import adc_pb2 as adc_pb +from python_rpc.protobufs import adc_pb2 as adc_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, create_config_request_from_args, get_server_response diff --git a/edgepi_rpc_client/services/dac/client_dac_service.py b/edgepi_rpc_client/services/dac/client_dac_service.py index aa1aafd..cf39d7a 100644 --- a/edgepi_rpc_client/services/dac/client_dac_service.py +++ b/edgepi_rpc_client/services/dac/client_dac_service.py @@ -2,7 +2,7 @@ Client for Dac service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from edgepirpc.protos import dac_pb2 as dac_pb +from python_rpc.protobufs import dac_pb2 as dac_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dac.dac_pb_enums import DACChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dac/dac_pb_enums.py b/edgepi_rpc_client/services/dac/dac_pb_enums.py index 40628b1..84692b9 100644 --- a/edgepi_rpc_client/services/dac/dac_pb_enums.py +++ b/edgepi_rpc_client/services/dac/dac_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from edgepirpc.protos import dac_pb2 as dac_pb +from python_rpc.protobufs import dac_pb2 as dac_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/din/client_din_service.py b/edgepi_rpc_client/services/din/client_din_service.py index 2bb740b..2fb7b65 100644 --- a/edgepi_rpc_client/services/din/client_din_service.py +++ b/edgepi_rpc_client/services/din/client_din_service.py @@ -2,7 +2,7 @@ Client for Din service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from edgepirpc.protos import din_pb2 as din_pb +from python_rpc.protobufs import din_pb2 as din_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.din.din_pb_enums import DinPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/din/din_pb_enums.py b/edgepi_rpc_client/services/din/din_pb_enums.py index 616df61..65a4a7a 100644 --- a/edgepi_rpc_client/services/din/din_pb_enums.py +++ b/edgepi_rpc_client/services/din/din_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from edgepirpc.protos import din_pb2 as din_pb +from python_rpc.protobufs import din_pb2 as din_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/dout/client_dout_service.py b/edgepi_rpc_client/services/dout/client_dout_service.py index adb994d..1330772 100644 --- a/edgepi_rpc_client/services/dout/client_dout_service.py +++ b/edgepi_rpc_client/services/dout/client_dout_service.py @@ -2,7 +2,7 @@ Client for Dout service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from edgepirpc.protos import dout_pb2 as dout_pb +from python_rpc.protobufs import dout_pb2 as dout_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dout.dout_pb_enums import DoutPins, DoutTriState from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dout/dout_pb_enums.py b/edgepi_rpc_client/services/dout/dout_pb_enums.py index 7f6fdfa..4ddcba0 100644 --- a/edgepi_rpc_client/services/dout/dout_pb_enums.py +++ b/edgepi_rpc_client/services/dout/dout_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from edgepirpc.protos import dout_pb2 as dout_pb +from python_rpc.protobufs import dout_pb2 as dout_pb @unique class DoutPins(Enum): diff --git a/edgepi_rpc_client/services/led/client_led_service.py b/edgepi_rpc_client/services/led/client_led_service.py index fd3f237..6ef9cc1 100644 --- a/edgepi_rpc_client/services/led/client_led_service.py +++ b/edgepi_rpc_client/services/led/client_led_service.py @@ -2,7 +2,7 @@ Client for led service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from edgepirpc.protos import led_pb2 as led_pb +from python_rpc.protobufs import led_pb2 as led_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.led.led_pb_enums import LEDPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/led/led_pb_enums.py b/edgepi_rpc_client/services/led/led_pb_enums.py index 1562d74..40c201c 100644 --- a/edgepi_rpc_client/services/led/led_pb_enums.py +++ b/edgepi_rpc_client/services/led/led_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from edgepirpc.protos import led_pb2 as led_pb +from python_rpc.protobufs import led_pb2 as led_pb @unique class LEDPins(Enum): diff --git a/edgepi_rpc_client/services/pwm/client_pwm_service.py b/edgepi_rpc_client/services/pwm/client_pwm_service.py index c205545..8cf7fd8 100644 --- a/edgepi_rpc_client/services/pwm/client_pwm_service.py +++ b/edgepi_rpc_client/services/pwm/client_pwm_service.py @@ -1,6 +1,6 @@ """Client for PWM service""" import logging -from edgepirpc.protos import pwm_pb2 as pwm_pb +from python_rpc.protobufs import pwm_pb2 as pwm_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, diff --git a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py index 4b442e0..7c0ca7b 100644 --- a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py +++ b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf PWM enums""" from enum import Enum -from edgepirpc.protos import pwm_pb2 as pwm_pb +from python_rpc.protobufs import pwm_pb2 as pwm_pb class PWMPins(Enum): """PWMPins Enum""" diff --git a/edgepi_rpc_client/services/relay/client_relay_service.py b/edgepi_rpc_client/services/relay/client_relay_service.py index 74cba15..d8b5159 100644 --- a/edgepi_rpc_client/services/relay/client_relay_service.py +++ b/edgepi_rpc_client/services/relay/client_relay_service.py @@ -1,7 +1,7 @@ """ Client for Relay Service """ -from edgepirpc.protos import relay_pb2 as relay_pb +from python_rpc.protobufs import relay_pb2 as relay_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/tc/client_tc_service.py b/edgepi_rpc_client/services/tc/client_tc_service.py index ffdadad..88bb500 100644 --- a/edgepi_rpc_client/services/tc/client_tc_service.py +++ b/edgepi_rpc_client/services/tc/client_tc_service.py @@ -3,7 +3,7 @@ and serialize/deserialize messages. """ import logging -from edgepirpc.protos import tc_pb2 as tc_pb +from python_rpc.protobufs import tc_pb2 as tc_pb from edgepi_rpc_client.util.helpers import ( create_config_request_from_args, filter_arg_values, get_server_response ) diff --git a/edgepi_rpc_client/services/tc/tc_pb_enums.py b/edgepi_rpc_client/services/tc/tc_pb_enums.py index d74a8cc..1f9d907 100644 --- a/edgepi_rpc_client/services/tc/tc_pb_enums.py +++ b/edgepi_rpc_client/services/tc/tc_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf tc enums""" #pylint: disable=no-member from enum import Enum, unique -from edgepirpc.protos import tc_pb2 as tc_pb +from python_rpc.protobufs import tc_pb2 as tc_pb @unique class ConvMode(Enum): diff --git a/tests/integration/test_error_handling.py b/tests/integration/test_error_handling.py index 01dcd58..abe1a7d 100644 --- a/tests/integration/test_error_handling.py +++ b/tests/integration/test_error_handling.py @@ -2,7 +2,7 @@ import logging import zmq from pytest import fixture -from edgepirpc.protos import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb +from python_rpc.protobufs import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb _logger = logging.getLogger(__name__) From 59f0426fd33c45b723408b1eb99a9bb522bdb1bf Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Fri, 17 Nov 2023 10:22:01 -0800 Subject: [PATCH 4/7] Update protobuf. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fee7384..610b05f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ protobuf==3.20.3 pyzmq==25.1.0 edgepi-python-sdk==1.2.15 -edgepi-rpc-protobuf==1.0.16 +edgepi-rpc-protobuf==1.0.18 From 766a17274d4fd13ea3d74dbccedcf1895e2696a4 Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Thu, 23 Nov 2023 00:49:18 -0800 Subject: [PATCH 5/7] Update protobuf directory name. --- edgepi_rpc_client/client_rpc_channel.py | 2 +- edgepi_rpc_client/services/adc/adc_pb_enums.py | 2 +- edgepi_rpc_client/services/adc/client_adc_service.py | 2 +- edgepi_rpc_client/services/dac/client_dac_service.py | 2 +- edgepi_rpc_client/services/dac/dac_pb_enums.py | 2 +- edgepi_rpc_client/services/din/client_din_service.py | 2 +- edgepi_rpc_client/services/din/din_pb_enums.py | 2 +- edgepi_rpc_client/services/dout/client_dout_service.py | 2 +- edgepi_rpc_client/services/dout/dout_pb_enums.py | 2 +- edgepi_rpc_client/services/led/client_led_service.py | 2 +- edgepi_rpc_client/services/led/led_pb_enums.py | 2 +- edgepi_rpc_client/services/pwm/client_pwm_service.py | 2 +- edgepi_rpc_client/services/pwm/pwm_pb_enums.py | 2 +- edgepi_rpc_client/services/relay/client_relay_service.py | 2 +- edgepi_rpc_client/services/tc/client_tc_service.py | 2 +- edgepi_rpc_client/services/tc/tc_pb_enums.py | 2 +- tests/integration/test_error_handling.py | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/edgepi_rpc_client/client_rpc_channel.py b/edgepi_rpc_client/client_rpc_channel.py index 5752812..321534d 100644 --- a/edgepi_rpc_client/client_rpc_channel.py +++ b/edgepi_rpc_client/client_rpc_channel.py @@ -3,7 +3,7 @@ import logging from google.protobuf import service import zmq -from python_rpc.protobufs import rpc_pb2 as rpc_pb +from python_rpc.rpc_generated_protobufs import rpc_pb2 as rpc_pb _logger = logging.getLogger(__name__) logging.basicConfig( diff --git a/edgepi_rpc_client/services/adc/adc_pb_enums.py b/edgepi_rpc_client/services/adc/adc_pb_enums.py index aa3dbcd..c6991fc 100644 --- a/edgepi_rpc_client/services/adc/adc_pb_enums.py +++ b/edgepi_rpc_client/services/adc/adc_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf adc enums""" from enum import Enum -from python_rpc.protobufs import adc_pb2 as adc_pb +from python_rpc.rpc_generated_protobufs import adc_pb2 as adc_pb # pylint: disable=no-member class AnalogIn(Enum): diff --git a/edgepi_rpc_client/services/adc/client_adc_service.py b/edgepi_rpc_client/services/adc/client_adc_service.py index f247623..a99630f 100644 --- a/edgepi_rpc_client/services/adc/client_adc_service.py +++ b/edgepi_rpc_client/services/adc/client_adc_service.py @@ -2,7 +2,7 @@ Client for adc service """ import logging -from python_rpc.protobufs import adc_pb2 as adc_pb +from python_rpc.rpc_generated_protobufs import adc_pb2 as adc_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, create_config_request_from_args, get_server_response diff --git a/edgepi_rpc_client/services/dac/client_dac_service.py b/edgepi_rpc_client/services/dac/client_dac_service.py index cf39d7a..a00b757 100644 --- a/edgepi_rpc_client/services/dac/client_dac_service.py +++ b/edgepi_rpc_client/services/dac/client_dac_service.py @@ -2,7 +2,7 @@ Client for Dac service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.protobufs import dac_pb2 as dac_pb +from python_rpc.rpc_generated_protobufs import dac_pb2 as dac_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dac.dac_pb_enums import DACChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dac/dac_pb_enums.py b/edgepi_rpc_client/services/dac/dac_pb_enums.py index 84692b9..c388f82 100644 --- a/edgepi_rpc_client/services/dac/dac_pb_enums.py +++ b/edgepi_rpc_client/services/dac/dac_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from python_rpc.protobufs import dac_pb2 as dac_pb +from python_rpc.rpc_generated_protobufs import dac_pb2 as dac_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/din/client_din_service.py b/edgepi_rpc_client/services/din/client_din_service.py index 2fb7b65..807e6c7 100644 --- a/edgepi_rpc_client/services/din/client_din_service.py +++ b/edgepi_rpc_client/services/din/client_din_service.py @@ -2,7 +2,7 @@ Client for Din service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.protobufs import din_pb2 as din_pb +from python_rpc.rpc_generated_protobufs import din_pb2 as din_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.din.din_pb_enums import DinPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/din/din_pb_enums.py b/edgepi_rpc_client/services/din/din_pb_enums.py index 65a4a7a..0f2caae 100644 --- a/edgepi_rpc_client/services/din/din_pb_enums.py +++ b/edgepi_rpc_client/services/din/din_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from python_rpc.protobufs import din_pb2 as din_pb +from python_rpc.rpc_generated_protobufs import din_pb2 as din_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/dout/client_dout_service.py b/edgepi_rpc_client/services/dout/client_dout_service.py index 1330772..db04d0b 100644 --- a/edgepi_rpc_client/services/dout/client_dout_service.py +++ b/edgepi_rpc_client/services/dout/client_dout_service.py @@ -2,7 +2,7 @@ Client for Dout service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.protobufs import dout_pb2 as dout_pb +from python_rpc.rpc_generated_protobufs import dout_pb2 as dout_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dout.dout_pb_enums import DoutPins, DoutTriState from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dout/dout_pb_enums.py b/edgepi_rpc_client/services/dout/dout_pb_enums.py index 4ddcba0..2e25c79 100644 --- a/edgepi_rpc_client/services/dout/dout_pb_enums.py +++ b/edgepi_rpc_client/services/dout/dout_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from python_rpc.protobufs import dout_pb2 as dout_pb +from python_rpc.rpc_generated_protobufs import dout_pb2 as dout_pb @unique class DoutPins(Enum): diff --git a/edgepi_rpc_client/services/led/client_led_service.py b/edgepi_rpc_client/services/led/client_led_service.py index 6ef9cc1..b78e360 100644 --- a/edgepi_rpc_client/services/led/client_led_service.py +++ b/edgepi_rpc_client/services/led/client_led_service.py @@ -2,7 +2,7 @@ Client for led service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.protobufs import led_pb2 as led_pb +from python_rpc.rpc_generated_protobufs import led_pb2 as led_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.led.led_pb_enums import LEDPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/led/led_pb_enums.py b/edgepi_rpc_client/services/led/led_pb_enums.py index 40c201c..e71dd7c 100644 --- a/edgepi_rpc_client/services/led/led_pb_enums.py +++ b/edgepi_rpc_client/services/led/led_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from python_rpc.protobufs import led_pb2 as led_pb +from python_rpc.rpc_generated_protobufs import led_pb2 as led_pb @unique class LEDPins(Enum): diff --git a/edgepi_rpc_client/services/pwm/client_pwm_service.py b/edgepi_rpc_client/services/pwm/client_pwm_service.py index 8cf7fd8..1fa0ac2 100644 --- a/edgepi_rpc_client/services/pwm/client_pwm_service.py +++ b/edgepi_rpc_client/services/pwm/client_pwm_service.py @@ -1,6 +1,6 @@ """Client for PWM service""" import logging -from python_rpc.protobufs import pwm_pb2 as pwm_pb +from python_rpc.rpc_generated_protobufs import pwm_pb2 as pwm_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, diff --git a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py index 7c0ca7b..8b14a32 100644 --- a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py +++ b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf PWM enums""" from enum import Enum -from python_rpc.protobufs import pwm_pb2 as pwm_pb +from python_rpc.rpc_generated_protobufs import pwm_pb2 as pwm_pb class PWMPins(Enum): """PWMPins Enum""" diff --git a/edgepi_rpc_client/services/relay/client_relay_service.py b/edgepi_rpc_client/services/relay/client_relay_service.py index d8b5159..2b3a22f 100644 --- a/edgepi_rpc_client/services/relay/client_relay_service.py +++ b/edgepi_rpc_client/services/relay/client_relay_service.py @@ -1,7 +1,7 @@ """ Client for Relay Service """ -from python_rpc.protobufs import relay_pb2 as relay_pb +from python_rpc.rpc_generated_protobufs import relay_pb2 as relay_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/tc/client_tc_service.py b/edgepi_rpc_client/services/tc/client_tc_service.py index 88bb500..15ec1cc 100644 --- a/edgepi_rpc_client/services/tc/client_tc_service.py +++ b/edgepi_rpc_client/services/tc/client_tc_service.py @@ -3,7 +3,7 @@ and serialize/deserialize messages. """ import logging -from python_rpc.protobufs import tc_pb2 as tc_pb +from python_rpc.rpc_generated_protobufs import tc_pb2 as tc_pb from edgepi_rpc_client.util.helpers import ( create_config_request_from_args, filter_arg_values, get_server_response ) diff --git a/edgepi_rpc_client/services/tc/tc_pb_enums.py b/edgepi_rpc_client/services/tc/tc_pb_enums.py index 1f9d907..2855ac1 100644 --- a/edgepi_rpc_client/services/tc/tc_pb_enums.py +++ b/edgepi_rpc_client/services/tc/tc_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf tc enums""" #pylint: disable=no-member from enum import Enum, unique -from python_rpc.protobufs import tc_pb2 as tc_pb +from python_rpc.rpc_generated_protobufs import tc_pb2 as tc_pb @unique class ConvMode(Enum): diff --git a/tests/integration/test_error_handling.py b/tests/integration/test_error_handling.py index abe1a7d..da6da67 100644 --- a/tests/integration/test_error_handling.py +++ b/tests/integration/test_error_handling.py @@ -2,7 +2,7 @@ import logging import zmq from pytest import fixture -from python_rpc.protobufs import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb +from python_rpc.rpc_generated_protobufs import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb _logger = logging.getLogger(__name__) From ec81db3d24ccca666b457fed91e8f038a4871626 Mon Sep 17 00:00:00 2001 From: Josiah Kievit Date: Thu, 23 Nov 2023 00:51:40 -0800 Subject: [PATCH 6/7] Update protobuf naming. --- edgepi_rpc_client/client_rpc_channel.py | 2 +- edgepi_rpc_client/services/adc/adc_pb_enums.py | 2 +- edgepi_rpc_client/services/adc/client_adc_service.py | 2 +- edgepi_rpc_client/services/dac/client_dac_service.py | 2 +- edgepi_rpc_client/services/dac/dac_pb_enums.py | 2 +- edgepi_rpc_client/services/din/client_din_service.py | 2 +- edgepi_rpc_client/services/din/din_pb_enums.py | 2 +- edgepi_rpc_client/services/dout/client_dout_service.py | 2 +- edgepi_rpc_client/services/dout/dout_pb_enums.py | 2 +- edgepi_rpc_client/services/led/client_led_service.py | 2 +- edgepi_rpc_client/services/led/led_pb_enums.py | 2 +- edgepi_rpc_client/services/pwm/client_pwm_service.py | 2 +- edgepi_rpc_client/services/pwm/pwm_pb_enums.py | 2 +- edgepi_rpc_client/services/relay/client_relay_service.py | 2 +- edgepi_rpc_client/services/tc/client_tc_service.py | 2 +- edgepi_rpc_client/services/tc/tc_pb_enums.py | 2 +- tests/integration/test_error_handling.py | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/edgepi_rpc_client/client_rpc_channel.py b/edgepi_rpc_client/client_rpc_channel.py index 321534d..4f3f814 100644 --- a/edgepi_rpc_client/client_rpc_channel.py +++ b/edgepi_rpc_client/client_rpc_channel.py @@ -3,7 +3,7 @@ import logging from google.protobuf import service import zmq -from python_rpc.rpc_generated_protobufs import rpc_pb2 as rpc_pb +from rpc_generated_protobufs import rpc_pb2 as rpc_pb _logger = logging.getLogger(__name__) logging.basicConfig( diff --git a/edgepi_rpc_client/services/adc/adc_pb_enums.py b/edgepi_rpc_client/services/adc/adc_pb_enums.py index c6991fc..5bc4e61 100644 --- a/edgepi_rpc_client/services/adc/adc_pb_enums.py +++ b/edgepi_rpc_client/services/adc/adc_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf adc enums""" from enum import Enum -from python_rpc.rpc_generated_protobufs import adc_pb2 as adc_pb +from rpc_generated_protobufs import adc_pb2 as adc_pb # pylint: disable=no-member class AnalogIn(Enum): diff --git a/edgepi_rpc_client/services/adc/client_adc_service.py b/edgepi_rpc_client/services/adc/client_adc_service.py index a99630f..87d8dda 100644 --- a/edgepi_rpc_client/services/adc/client_adc_service.py +++ b/edgepi_rpc_client/services/adc/client_adc_service.py @@ -2,7 +2,7 @@ Client for adc service """ import logging -from python_rpc.rpc_generated_protobufs import adc_pb2 as adc_pb +from rpc_generated_protobufs import adc_pb2 as adc_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, create_config_request_from_args, get_server_response diff --git a/edgepi_rpc_client/services/dac/client_dac_service.py b/edgepi_rpc_client/services/dac/client_dac_service.py index a00b757..4fdb167 100644 --- a/edgepi_rpc_client/services/dac/client_dac_service.py +++ b/edgepi_rpc_client/services/dac/client_dac_service.py @@ -2,7 +2,7 @@ Client for Dac service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.rpc_generated_protobufs import dac_pb2 as dac_pb +from rpc_generated_protobufs import dac_pb2 as dac_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dac.dac_pb_enums import DACChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dac/dac_pb_enums.py b/edgepi_rpc_client/services/dac/dac_pb_enums.py index c388f82..908956d 100644 --- a/edgepi_rpc_client/services/dac/dac_pb_enums.py +++ b/edgepi_rpc_client/services/dac/dac_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from python_rpc.rpc_generated_protobufs import dac_pb2 as dac_pb +from rpc_generated_protobufs import dac_pb2 as dac_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/din/client_din_service.py b/edgepi_rpc_client/services/din/client_din_service.py index 807e6c7..fb0747e 100644 --- a/edgepi_rpc_client/services/din/client_din_service.py +++ b/edgepi_rpc_client/services/din/client_din_service.py @@ -2,7 +2,7 @@ Client for Din service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.rpc_generated_protobufs import din_pb2 as din_pb +from rpc_generated_protobufs import din_pb2 as din_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.din.din_pb_enums import DinPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/din/din_pb_enums.py b/edgepi_rpc_client/services/din/din_pb_enums.py index 0f2caae..d99655f 100644 --- a/edgepi_rpc_client/services/din/din_pb_enums.py +++ b/edgepi_rpc_client/services/din/din_pb_enums.py @@ -1,6 +1,6 @@ """Client Enum to Protobuf Enum mapping""" from enum import Enum, unique -from python_rpc.rpc_generated_protobufs import din_pb2 as din_pb +from rpc_generated_protobufs import din_pb2 as din_pb # pylint: disable=no-member @unique diff --git a/edgepi_rpc_client/services/dout/client_dout_service.py b/edgepi_rpc_client/services/dout/client_dout_service.py index db04d0b..fccabaf 100644 --- a/edgepi_rpc_client/services/dout/client_dout_service.py +++ b/edgepi_rpc_client/services/dout/client_dout_service.py @@ -2,7 +2,7 @@ Client for Dout service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.rpc_generated_protobufs import dout_pb2 as dout_pb +from rpc_generated_protobufs import dout_pb2 as dout_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.dout.dout_pb_enums import DoutPins, DoutTriState from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/dout/dout_pb_enums.py b/edgepi_rpc_client/services/dout/dout_pb_enums.py index 2e25c79..5be3ec9 100644 --- a/edgepi_rpc_client/services/dout/dout_pb_enums.py +++ b/edgepi_rpc_client/services/dout/dout_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from python_rpc.rpc_generated_protobufs import dout_pb2 as dout_pb +from rpc_generated_protobufs import dout_pb2 as dout_pb @unique class DoutPins(Enum): diff --git a/edgepi_rpc_client/services/led/client_led_service.py b/edgepi_rpc_client/services/led/client_led_service.py index b78e360..95cb22f 100644 --- a/edgepi_rpc_client/services/led/client_led_service.py +++ b/edgepi_rpc_client/services/led/client_led_service.py @@ -2,7 +2,7 @@ Client for led service. Utilizes ClientRpcChannel to send/receive and serialize/deserialize messages """ -from python_rpc.rpc_generated_protobufs import led_pb2 as led_pb +from rpc_generated_protobufs import led_pb2 as led_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.services.led.led_pb_enums import LEDPins from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/led/led_pb_enums.py b/edgepi_rpc_client/services/led/led_pb_enums.py index e71dd7c..7f64031 100644 --- a/edgepi_rpc_client/services/led/led_pb_enums.py +++ b/edgepi_rpc_client/services/led/led_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf led enums""" # pylint: disable=no-member from enum import Enum, unique -from python_rpc.rpc_generated_protobufs import led_pb2 as led_pb +from rpc_generated_protobufs import led_pb2 as led_pb @unique class LEDPins(Enum): diff --git a/edgepi_rpc_client/services/pwm/client_pwm_service.py b/edgepi_rpc_client/services/pwm/client_pwm_service.py index 1fa0ac2..af96ac7 100644 --- a/edgepi_rpc_client/services/pwm/client_pwm_service.py +++ b/edgepi_rpc_client/services/pwm/client_pwm_service.py @@ -1,6 +1,6 @@ """Client for PWM service""" import logging -from python_rpc.rpc_generated_protobufs import pwm_pb2 as pwm_pb +from rpc_generated_protobufs import pwm_pb2 as pwm_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import ( filter_arg_values, diff --git a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py index 8b14a32..fc3f9e2 100644 --- a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py +++ b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py @@ -1,6 +1,6 @@ """Client enums to protobuf PWM enums""" from enum import Enum -from python_rpc.rpc_generated_protobufs import pwm_pb2 as pwm_pb +from rpc_generated_protobufs import pwm_pb2 as pwm_pb class PWMPins(Enum): """PWMPins Enum""" diff --git a/edgepi_rpc_client/services/relay/client_relay_service.py b/edgepi_rpc_client/services/relay/client_relay_service.py index 2b3a22f..724c144 100644 --- a/edgepi_rpc_client/services/relay/client_relay_service.py +++ b/edgepi_rpc_client/services/relay/client_relay_service.py @@ -1,7 +1,7 @@ """ Client for Relay Service """ -from python_rpc.rpc_generated_protobufs import relay_pb2 as relay_pb +from rpc_generated_protobufs import relay_pb2 as relay_pb from edgepi_rpc_client.client_rpc_channel import ClientRpcChannel from edgepi_rpc_client.util.helpers import get_server_response diff --git a/edgepi_rpc_client/services/tc/client_tc_service.py b/edgepi_rpc_client/services/tc/client_tc_service.py index 15ec1cc..c9d36e6 100644 --- a/edgepi_rpc_client/services/tc/client_tc_service.py +++ b/edgepi_rpc_client/services/tc/client_tc_service.py @@ -3,7 +3,7 @@ and serialize/deserialize messages. """ import logging -from python_rpc.rpc_generated_protobufs import tc_pb2 as tc_pb +from rpc_generated_protobufs import tc_pb2 as tc_pb from edgepi_rpc_client.util.helpers import ( create_config_request_from_args, filter_arg_values, get_server_response ) diff --git a/edgepi_rpc_client/services/tc/tc_pb_enums.py b/edgepi_rpc_client/services/tc/tc_pb_enums.py index 2855ac1..f5f9a34 100644 --- a/edgepi_rpc_client/services/tc/tc_pb_enums.py +++ b/edgepi_rpc_client/services/tc/tc_pb_enums.py @@ -1,7 +1,7 @@ """Client enums to protobuf tc enums""" #pylint: disable=no-member from enum import Enum, unique -from python_rpc.rpc_generated_protobufs import tc_pb2 as tc_pb +from rpc_generated_protobufs import tc_pb2 as tc_pb @unique class ConvMode(Enum): diff --git a/tests/integration/test_error_handling.py b/tests/integration/test_error_handling.py index da6da67..bd02a05 100644 --- a/tests/integration/test_error_handling.py +++ b/tests/integration/test_error_handling.py @@ -2,7 +2,7 @@ import logging import zmq from pytest import fixture -from python_rpc.rpc_generated_protobufs import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb +from rpc_generated_protobufs import rpc_pb2 as rpc_pb, tc_pb2 as tc_pb _logger = logging.getLogger(__name__) From f3b68ef60d17757d8baaeb32b696db83156c64e9 Mon Sep 17 00:00:00 2001 From: iaj2 Date: Wed, 29 Nov 2023 14:25:18 -0800 Subject: [PATCH 7/7] Update testing configuration. --- .github/workflows/python-integration-test.yml | 29 ++++++++++--------- .../services/pwm/pwm_pb_enums.py | 1 + requirements.txt | 2 +- setup.cfg | 2 +- start_server.sh | 15 ---------- tests/integration/README.md | 27 +++++++++++++++++ tests/integration/conftest.py | 11 ------- tests/integration/test_pwm_service.py | 16 +++++----- 8 files changed, 53 insertions(+), 50 deletions(-) delete mode 100644 start_server.sh create mode 100644 tests/integration/README.md delete mode 100644 tests/integration/conftest.py diff --git a/.github/workflows/python-integration-test.yml b/.github/workflows/python-integration-test.yml index da45fa8..45f0fbe 100644 --- a/.github/workflows/python-integration-test.yml +++ b/.github/workflows/python-integration-test.yml @@ -3,15 +3,6 @@ name: Python Integration Test on: push: branches: - - dev - - staging - - main - paths-ignore: - - version - pull_request: - branches: - - dev - - staging - main paths-ignore: - version @@ -19,30 +10,40 @@ on: jobs: test: name: Integration Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux, ARM64] strategy: fail-fast: false matrix: python-version: ["3.9"] steps: - - name: Checkout + - name: Checkout (PR) if: ${{ github.event_name == 'pull_request'}} uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - - name: Checkout + + - name: Checkout (Push) if: ${{ github.event_name == 'push'}} uses: actions/checkout@v3 with: ref: ${{ github.ref_name }} + - name: Install Dependencies run: | - python -m pip install --upgrade pip python -m venv venv_test source venv_test/bin/activate python -m pip install -r requirements_test.txt + + - name: Check edgepi-rpc-server installation + run: | + if ! dpkg -s edgepi-rpc-server >/dev/null 2>&1 + then + echo "edgepi-rpc-server is not installed. Exiting..." + exit 1 + fi + - name: Test with pytest run: | source venv_test/bin/activate - pytest ./tests/integration/test_module.py -vvs # change this back to all integration tests once server issue is fixed + pytest ./tests/integration -vvs diff --git a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py index fc3f9e2..0d7fc34 100644 --- a/edgepi_rpc_client/services/pwm/pwm_pb_enums.py +++ b/edgepi_rpc_client/services/pwm/pwm_pb_enums.py @@ -2,6 +2,7 @@ from enum import Enum from rpc_generated_protobufs import pwm_pb2 as pwm_pb +# pylint: disable=no-member class PWMPins(Enum): """PWMPins Enum""" PWM1 = pwm_pb.PWMPins.PWM1 diff --git a/requirements.txt b/requirements.txt index 610b05f..3ba8a84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ protobuf==3.20.3 pyzmq==25.1.0 edgepi-python-sdk==1.2.15 -edgepi-rpc-protobuf==1.0.18 +edgepi-rpc-protobuf==1.0.24 diff --git a/setup.cfg b/setup.cfg index 5011c7c..ad1008d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,6 @@ packages = install_requires = protobuf>=3.20.3 - edgepi-rpc-protobuf>=1.0.15 + edgepi-rpc-protobuf>=1.0.24 pyzmq>=25.1.0 edgepi-python-sdk>=1.2.13 diff --git a/start_server.sh b/start_server.sh deleted file mode 100644 index 850b23c..0000000 --- a/start_server.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -wget -qO - https://deb.edgepi.com/edgepi-release.gpg | sudo gpg --dearmor -o /usr/share/keyrings/edgepi-release.gpg - -sudo tee /etc/apt/sources.list.d/edgepi.list >/dev/null <<'EOF' -deb [signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/main bullseye main -deb [signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/test bullseye test -deb [signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/nightly bullseye nightly -EOF - -sudo apt-get update - -apt-cache pkgnames | grep '^edge' - -sudo apt-get install edgepi-rpc-server diff --git a/tests/integration/README.md b/tests/integration/README.md new file mode 100644 index 0000000..77a04fb --- /dev/null +++ b/tests/integration/README.md @@ -0,0 +1,27 @@ +## Necessary environment for running the integration tests: + +The EdgePi RPC server must be installed on the EdgePi for the integration tests to run. + +Check if the server is installed: + +``` +sudo systemctl status edgepi-rpc-server +``` + +If not already installed, install the server through the following commands: + +``` +wget -qO - https://deb.edgepi.com/edgepi-release.gpg | sudo gpg --dearmor -o /usr/share/keyrings/edgepi-release.gpg + +sudo tee /etc/apt/sources.list.d/edgepi.list >/dev/null <<'EOF' +deb [arch=arm64, signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/main bullseye main +#deb [arch=arm64, signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/test bullseye test +#deb [arch=arm64, signed-by=/usr/share/keyrings/edgepi-release.gpg] https://deb.edgepi.com/nightly bullseye nightly +EOF + +sudo apt update + +sudo apt install edgepi-rpc-server + +sudo reboot +``` \ No newline at end of file diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py deleted file mode 100644 index 8d41861..0000000 --- a/tests/integration/conftest.py +++ /dev/null @@ -1,11 +0,0 @@ -# """Integration test setup for RPC Server""" -# import subprocess -# import pytest - -# @pytest.fixture(scope="session", autouse=True) -# def setup_server(): -# """Server Setup""" -# subprocess.run(["bash", "./start_server.sh"], check=True) - - -# TODO: Enable this once the server issue is fixed for integration tests diff --git a/tests/integration/test_pwm_service.py b/tests/integration/test_pwm_service.py index e37a927..33c9572 100644 --- a/tests/integration/test_pwm_service.py +++ b/tests/integration/test_pwm_service.py @@ -1,6 +1,6 @@ """PWMService integration test""" -import pytest import time +import pytest from edgepi_rpc_client.services.pwm.client_pwm_service import ClientPWMService from edgepi_rpc_client.services.pwm.pwm_pb_enums import PWMPins, Polarity @@ -8,7 +8,7 @@ @pytest.fixture(name="pwm_service") def fixture_test_pwm_service(): """Inits new PWM service client for testing""" - return ClientPWMService('tcp://localhost:4444') + return ClientPWMService('tcp://localhost:5555') @pytest.mark.parametrize( "args", @@ -119,12 +119,12 @@ def test_get_enabled(pwm_service, pwm_num): assert isinstance(enabled, bool) def test_with_edgepi(pwm_service): - """Manual testing of PWM functionality.""" - pwm_service.init_pwm(pwm_num=PWMPins.PWM1) - pwm_service.set_config(pwm_num=PWMPins.PWM1, duty_cycle=0) - pwm_service.enable(PWMPins.PWM1) + """Used for manual testing of PWM functionality.""" + pwm_service.init_pwm(pwm_num=PWMPins.PWM2) + pwm_service.set_config(pwm_num=PWMPins.PWM2, polarity=Polarity.NORMAL) + pwm_service.enable(PWMPins.PWM2) time.sleep(3) - pwm_service.set_config(pwm_num=PWMPins.PWM1, duty_cycle=0.5) + pwm_service.set_config(pwm_num=PWMPins.PWM2, polarity=Polarity.INVERSED) time.sleep(3) - pwm_service.set_config(pwm_num=PWMPins.PWM1, duty_cycle=1) + pwm_service.set_config(pwm_num=PWMPins.PWM2, polarity=Polarity.NORMAL) \ No newline at end of file