py: merge the asyncio wrapper into the mavsdk package - #3007
Draft
julianoes wants to merge 2 commits into
Draft
Conversation
julianoes
marked this pull request as draft
July 22, 2026 10:18
julianoes
force-pushed
the
pr-python-merge-asyncio
branch
2 times, most recently
from
July 23, 2026 01:10
fba91c7 to
870f3cc
Compare
`aiomavsdk` becomes `mavsdk.asyncio`, shipped in the same distribution as the synchronous API rather than as a second one. This is the layout the ecosystem expects when a project owns both interfaces -- redis-py's `redis.asyncio`, `sqlalchemy.ext.asyncio` -- and it means users pick an interface at import time instead of having to pick a package before they understand the difference. The move needed no changes inside the package: everything already imported either relatively or absolutely from `mavsdk.*`, and both keep resolving once the package sits underneath `mavsdk`. `import asyncio` inside `mavsdk/asyncio/` still resolves to the standard library, since Python 3 imports are absolute. Code generation is now one script emitting both flavours, with the templates split into `templates/sync` and `templates/asyncio`. Keeping two scripts that differed only in an output path was an invitation to add a plugin to one and forget the other. The top-level generator loses its separate asyncio pass accordingly. Note that `mavsdk/__init__.py` deliberately does not import the submodule, so `import mavsdk` does not drag in the asyncio machinery.
The asyncio API now ships inside the mavsdk wheel, so there is no second distribution to build.
julianoes
force-pushed
the
pr-python-merge-asyncio
branch
from
July 23, 2026 01:35
870f3cc to
8e266e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
aiomavsdka submodule ofmavsdkrather than a second distribution:pip install mavsdk4→import mavsdkimport mavsdkpip install aiomavsdk→import aiomavsdkimport mavsdk.asyncioOne package, two interfaces. This is what projects owning both interfaces normally do —
redis.asyncio,sqlalchemy.ext.asyncio,pymongo.asynchronous— and it means users choose an interface at import time instead of choosing a package before they understand the difference. Theaio*prefix convention exists mostly for wrappers around someone else's sync library, which is not the case here.Neither distribution has ever been published to PyPI, so nothing external breaks.
Notes for review
No changes were needed inside the package. Everything already imported either relatively or absolutely from
mavsdk.*, and both keep resolving once the package sits underneathmavsdk. The diff is 101 files but almost entirely renames — only the codegen script, the READMEs and two stale docstrings have real content changes.import asyncioinsidemavsdk/asyncio/still gets the standard library, since Python 3 imports are absolute. Verified rather than assumed.mavsdk/__init__.pydeliberately does not import the submodule, soimport mavsdkdoes not drag in the asyncio machinery, and there is no import cycle.Code generation is now one script for both flavours, with templates split into
templates/syncandtemplates/asyncio. The two scripts previously differed only in an output path and a ruff path — an easy way to add a plugin to one and forget the other.Verified
import mavsdkandimport mavsdk.asyncioboth work;mavsdk.asyncio.Mavsdkandmavsdk.asyncio.Systemresolve.mavsdktop-level.mavsdk/compiles.One caveat: I could not exercise the generated plugins at runtime here, because the prebuilt
libcmavsdk.soin my tree predatesAction::set_homeand rebuilding it needs a full libmavsdk rebuild. Bothmavsdk.plugins.actionandmavsdk.asyncio.plugins.actionfail identically on that missing symbol, which shows the move is neutral, but CI building against a current library is the real check.