Skip to content

Expose the package version as mavsdk.__version__ - #844

Merged
julianoes merged 1 commit into
mavlink:mainfrom
bansiesta:expose-package-version
Dec 1, 2026
Merged

julianoes merged 1 commit into
mavlink:mainfrom
bansiesta:expose-package-version

Conversation

@bansiesta

@bansiesta bansiesta commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

There was no way to get the installed version from Python. mavsdk.major and mavsdk.minor look like one, but they are the Python version, left over from the compatibility check in __init__.py.

  • Add mavsdk.__version__ (or mavsdk_grpc.__version__). It's read from the installed distribution's metadata, so it matches pip show. In a source checkout it's "unknown".
  • Remove the Python >= 3.6 check. setup.py already requires >= 3.9, and that check is what leaked major/minor.

The bundled mavsdk_server has the same version (MAVSDK_SERVER_VERSION is bumped together with the tag). It has no --version flag, but it logs MAVSDK version: v4.3.0 as its first line on startup.

Testing

  • Built both wheels (mavsdk-grpc and legacy MAVSDK_DIST_NAME=mavsdk) and installed them side by side: mavsdk_grpc.__version__ and mavsdk.__version__ both give 4.3.0.post4+g159411e, the same as pip list. mavsdk.major is gone.
  • From a source checkout without _dist.py: "unknown".
  • pytest: 5 passed.

Fixes #671

@julianoes

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
julianoes merged commit 72c846b into mavlink:main Dec 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getting mavsdk version

2 participants