Skip to content

Commit

Permalink
Merge pull request #11157 from OSGeo/backport-11154-to-release/3.10
Browse files Browse the repository at this point in the history
[Backport release/3.10] Python bindings: fix compatibility issue with SWIG 4.3.0 and PYTHONWARNINGS=error
  • Loading branch information
rouault authored Oct 28, 2024
2 parents bafbd5a + 0937fb1 commit 56a2122
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cmake_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ jobs:
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install-gdal/lib
$GITHUB_WORKSPACE/install-gdal/bin/gdalinfo --version
PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 -c "from osgeo import gdal;print(gdal.VersionInfo(None))"
# Test fix for https://github.com/conda-forge/gdal-feedstock/issues/995
PYTHONWARNINGS="error" PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 -c "from osgeo import gdal"
PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 $GITHUB_WORKSPACE/scripts/check_doc.py
- name: CMake with rpath
run: |
Expand Down
4 changes: 4 additions & 0 deletions swig/python/modify_cpp_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ string(REPLACE "if (--interpreter_counter != 0) // another sub-interpreter may s
"/* Even Rouault / GDAL hack for SWIG >= 4.1 related to objects not being freed. See swig/python/modify_cpp_files.cmake for more details */\nif( 1 )"
_CONTENTS "${_CONTENTS}")

# Works around https://github.com/swig/swig/issues/3061
string(REPLACE "# define SWIG_HEAPTYPES" "// Below is disabled because of https://github.com/swig/swig/issues/3061\n// # define SWIG_HEAPTYPES"
_CONTENTS "${_CONTENTS}")

file(WRITE ${FILE} "${_CONTENTS}")

0 comments on commit 56a2122

Please sign in to comment.