Skip to content

Commit 49c0cda

Browse files
authored
Merge pull request #712 from ShafSpecs/main
Swapped out `aiogrpc` + updated MAVSDK dependencies
2 parents 76619b0 + 9fff235 commit 49c0cda

File tree

79 files changed

+321
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+321
-535
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ build/
1111
.pytest_cache/
1212
.tox/
1313
mavsdk/bin/mavsdk_server
14+
mavsdk/bin/mavsdk_server.exe

mavsdk/action_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/action_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import action_pb2 as action_dot_action__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in action/action_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -485,7 +490,6 @@ def add_ActionServiceServicer_to_server(servicer, server):
485490
generic_handler = grpc.method_handlers_generic_handler(
486491
'mavsdk.rpc.action.ActionService', rpc_method_handlers)
487492
server.add_generic_rpc_handlers((generic_handler,))
488-
server.add_registered_method_handlers('mavsdk.rpc.action.ActionService', rpc_method_handlers)
489493

490494

491495
# This class is part of an EXPERIMENTAL API.

mavsdk/action_server_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/action_server_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import action_server_pb2 as action__server_dot_action__server__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in action_server/action_server_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -252,7 +257,6 @@ def add_ActionServerServiceServicer_to_server(servicer, server):
252257
generic_handler = grpc.method_handlers_generic_handler(
253258
'mavsdk.rpc.action_server.ActionServerService', rpc_method_handlers)
254259
server.add_generic_rpc_handlers((generic_handler,))
255-
server.add_registered_method_handlers('mavsdk.rpc.action_server.ActionServerService', rpc_method_handlers)
256260

257261

258262
# This class is part of an EXPERIMENTAL API.

mavsdk/arm_authorizer_server_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/arm_authorizer_server_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import arm_authorizer_server_pb2 as arm__authorizer__server_dot_arm__authorizer__server__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in arm_authorizer_server/arm_authorizer_server_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -97,7 +102,6 @@ def add_ArmAuthorizerServerServiceServicer_to_server(servicer, server):
97102
generic_handler = grpc.method_handlers_generic_handler(
98103
'mavsdk.rpc.arm_authorizer_server.ArmAuthorizerServerService', rpc_method_handlers)
99104
server.add_generic_rpc_handlers((generic_handler,))
100-
server.add_registered_method_handlers('mavsdk.rpc.arm_authorizer_server.ArmAuthorizerServerService', rpc_method_handlers)
101105

102106

103107
# This class is part of an EXPERIMENTAL API.

mavsdk/async_plugin_manager.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import logging
3-
import aiogrpc
3+
from grpc import aio
44

55

66
class AsyncPluginManager:
@@ -26,16 +26,15 @@ async def _connect_backend(self):
2626
"""
2727

2828
#: gRPC channel
29-
self._channel = aiogrpc.insecure_channel(
30-
"{}:{}".format(self.host, self.port),
31-
standalone_pool_for_streaming=True
29+
self._channel = aio.insecure_channel(
30+
"{}:{}".format(self.host, self.port)
3231
)
3332

3433
logger = logging.getLogger(__name__)
3534
logger.addHandler(logging.NullHandler()) # Avoid errors when user has not configured logging
3635

3736
logger.debug("Waiting for mavsdk_server to be ready...")
38-
await aiogrpc.channel_ready_future(self._channel)
37+
await self._channel.channel_ready()
3938
logger.debug("Connected to mavsdk_server!")
4039

4140
@property

mavsdk/calibration_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/calibration_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import calibration_pb2 as calibration_dot_calibration__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in calibration/calibration_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -150,7 +155,6 @@ def add_CalibrationServiceServicer_to_server(servicer, server):
150155
generic_handler = grpc.method_handlers_generic_handler(
151156
'mavsdk.rpc.calibration.CalibrationService', rpc_method_handlers)
152157
server.add_generic_rpc_handlers((generic_handler,))
153-
server.add_registered_method_handlers('mavsdk.rpc.calibration.CalibrationService', rpc_method_handlers)
154158

155159

156160
# This class is part of an EXPERIMENTAL API.

mavsdk/camera_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/camera_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import camera_pb2 as camera_dot_camera__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in camera/camera_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -725,7 +730,6 @@ def add_CameraServiceServicer_to_server(servicer, server):
725730
generic_handler = grpc.method_handlers_generic_handler(
726731
'mavsdk.rpc.camera.CameraService', rpc_method_handlers)
727732
server.add_generic_rpc_handlers((generic_handler,))
728-
server.add_registered_method_handlers('mavsdk.rpc.camera.CameraService', rpc_method_handlers)
729733

730734

731735
# This class is part of an EXPERIMENTAL API.

mavsdk/camera_server_pb2.py

+1-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/camera_server_pb2_grpc.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from . import camera_server_pb2 as camera__server_dot_camera__server__pb2
77

8-
GRPC_GENERATED_VERSION = '1.70.0'
8+
GRPC_GENERATED_VERSION = '1.63.0'
99
GRPC_VERSION = grpc.__version__
10+
EXPECTED_ERROR_RELEASE = '1.65.0'
11+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
1012
_version_not_supported = False
1113

1214
try:
@@ -16,12 +18,15 @@
1618
_version_not_supported = True
1719

1820
if _version_not_supported:
19-
raise RuntimeError(
21+
warnings.warn(
2022
f'The grpc package installed is at version {GRPC_VERSION},'
2123
+ f' but the generated code in camera_server/camera_server_pb2_grpc.py depends on'
2224
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2325
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2426
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
28+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
29+
RuntimeWarning
2530
)
2631

2732

@@ -711,7 +716,6 @@ def add_CameraServerServiceServicer_to_server(servicer, server):
711716
generic_handler = grpc.method_handlers_generic_handler(
712717
'mavsdk.rpc.camera_server.CameraServerService', rpc_method_handlers)
713718
server.add_generic_rpc_handlers((generic_handler,))
714-
server.add_registered_method_handlers('mavsdk.rpc.camera_server.CameraServerService', rpc_method_handlers)
715719

716720

717721
# This class is part of an EXPERIMENTAL API.

0 commit comments

Comments
 (0)