ITADN

BUG: Can't build with pre-release versions of GDAL

#648Openp-vdp 创建于 2026-04-24
P
p-vdpcommented
`setup.py` checks that the GDAL version is above the minimum, but the parsing logic doesn't seem to work for the current GDAL versioning scheme. Over the last year we've seen these naming conventions for GDAL pre-releases: - v3.x.xbeta0 - v3.x.xbeta1 - v3.x.xbeta2 - v3.x.xRC1 - v3.x.xRC2 - v3.x.xrc0 - v3.x.x-r1 However, we're only doing `.strip("dev")` before parsing: https://github.com/geopandas/pyogrio/blob/e3eb27f955668975e298f38aa0ba7c37bbae1e4f/setup.py#L156 Here's a minimal example: ```python Python 3.15.0a8 (tags/v3.15.0a8:55ea59e, Apr 23 2026, 18:27:26) [GCC 15.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from osgeo import gdal >>> gdal.__version__ '3.13.0beta2' >>> gdal_version_str = gdal.__version__ >>> gdal_version = tuple(int(i) for i in gdal_version_str.strip("dev").split(".")) Traceback (most recent call last): File "<python-input-3>", line 1, in <module> gdal_version = tuple(int(i) for i in gdal_version_str.strip("dev").split(".")) ^^^^^ File "<python-input-3>", line 1, in <genexpr> gdal_version = tuple(int(i) for i in gdal_version_str.strip("dev").split(".")) ~~~^^^ ValueError: invalid literal for int() with base 10: '0beta2' >>> ```
0 条评论