forked from conda-forge/gdal-feedstock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python bindings: fix compatibility issue with SWIG 4.3.0 and PYTHONWA…
…RNINGS=error Fixes conda-forge#995 Upstream fix in OSGeo/gdal#11154
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
recipe/0001-Python-bindings-fix-compatibility-issue-with-SWIG-43.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 037ab68854a533cd80d71d1b8dd447ff9ab6575f Mon Sep 17 00:00:00 2001 | ||
From: Even Rouault <even.rouault@spatialys.com> | ||
Date: Mon, 28 Oct 2024 19:59:52 +0100 | ||
Subject: [PATCH] Python bindings: fix compatibility issue with SWIG 4.3.0 and | ||
PYTHONWARNINGS=error | ||
|
||
Fixes https://github.com/conda-forge/gdal-feedstock/issues/995 | ||
--- | ||
.github/workflows/cmake_builds.yml | 2 ++ | ||
swig/python/modify_cpp_files.cmake | 4 ++++ | ||
2 files changed, 6 insertions(+) | ||
|
||
diff --git a/.github/workflows/cmake_builds.yml b/.github/workflows/cmake_builds.yml | ||
index 77658bf242..d5ee785b23 100644 | ||
--- a/.github/workflows/cmake_builds.yml | ||
+++ b/.github/workflows/cmake_builds.yml | ||
@@ -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 python -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: | | ||
diff --git a/swig/python/modify_cpp_files.cmake b/swig/python/modify_cpp_files.cmake | ||
index af6668b018..293d7fddd2 100644 | ||
--- a/swig/python/modify_cpp_files.cmake | ||
+++ b/swig/python/modify_cpp_files.cmake | ||
@@ -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}") | ||
|
||
+# Workarounds 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}") | ||
-- | ||
2.25.1 | ||
|
This file contains 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