Repository navigation
Expose the package version as mavsdk.__version__ - #844
Merged
Merged
Conversation
There was no way to get the installed version from Python. `mavsdk.major` and `mavsdk.minor` looked like a version, but they were the Python version, left over from a compatibility check. Add `__version__`, read from the installed distribution's metadata, so it matches `pip show`. It is "unknown" in a source checkout. The bundled mavsdk_server has the same version. Remove the Python >= 3.6 check. setup.py already requires >= 3.9, and the check was what leaked `major` and `minor`. Fixes mavlink#671
julianoes
approved these changes
Dec 1, 2026
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.
There was no way to get the installed version from Python.
mavsdk.majorandmavsdk.minorlook like one, but they are the Python version, left over from the compatibility check in__init__.py.mavsdk.__version__(ormavsdk_grpc.__version__). It's read from the installed distribution's metadata, so it matchespip show. In a source checkout it's"unknown".setup.pyalready requires >= 3.9, and that check is what leakedmajor/minor.The bundled mavsdk_server has the same version (
MAVSDK_SERVER_VERSIONis bumped together with the tag). It has no--versionflag, but it logsMAVSDK version: v4.3.0as its first line on startup.Testing
mavsdk-grpcand legacyMAVSDK_DIST_NAME=mavsdk) and installed them side by side:mavsdk_grpc.__version__andmavsdk.__version__both give4.3.0.post4+g159411e, the same aspip list.mavsdk.majoris gone._dist.py:"unknown".pytest: 5 passed.Fixes #671
@julianoes