Skip to content

Commit

Permalink
Merge pull request #712 from ShafSpecs/main
Browse files Browse the repository at this point in the history
Swapped out `aiogrpc` + updated MAVSDK dependencies
  • Loading branch information
julianoes authored Jan 25, 2025
2 parents 76619b0 + 9fff235 commit 49c0cda
Show file tree
Hide file tree
Showing 79 changed files with 321 additions and 535 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ build/
.pytest_cache/
.tox/
mavsdk/bin/mavsdk_server
mavsdk/bin/mavsdk_server.exe
12 changes: 1 addition & 11 deletions mavsdk/action_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/action_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import action_pb2 as action_dot_action__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -485,7 +490,6 @@ def add_ActionServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.action.ActionService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.action.ActionService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
12 changes: 1 addition & 11 deletions mavsdk/action_server_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/action_server_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import action_server_pb2 as action__server_dot_action__server__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -252,7 +257,6 @@ def add_ActionServerServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.action_server.ActionServerService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.action_server.ActionServerService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
12 changes: 1 addition & 11 deletions mavsdk/arm_authorizer_server_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/arm_authorizer_server_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import arm_authorizer_server_pb2 as arm__authorizer__server_dot_arm__authorizer__server__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -97,7 +102,6 @@ def add_ArmAuthorizerServerServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.arm_authorizer_server.ArmAuthorizerServerService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.arm_authorizer_server.ArmAuthorizerServerService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
9 changes: 4 additions & 5 deletions mavsdk/async_plugin_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import logging
import aiogrpc
from grpc import aio


class AsyncPluginManager:
Expand All @@ -26,16 +26,15 @@ async def _connect_backend(self):
"""

#: gRPC channel
self._channel = aiogrpc.insecure_channel(
"{}:{}".format(self.host, self.port),
standalone_pool_for_streaming=True
self._channel = aio.insecure_channel(
"{}:{}".format(self.host, self.port)
)

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

logger.debug("Waiting for mavsdk_server to be ready...")
await aiogrpc.channel_ready_future(self._channel)
await self._channel.channel_ready()
logger.debug("Connected to mavsdk_server!")

@property
Expand Down
12 changes: 1 addition & 11 deletions mavsdk/calibration_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/calibration_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import calibration_pb2 as calibration_dot_calibration__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -150,7 +155,6 @@ def add_CalibrationServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.calibration.CalibrationService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.calibration.CalibrationService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
12 changes: 1 addition & 11 deletions mavsdk/camera_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/camera_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import camera_pb2 as camera_dot_camera__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -725,7 +730,6 @@ def add_CameraServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.camera.CameraService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.camera.CameraService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
12 changes: 1 addition & 11 deletions mavsdk/camera_server_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mavsdk/camera_server_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from . import camera_server_pb2 as camera__server_dot_camera__server__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_GENERATED_VERSION = '1.63.0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
Expand All @@ -16,12 +18,15 @@
_version_not_supported = True

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


Expand Down Expand Up @@ -711,7 +716,6 @@ def add_CameraServerServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'mavsdk.rpc.camera_server.CameraServerService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mavsdk.rpc.camera_server.CameraServerService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand Down
Loading

0 comments on commit 49c0cda

Please sign in to comment.