-
Notifications
You must be signed in to change notification settings - Fork 235
pygmt.show_versions: Report GDAL version by calling the GDAL C function #4104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b873cd4 to
9902f6c
Compare
9902f6c to
b5cfc3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves GDAL version reporting in PyGMT by querying the GDAL version directly from the GDAL C library using ctypes instead of relying on Python package metadata.
- Adds a new
_get_gdal_version()function that uses ctypes to call the GDAL C API'sGDALVersionInfofunction - Updates the dependency information collection to use the new GDAL version function instead of treating GDAL as a regular Python package
- Adds test assertions to verify that GDAL version is properly reported and not returning None
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pygmt/_show_versions.py | Implements new GDAL version detection using ctypes and updates dependency collection logic |
| pygmt/tests/test_show_versions.py | Adds test coverage to verify GDAL version is correctly reported |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
c0584fc to
e548c16
Compare
Co-authored-by: Copilot <[email protected]>
e548c16 to
9f5630a
Compare
Description of proposed changes
Query the GDAL version by calling the GDAL C function
GDALVersionInfo(https://gdal.org/en/stable/api/raster_c_api.html#_CPPv415GDALVersionInfoPKc).Fixes #4102.