From cf4094465b8c5de2ed7049d9e20e45fcae733531 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 07:36:50 +0200 Subject: [PATCH 01/45] BUILD: quick check if LibKML and LibSpatialite can be included now --- ci/vcpkg.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 34c6f997..9453d710 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -5,7 +5,15 @@ { "name": "gdal", "default-features": false, - "features": ["recommended-features", "curl", "geos", "iconv", "openssl"] + "features": [ + "recommended-features", + "curl", + "geos", + "iconv", + "openssl", + "libspatialite", + "libkml" + ] } ], "builtin-baseline": "66c1c9852bb30bd87285e77cc775072046d51fc6" From 209b07f01b7f3f34e402a66ffbab366794584ed6 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 08:04:33 +0200 Subject: [PATCH 02/45] Remove libpatialite --- ci/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 9453d710..18f4657d 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -11,7 +11,6 @@ "geos", "iconv", "openssl", - "libspatialite", "libkml" ] } From c0493dd7b5ee80c0ee5db51f7f4077f9ef0efb5b Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 09:05:45 +0200 Subject: [PATCH 03/45] Reenable libspatialite + upload freexl logs --- .github/workflows/release.yml | 14 ++++++++++++++ ci/vcpkg.json | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a62dd42..1086d900 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,6 +145,20 @@ jobs: env: BUILDKIT_PROGRESS: plain + - name: Upload vcpkg freexl out logs to Github + uses: actions/upload-artifact@v3 + with: + name: vcpkg out logs + path: /opt/vcpkg/buildtrees/freexl/autoconf-x64-linux-dynamic-release-out.log + retention-days: 10 + + - name: Upload vcpkg freexl err logs to Github + uses: actions/upload-artifact@v3 + with: + name: vcpkg out logs + path: /opt/vcpkg/buildtrees/freexl/autoconf-x64-linux-dynamic-release-err.log + retention-days: 10 + - name: Build wheels uses: pypa/cibuildwheel@v2.23.3 diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 18f4657d..18ec44b9 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -11,7 +11,8 @@ "geos", "iconv", "openssl", - "libkml" + "libkml", + "libspatialite" ] } ], From c5785efcec03fbad2aec6cd2a454d9040d26f375 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 09:11:14 +0200 Subject: [PATCH 04/45] Update release.yml --- .github/workflows/release.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1086d900..6c019c94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,18 +145,11 @@ jobs: env: BUILDKIT_PROGRESS: plain - - name: Upload vcpkg freexl out logs to Github - uses: actions/upload-artifact@v3 - with: - name: vcpkg out logs - path: /opt/vcpkg/buildtrees/freexl/autoconf-x64-linux-dynamic-release-out.log - retention-days: 10 - - - name: Upload vcpkg freexl err logs to Github - uses: actions/upload-artifact@v3 + - name: Upload vcpkg freexl build logs to Github + uses: actions/upload-artifact@v4 with: - name: vcpkg out logs - path: /opt/vcpkg/buildtrees/freexl/autoconf-x64-linux-dynamic-release-err.log + name: vcpkg freexl build logs + path: /opt/vcpkg/buildtrees/freexl/*.log retention-days: 10 - name: Build wheels From e8710d90a22a6fbf13b9dec578e58d0df67b210a Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 09:26:26 +0200 Subject: [PATCH 05/45] Update release.yml --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c019c94..29da93c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,11 +145,12 @@ jobs: env: BUILDKIT_PROGRESS: plain - - name: Upload vcpkg freexl build logs to Github + - name: Upload vcpkg build logs + if: ${{ failure() }} uses: actions/upload-artifact@v4 with: - name: vcpkg freexl build logs - path: /opt/vcpkg/buildtrees/freexl/*.log + name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} + path: /opt/vcpkg/buildtrees/**/*.log" retention-days: 10 - name: Build wheels From fd45a4b01674dcf87c6600952fecd7bec8296ea8 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 15:47:18 +0200 Subject: [PATCH 06/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29da93c5..4e8b7e94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: /opt/vcpkg/buildtrees/**/*.log" + path: /opt/vcpkg/buildtrees/**/*.log retention-days: 10 - name: Build wheels From b3b7cc86658f67e52658f1fbd59ff92deddab4c7 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 16:03:30 +0200 Subject: [PATCH 07/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e8b7e94..1435b8db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: /opt/vcpkg/buildtrees/**/*.log + path: "/opt/vcpkg/buildtrees/**/*.log" retention-days: 10 - name: Build wheels From c737f165f5c0cca8ccd6de2b0b6637587b7709c6 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 16:12:04 +0200 Subject: [PATCH 08/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1435b8db..11c43d38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "/opt/vcpkg/buildtrees/**/*.log" + path: "opt/vcpkg/buildtrees/**/*.log" retention-days: 10 - name: Build wheels From 5a8241e27404557b660df8d999b1b93cbb2aacff Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 16:20:01 +0200 Subject: [PATCH 09/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11c43d38..b519492e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "opt/vcpkg/buildtrees/**/*.log" + path: "/opt/vcpkg/buildtrees/freexl/*.log" retention-days: 10 - name: Build wheels From e4b40b549e1183f051f4b7322ff8b4b5e145d218 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 16:31:04 +0200 Subject: [PATCH 10/45] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b519492e..38bff06c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "/opt/vcpkg/buildtrees/freexl/*.log" + path: "opt/vcpkg/buildtrees/freexl/*.log" retention-days: 10 - name: Build wheels @@ -181,7 +181,7 @@ jobs: vcpkg_cache: "/Users/runner/.cache/vcpkg/archives" vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log" - - os: "windows-2019" + - os: "windows-latest" triplet: "x64-windows-dynamic-release" arch: AMD64 # windows requires windows-specific paths From 2810747df4e4f5e18e18a9b5539c3c79b3a9dffa Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 17:16:08 +0200 Subject: [PATCH 11/45] Update release.yml --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38bff06c..d66353e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,6 +145,19 @@ jobs: env: BUILDKIT_PROGRESS: plain + - name: Dump docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + with: + dest: './logs' + + - name: Upload logs to GitHub + if: failure() + uses: actions/upload-artifact@v4 + with: + name: Docker logs + path: ./logs/*.* + - name: Upload vcpkg build logs if: ${{ failure() }} uses: actions/upload-artifact@v4 From 51467c47a67907040ab12608044bcf47c605ed0d Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 17:23:33 +0200 Subject: [PATCH 12/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d66353e1..4f478f7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -155,7 +155,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: Docker logs + name: dumped-docker-logs path: ./logs/*.* - name: Upload vcpkg build logs From 5d0207c2df8d850f3a425e3c7926fd31cd1eeadb Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 18:09:16 +0200 Subject: [PATCH 13/45] Update release.yml --- .github/workflows/release.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f478f7b..b9fba4a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,25 +145,12 @@ jobs: env: BUILDKIT_PROGRESS: plain - - name: Dump docker logs on failure - if: failure() - uses: jwalton/gh-docker-logs@v2 - with: - dest: './logs' - - - name: Upload logs to GitHub - if: failure() - uses: actions/upload-artifact@v4 - with: - name: dumped-docker-logs - path: ./logs/*.* - - name: Upload vcpkg build logs if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "opt/vcpkg/buildtrees/freexl/*.log" + path: "opt/vcpkg/**/*autoconf*.log" retention-days: 10 - name: Build wheels From eda2b855bb30aa962d9a7fc876c2bf9dd7b49078 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 18:09:27 +0200 Subject: [PATCH 14/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9fba4a9..1beb5420 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,7 +150,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "opt/vcpkg/**/*autoconf*.log" + path: "/opt/vcpkg/**/*autoconf*.log" retention-days: 10 - name: Build wheels From c089e1701859a8dd5bf36ef651bdeedc6355aa1c Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 21:26:32 +0200 Subject: [PATCH 15/45] Try changing vcpkg work dir --- .github/workflows/release.yml | 5 ++++- ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile | 18 +++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1beb5420..1af9eb03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,17 +106,20 @@ jobs: container: "ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile" os: ubuntu-latest arch: x86_64 + vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log" # use manylinux_2_28 for any platforms with glibc>=2.28 - wheel_name: "pyogrio-wheel-linux-manylinux_2_28_x86_64" container: "ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile" os: ubuntu-latest arch: x86_64 + vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log" - wheel_name: "pyogrio-wheel-linux-manylinux_2_28_aarch64" container: "ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile" os: ubuntu-24.04-arm arch: aarch64 + vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log" steps: - name: Checkout @@ -150,7 +153,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: "/opt/vcpkg/**/*autoconf*.log" + path: ${{ matrix.vcpkg_logs }} retention-days: 10 - name: Build wheels diff --git a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile index 9966903c..29e8d278 100644 --- a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile @@ -3,11 +3,11 @@ FROM quay.io/pypa/manylinux_2_28_x86_64:2025-01-11-3165879 # building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988) RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd -RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ - git -C /opt/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 +RUN git clone https://github.com/Microsoft/vcpkg.git /usr/local/share/vcpkg && \ + git -C /usr/local/share/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 -ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" -ENV PATH="${PATH}:/opt/vcpkg" +ENV VCPKG_INSTALLATION_ROOT="/usr/local/share/vcpkg" +ENV PATH="${PATH}:/usr/local/share/vcpkg" ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic-release" @@ -18,14 +18,14 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate install && \ vcpkg integrate bash -COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake -COPY ci/vcpkg.json opt/vcpkg/ +COPY ci/custom-triplets/x64-linux-dynamic-release.cmake /usr/local/share/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake +COPY ci/vcpkg.json /usr/local/share/vcpkg/ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" -RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ +RUN vcpkg install --overlay-triplets=/usr/local/share/vcpkg/custom-triplets \ --feature-flags="versions,manifests" \ - --x-manifest-root=opt/vcpkg \ - --x-install-root=opt/vcpkg/installed && \ + --x-manifest-root=/usr/local/share/vcpkg \ + --x-install-root=/usr/local/share/vcpkg/installed && \ vcpkg list # setting git safe directory is required for properly building wheels when From 6256bc3955935724dba605d3e1d25fff0c4b798e Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 21:52:33 +0200 Subject: [PATCH 16/45] Try to exclude freexl from the libspatialite dependencies --- ci/vcpkg.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 18ec44b9..e5865c70 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -12,7 +12,10 @@ "iconv", "openssl", "libkml", - "libspatialite" + { + "name": "libspatialite", + "default-features": false + } ] } ], From f7ba77fb418bcd298c4ec1097198cede0327d9a1 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 22:16:04 +0200 Subject: [PATCH 17/45] Update vcpkg.json --- ci/vcpkg.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index e5865c70..a8f89a8e 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -12,11 +12,12 @@ "iconv", "openssl", "libkml", - { - "name": "libspatialite", - "default-features": false - } + "libspatialite" ] + }, + { + "name": "libspatialite", + "default-features": false } ], "builtin-baseline": "66c1c9852bb30bd87285e77cc775072046d51fc6" From 0e8f7cb647c8c8a1a021dc130e18375020c2ba86 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 22:22:26 +0200 Subject: [PATCH 18/45] Update vcpkg.json --- ci/vcpkg.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index a8f89a8e..b3be4cf6 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -11,8 +11,7 @@ "geos", "iconv", "openssl", - "libkml", - "libspatialite" + "libkml" ] }, { From b178acd3b71429661da35d08d4e891ed92498f92 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 22:50:11 +0200 Subject: [PATCH 19/45] Update vcpkg.json --- ci/vcpkg.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index b3be4cf6..67a5fc2a 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -2,6 +2,10 @@ "name": "pyogrio", "version": "0.11.0", "dependencies": [ + { + "name": "libspatialite", + "default-features": false + }, { "name": "gdal", "default-features": false, @@ -11,12 +15,9 @@ "geos", "iconv", "openssl", - "libkml" + "libkml", + "libspatialite" ] - }, - { - "name": "libspatialite", - "default-features": false } ], "builtin-baseline": "66c1c9852bb30bd87285e77cc775072046d51fc6" From a606a62dad5519993e7e073d242ae110a5bb9ebc Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sat, 5 Jul 2025 22:58:04 +0200 Subject: [PATCH 20/45] Update vcpkg.json --- ci/vcpkg.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 67a5fc2a..630890ff 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -15,8 +15,7 @@ "geos", "iconv", "openssl", - "libkml", - "libspatialite" + "libkml" ] } ], From 28537ddad609e72a04746b24e4b4cb67a7757c00 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 6 Jul 2025 02:55:38 +0200 Subject: [PATCH 21/45] Add rttopo feature to spatialite --- ci/vcpkg.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 630890ff..4b0a9702 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -4,7 +4,10 @@ "dependencies": [ { "name": "libspatialite", - "default-features": false + "default-features": false, + "features": [ + "rttopo" + ] }, { "name": "gdal", From 39e962d127e33c4107f473879f199d93246a4c11 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 6 Jul 2025 21:03:34 +0200 Subject: [PATCH 22/45] Move the vcpkg also to usr for the other containers --- ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 24 +++++++++---------- ...nylinux_2_28_aarch64-vcpkg-gdal.Dockerfile | 20 ++++++++-------- ...anylinux_2_28_x86_64-vcpkg-gdal.Dockerfile | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index 0df57ceb..d993a59f 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -6,11 +6,11 @@ RUN yum install -y curl unzip zip tar perl-IPC-Cmd # require python >= 3.7 (python 3.6 is default on base image) for meson RUN ln -s /opt/python/cp38-cp38/bin/python3 /usr/bin/python3 -RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ - git -C /opt/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 +RUN git clone https://github.com/Microsoft/vcpkg.git /usr/local/share/vcpkg && \ + git -C /usr/local/share/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 -ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" -ENV PATH="${PATH}:/opt/vcpkg" +ENV VCPKG_INSTALLATION_ROOT="/usr/local/share/vcpkg" +ENV PATH="${PATH}:/usr/local/share/vcpkg" ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic-release" @@ -21,16 +21,16 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate install && \ vcpkg integrate bash -COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake -COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ -COPY ci/vcpkg.json opt/vcpkg/ +COPY ci/custom-triplets/x64-linux-dynamic-release.cmake /usr/local/share/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake +COPY ci/vcpkg-custom-ports/ /usr/local/share/vcpkg/custom-ports/ +COPY ci/vcpkg.json /usr/local/share/vcpkg/ -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" -RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ - --overlay-ports=opt/vcpkg/custom-ports \ +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/share/vcpkg/installed/x64-linux-dynamic-release/lib" +RUN vcpkg install --overlay-triplets=/usr/local/share/vcpkg/custom-triplets \ + --overlay-ports=/usr/local/share/vcpkg/custom-ports \ --feature-flags="versions,manifests" \ - --x-manifest-root=opt/vcpkg \ - --x-install-root=opt/vcpkg/installed && \ + --x-manifest-root=/usr/local/share/vcpkg \ + --x-install-root=/usr/local/share/vcpkg/installed && \ vcpkg list # setting git safe directory is required for properly building wheels when diff --git a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile index 28a65011..616fd0ca 100644 --- a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile @@ -3,11 +3,11 @@ FROM quay.io/pypa/manylinux_2_28_aarch64:2025-01-11-3165879 # building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988) RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd -RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ - git -C /opt/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 +RUN git clone https://github.com/Microsoft/vcpkg.git /usr/local/share/vcpkg && \ + git -C /usr/local/share/vcpkg checkout 66c1c9852bb30bd87285e77cc775072046d51fc6 -ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" -ENV PATH="${PATH}:/opt/vcpkg" +ENV VCPKG_INSTALLATION_ROOT="/usr/local/share/vcpkg" +ENV PATH="${PATH}:/usr/local/share/vcpkg" ENV VCPKG_DEFAULT_TRIPLET="arm64-linux-dynamic-release" # pkgconf fails to build with default debug mode of arm64-linux host @@ -23,14 +23,14 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate install && \ vcpkg integrate bash -COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/arm64-linux-dynamic-release.cmake -COPY ci/vcpkg.json opt/vcpkg/ +COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake /usr/local/share/vcpkg/custom-triplets/arm64-linux-dynamic-release.cmake +COPY ci/vcpkg.json /usr/local/share/vcpkg/ -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/arm64-linux-dynamic-release/lib" -RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/share/vcpkg/installed/arm64-linux-dynamic-release/lib" +RUN vcpkg install --overlay-triplets=/usr/local/share/vcpkg/custom-triplets \ --feature-flags="versions,manifests" \ - --x-manifest-root=opt/vcpkg \ - --x-install-root=opt/vcpkg/installed && \ + --x-manifest-root=/usr/local/share/vcpkg/ \ + --x-install-root=/usr/local/share/vcpkg/installed && \ vcpkg list # setting git safe directory is required for properly building wheels when diff --git a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile index 29e8d278..c37e2188 100644 --- a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile @@ -21,7 +21,7 @@ RUN bootstrap-vcpkg.sh && \ COPY ci/custom-triplets/x64-linux-dynamic-release.cmake /usr/local/share/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg.json /usr/local/share/vcpkg/ -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/share/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=/usr/local/share/vcpkg/custom-triplets \ --feature-flags="versions,manifests" \ --x-manifest-root=/usr/local/share/vcpkg \ From ef76dd63b2964916c3937b97016a54e0358017e6 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 6 Jul 2025 22:35:58 +0200 Subject: [PATCH 23/45] Try to docker copy log files first --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1af9eb03..c2492075 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,12 +148,17 @@ jobs: env: BUILDKIT_PROGRESS: plain + - name: Copy log files from Docker container + if: ${{ failure() }} + run: | + docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal:latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log" ~ + - name: Upload vcpkg build logs if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: pyogrio-vcpkg-logs-${{ matrix.wheel_name }} - path: ${{ matrix.vcpkg_logs }} + path: ~/*.log retention-days: 10 - name: Build wheels From 6503bec8b4c193b1d67eb6ac11fdecb9fff6eda6 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 6 Jul 2025 22:57:43 +0200 Subject: [PATCH 24/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2492075..bd9d340a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,7 +151,7 @@ jobs: - name: Copy log files from Docker container if: ${{ failure() }} run: | - docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal:latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log" ~ + docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal:latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log ~/ - name: Upload vcpkg build logs if: ${{ failure() }} From 521d4b6720ecf6159f1b521da9d79ed970436564 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Mon, 7 Jul 2025 05:27:40 +0200 Subject: [PATCH 25/45] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd9d340a..efe7fbae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,7 +140,7 @@ jobs: with: context: . file: ${{ matrix.container }} - tags: manylinux-${{ matrix.arch }}-vcpkg-gdal:latest + tags: manylinux-${{ matrix.arch }}-vcpkg-gdal-latest push: false load: true cache-from: type=gha @@ -151,7 +151,7 @@ jobs: - name: Copy log files from Docker container if: ${{ failure() }} run: | - docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal:latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log ~/ + docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal-latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log ~/ - name: Upload vcpkg build logs if: ${{ failure() }} From 0c6d151568a64faaa5d1ff1a123fd1cbbecf3da3 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Wed, 16 Jul 2025 22:46:04 +0200 Subject: [PATCH 26/45] Update release.yml --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efe7fbae..f33acba5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,10 +148,14 @@ jobs: env: BUILDKIT_PROGRESS: plain - - name: Copy log files from Docker container + - name: Upload artifacts if: ${{ failure() }} - run: | - docker cp manylinux-${{ matrix.arch }}-vcpkg-gdal-latest:/usr/local/share/vcpkg/buildtrees/libspatialite/*.log ~/ + uses: actions/upload-artifact@v4 + with: + pattern: !*.dockerbuild + + - name: Display structure of downloaded files + run: ls -R - name: Upload vcpkg build logs if: ${{ failure() }} From e6be838b419e89b48241a79709442d6d98288e9f Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Wed, 16 Jul 2025 22:50:52 +0200 Subject: [PATCH 27/45] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f33acba5..042daeb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -152,7 +152,7 @@ jobs: if: ${{ failure() }} uses: actions/upload-artifact@v4 with: - pattern: !*.dockerbuild + pattern: "!*.dockerbuild" - name: Display structure of downloaded files run: ls -R From db8b8af9cd99bb768de20130ae2dfb68d91079bf Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 20:40:49 +0200 Subject: [PATCH 28/45] BUILD: add libkml to builds for recent platforms --- ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 2 +- ci/vcpkg.json | 4 +++- ci/vcpkg2014.json | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 ci/vcpkg2014.json diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index 0df57ceb..54501e6d 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -23,7 +23,7 @@ RUN bootstrap-vcpkg.sh && \ COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ -COPY ci/vcpkg.json opt/vcpkg/ +COPY ci/vcpkg2014.json opt/vcpkg/ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 34c6f997..093b1e3a 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -5,7 +5,9 @@ { "name": "gdal", "default-features": false, - "features": ["recommended-features", "curl", "geos", "iconv", "openssl"] + "features": [ + "recommended-features", "curl", "geos", "iconv", "libkml", "openssl" + ] } ], "builtin-baseline": "66c1c9852bb30bd87285e77cc775072046d51fc6" diff --git a/ci/vcpkg2014.json b/ci/vcpkg2014.json new file mode 100644 index 00000000..34c6f997 --- /dev/null +++ b/ci/vcpkg2014.json @@ -0,0 +1,12 @@ +{ + "name": "pyogrio", + "version": "0.11.0", + "dependencies": [ + { + "name": "gdal", + "default-features": false, + "features": ["recommended-features", "curl", "geos", "iconv", "openssl"] + } + ], + "builtin-baseline": "66c1c9852bb30bd87285e77cc775072046d51fc6" +} From 7ca8da6aaf13b993eeaa657d932012bc47e2ab4d Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 20:44:45 +0200 Subject: [PATCH 29/45] Update manylinux2014_x86_64-vcpkg-gdal.Dockerfile --- ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index 54501e6d..3310b9ba 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -23,7 +23,7 @@ RUN bootstrap-vcpkg.sh && \ COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ -COPY ci/vcpkg2014.json opt/vcpkg/ +COPY ci/vcpkg2014.json opt/vcpkg/vcpkg.json ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ From 5bff9528010636681455673b60f88f59d0cff775 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 21:22:11 +0200 Subject: [PATCH 30/45] Add test that is skipped if LibKML is not available --- pyogrio/tests/test_geopandas_io.py | 53 +++++++++++++++++++----------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 34b7b4e8..118c161c 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -2479,27 +2479,42 @@ def test_write_kml_file_coordinate_order(tmp_path, use_arrow): assert np.array_equal(gdf_in.geometry.values, points) - if "LIBKML" in list_drivers(): - # test appending to the existing file only if LIBKML is available - # as it appears to fall back on LIBKML driver when appending. - points_append = [Point(7, 8), Point(9, 10), Point(11, 12)] - gdf_append = gp.GeoDataFrame(geometry=points_append, crs="EPSG:4326") - write_dataframe( - gdf_append, - output_path, - layer="tmp_layer", - driver="KML", - use_arrow=use_arrow, - append=True, - ) - # force_2d used to only compare xy geometry as z-dimension is undesirably - # introduced when the kml file is over-written. - gdf_in_appended = read_dataframe( - output_path, use_arrow=use_arrow, force_2d=True - ) +@pytest.mark.requires_arrow_write_api +@pytest.mark.skipif( + "LIBKML" not in list_drivers(), + reason="append only supported if LIBKML driver is available", +) +def test_write_kml_append(tmp_path, use_arrow): + """Append features to an existing KML file. - assert np.array_equal(gdf_in_appended.geometry.values, points + points_append) + Apparently this is only supported by the LIBKML driver. + """ + points = [Point(10, 20), Point(30, 40), Point(50, 60)] + gdf = gp.GeoDataFrame(geometry=points, crs="EPSG:4326") + output_path = tmp_path / "test.kml" + write_dataframe( + gdf, output_path, layer="tmp_layer", driver="KML", use_arrow=use_arrow + ) + + # test appending to the existing file only if LIBKML is available + # as it appears to fall back on LIBKML driver when appending. + points_append = [Point(7, 8), Point(9, 10), Point(11, 12)] + gdf_append = gp.GeoDataFrame(geometry=points_append, crs="EPSG:4326") + + write_dataframe( + gdf_append, + output_path, + layer="tmp_layer", + driver="KML", + use_arrow=use_arrow, + append=True, + ) + # force_2d used to only compare xy geometry as z-dimension is undesirably + # introduced when the kml file is over-written. + gdf_in_appended = read_dataframe(output_path, use_arrow=use_arrow, force_2d=True) + + assert np.array_equal(gdf_in_appended.geometry.values, points + points_append) @pytest.mark.requires_arrow_write_api From 161fb187961eab39ba8eb60f268d15cf24b02a8e Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 21:23:47 +0200 Subject: [PATCH 31/45] Update CHANGES.md --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 405ba8c6..34dd480b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # CHANGELOG +## 0.12.0 (xxxx-xx-xx) + +### Packaging + +- Add libkml driver to the wheels for recent platforms (#561). + ## 0.11.1 (2025-08-02) ### Bug fixes From c25b00cf39d84f7577c5eeb95a4f15054f7fb7b1 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 22:09:47 +0200 Subject: [PATCH 32/45] Remove skip on libkml present as all tests seem to have libkml --- pyogrio/tests/test_geopandas_io.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 118c161c..36aba717 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -2481,10 +2481,6 @@ def test_write_kml_file_coordinate_order(tmp_path, use_arrow): @pytest.mark.requires_arrow_write_api -@pytest.mark.skipif( - "LIBKML" not in list_drivers(), - reason="append only supported if LIBKML driver is available", -) def test_write_kml_append(tmp_path, use_arrow): """Append features to an existing KML file. From f6b82ad2d91f659d51cd9cc4ee04dc5c5d56956d Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 22:54:39 +0200 Subject: [PATCH 33/45] Add skip again as the ubuntu-small images don't have libkml --- pyogrio/tests/test_geopandas_io.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 36aba717..26b2b7e6 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -2481,10 +2481,15 @@ def test_write_kml_file_coordinate_order(tmp_path, use_arrow): @pytest.mark.requires_arrow_write_api +@pytest.mark.skipif( + "LIBKML" not in list_drivers(), + reason="LIBKML driver is not available and is needed to append to .kml", +) def test_write_kml_append(tmp_path, use_arrow): """Append features to an existing KML file. - Apparently this is only supported by the LIBKML driver. + Appending is only supported by the LIBKML driver, and the driver isn't + included in the GDAL ubuntu-small images, so skip if not available. """ points = [Point(10, 20), Point(30, 40), Point(50, 60)] gdf = gp.GeoDataFrame(geometry=points, crs="EPSG:4326") From cea81692df2c4ef4233508114b194173711e3b36 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 23:52:35 +0200 Subject: [PATCH 34/45] Add test reading a kml simpledata element --- pyogrio/tests/test_geopandas_io.py | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 26b2b7e6..c0bb160d 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -275,6 +275,40 @@ def test_read_geojson_error(naturalearth_lowres_geojson, use_arrow): set_gdal_config_options({"OGR_GEOJSON_MAX_OBJ_SIZE": None}) +def test_read_kml_simpledate(tmp_path): + """Test reading a KML file with a simpledata element. + + Simpledata elements are only read by the LibKML driver, not the KML driver. + """ + kml_data = """ + + + + + + + interfaces1 + + + Ton + + 19.1501280458077,293.313485355882 + + + + + """ + kml_path = tmp_path / "test.kml" + with open(kml_path, "w", encoding="utf-8") as f: + f.write(kml_data) + + gdf = read_dataframe(kml_path) + + # Check if the simpledata column is present. + assert "formation" in gdf.columns + assert gdf["formation"].iloc[0] == "Ton" + + def test_read_layer(tmp_path, use_arrow): filename = tmp_path / "test.gpkg" From e740a4dffaefecac9155c1cb86c63c5e9419bcc5 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 23:54:35 +0200 Subject: [PATCH 35/45] Update test_geopandas_io.py --- pyogrio/tests/test_geopandas_io.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index c0bb160d..38e87e78 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -280,6 +280,8 @@ def test_read_kml_simpledate(tmp_path): Simpledata elements are only read by the LibKML driver, not the KML driver. """ + # Reading kml_data from memory doesn't seem to work as it isn't detected as + # a KML file by GDAL, so we write it to a file first. kml_data = """ From 37c8c0bd16355e16af9a5933fdfde9726820bfb9 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 23:56:25 +0200 Subject: [PATCH 36/45] Add skip if libkml is not available --- pyogrio/tests/test_geopandas_io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 38e87e78..0e230e05 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -275,7 +275,11 @@ def test_read_geojson_error(naturalearth_lowres_geojson, use_arrow): set_gdal_config_options({"OGR_GEOJSON_MAX_OBJ_SIZE": None}) -def test_read_kml_simpledate(tmp_path): +@pytest.mark.skipif( + "LIBKML" not in list_drivers(), + reason="LIBKML driver is not available and is needed to read simpledata", +) +def test_read_kml_simpledata(tmp_path): """Test reading a KML file with a simpledata element. Simpledata elements are only read by the LibKML driver, not the KML driver. From d074d1a85e9bceac76f6fa1a1a40b96743160fb3 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Sun, 10 Aug 2025 23:59:11 +0200 Subject: [PATCH 37/45] Test arrow as well --- pyogrio/tests/test_geopandas_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 0e230e05..741e3456 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -279,7 +279,7 @@ def test_read_geojson_error(naturalearth_lowres_geojson, use_arrow): "LIBKML" not in list_drivers(), reason="LIBKML driver is not available and is needed to read simpledata", ) -def test_read_kml_simpledata(tmp_path): +def test_read_kml_simpledata(tmp_path, use_arrow): """Test reading a KML file with a simpledata element. Simpledata elements are only read by the LibKML driver, not the KML driver. @@ -308,7 +308,7 @@ def test_read_kml_simpledata(tmp_path): with open(kml_path, "w", encoding="utf-8") as f: f.write(kml_data) - gdf = read_dataframe(kml_path) + gdf = read_dataframe(kml_path, use_arrow=use_arrow) # Check if the simpledata column is present. assert "formation" in gdf.columns From 3d058024aabb9959348a9f51640c67646049a874 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Mon, 11 Aug 2025 00:38:22 +0200 Subject: [PATCH 38/45] Move kml test file to conftest.py --- pyogrio/tests/conftest.py | 28 ++++++++++++++++++++++++++++ pyogrio/tests/test_geopandas_io.py | 28 ++-------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/pyogrio/tests/conftest.py b/pyogrio/tests/conftest.py index 63df12c3..acb8d45e 100644 --- a/pyogrio/tests/conftest.py +++ b/pyogrio/tests/conftest.py @@ -355,6 +355,34 @@ def geojson_filelike(tmp_path): yield f +@pytest.fixture(scope="function") +def kml_file(tmp_path): + # create KML file + kml_data = """ + + + + + + + interfaces1 + + + Ton + + 19.1501280458077,293.313485355882 + + + + + """ + filename = tmp_path / "test.kml" + with open(filename, "w") as f: + _ = f.write(kml_data) + + return filename + + @pytest.fixture(scope="function") def nonseekable_bytes(tmp_path): # mock a non-seekable byte stream, such as a zstandard handle diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 741e3456..99f4fa3f 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -279,36 +279,12 @@ def test_read_geojson_error(naturalearth_lowres_geojson, use_arrow): "LIBKML" not in list_drivers(), reason="LIBKML driver is not available and is needed to read simpledata", ) -def test_read_kml_simpledata(tmp_path, use_arrow): +def test_read_kml_simpledata(kml_file, use_arrow): """Test reading a KML file with a simpledata element. Simpledata elements are only read by the LibKML driver, not the KML driver. """ - # Reading kml_data from memory doesn't seem to work as it isn't detected as - # a KML file by GDAL, so we write it to a file first. - kml_data = """ - - - - - - - interfaces1 - - - Ton - - 19.1501280458077,293.313485355882 - - - - - """ - kml_path = tmp_path / "test.kml" - with open(kml_path, "w", encoding="utf-8") as f: - f.write(kml_data) - - gdf = read_dataframe(kml_path, use_arrow=use_arrow) + gdf = read_dataframe(kml_file, use_arrow=use_arrow) # Check if the simpledata column is present. assert "formation" in gdf.columns From 84c6fb2c77b893f59610a70bbdfce5a69515fcdf Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 28 Aug 2025 19:42:08 +0200 Subject: [PATCH 39/45] Update release.yml --- .github/workflows/release.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 042daeb4..88106953 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,12 +148,6 @@ jobs: env: BUILDKIT_PROGRESS: plain - - name: Upload artifacts - if: ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - pattern: "!*.dockerbuild" - - name: Display structure of downloaded files run: ls -R From f4429e2303245a5bd1d8fb246aa7f7f9f8cc6946 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 02:57:06 +0200 Subject: [PATCH 40/45] Apply suggestions --- CHANGES.md | 3 ++- ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 2 +- ci/{vcpkg2014.json => vcpkg-manylinux2014.json} | 2 +- pyogrio/tests/test_geopandas_io.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename ci/{vcpkg2014.json => vcpkg-manylinux2014.json} (92%) diff --git a/CHANGES.md b/CHANGES.md index 34dd480b..09771df5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,8 @@ ### Packaging -- Add libkml driver to the wheels for recent platforms (#561). +- Add libkml driver to the wheels for more recent Linux platforms supported + by manylinux_2_28, MacOS, and Windows (#561). ## 0.11.1 (2025-08-02) diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index 3310b9ba..b05e6898 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -23,7 +23,7 @@ RUN bootstrap-vcpkg.sh && \ COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ -COPY ci/vcpkg2014.json opt/vcpkg/vcpkg.json +COPY ci/vcpkg-manylinux2014.json opt/vcpkg/vcpkg.json ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ diff --git a/ci/vcpkg2014.json b/ci/vcpkg-manylinux2014.json similarity index 92% rename from ci/vcpkg2014.json rename to ci/vcpkg-manylinux2014.json index 34c6f997..78257c9e 100644 --- a/ci/vcpkg2014.json +++ b/ci/vcpkg-manylinux2014.json @@ -1,6 +1,6 @@ { "name": "pyogrio", - "version": "0.11.0", + "version": "0.12.0", "dependencies": [ { "name": "gdal", diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 99f4fa3f..91612860 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -277,7 +277,7 @@ def test_read_geojson_error(naturalearth_lowres_geojson, use_arrow): @pytest.mark.skipif( "LIBKML" not in list_drivers(), - reason="LIBKML driver is not available and is needed to read simpledata", + reason="LIBKML driver is not available and is needed to read simpledata element", ) def test_read_kml_simpledata(kml_file, use_arrow): """Test reading a KML file with a simpledata element. From 76a57c95a3b89a2ff6ba6b264b4d54937005431c Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 03:09:34 +0200 Subject: [PATCH 41/45] Clarify that the z-dimension is being added by the LIBKML driver --- pyogrio/tests/test_geopandas_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 91612860..e427cc16 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -2527,8 +2527,8 @@ def test_write_kml_append(tmp_path, use_arrow): use_arrow=use_arrow, append=True, ) - # force_2d used to only compare xy geometry as z-dimension is undesirably - # introduced when the kml file is over-written. + # force_2d is used to only compare the xy dimensions of the geometry, as the LIBKML + # driver always adds the z-dimension when the kml file is over-written. gdf_in_appended = read_dataframe(output_path, use_arrow=use_arrow, force_2d=True) assert np.array_equal(gdf_in_appended.geometry.values, points + points_append) From a9145ffc18973b707a2907357b1f06eee14ab454 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 05:09:46 +0200 Subject: [PATCH 42/45] Use intmax_t for signed long long --- pyogrio/_io.pyx | 4 ++-- pyogrio/_ogr.pxd | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyogrio/_io.pyx b/pyogrio/_io.pyx index c3cd2373..370799d5 100644 --- a/pyogrio/_io.pyx +++ b/pyogrio/_io.pyx @@ -13,7 +13,7 @@ import sys import warnings from pathlib import Path -from libc.stdint cimport uint8_t, uintptr_t +from libc.stdint cimport intmax_t, uint8_t, uintptr_t from libc.stdlib cimport malloc, free from libc.string cimport strlen from libc.math cimport isnan @@ -886,7 +886,7 @@ cdef process_fields( cdef int field_index cdef int ret_length cdef int *ints_c - cdef int64_t *int64s_c + cdef intmax_t *int64s_c cdef double *doubles_c cdef char **strings_c cdef GByte *bin_value diff --git a/pyogrio/_ogr.pxd b/pyogrio/_ogr.pxd index 78b66b96..bb8409d2 100644 --- a/pyogrio/_ogr.pxd +++ b/pyogrio/_ogr.pxd @@ -1,5 +1,5 @@ # Contains declarations against GDAL / OGR API -from libc.stdint cimport int64_t, int8_t +from libc.stdint cimport int64_t, int8_t, intmax_t from libc.stdio cimport FILE @@ -284,11 +284,11 @@ cdef extern from "ogr_api.h": int64_t OGR_F_GetFieldAsInteger64(OGRFeatureH feature, int n) const char* OGR_F_GetFieldAsString(OGRFeatureH feature, int n) char ** OGR_F_GetFieldAsStringList(OGRFeatureH feature, int n) - int * OGR_F_GetFieldAsIntegerList( + const int * OGR_F_GetFieldAsIntegerList( OGRFeatureH feature, int n, int* pnCount) - int64_t * OGR_F_GetFieldAsInteger64List( + const intmax_t *OGR_F_GetFieldAsInteger64List( OGRFeatureH feature, int n, int* pnCount) - double * OGR_F_GetFieldAsDoubleList( + const double * OGR_F_GetFieldAsDoubleList( OGRFeatureH feature, int n, int* pnCount) int OGR_F_IsFieldSetAndNotNull(OGRFeatureH feature, int n) From 03c1b1a980681b36b9f2520901d8401f90a99942 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 05:30:23 +0200 Subject: [PATCH 43/45] Use GIntBig instead of intmax_t --- pyogrio/_io.pyx | 4 ++-- pyogrio/_ogr.pxd | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyogrio/_io.pyx b/pyogrio/_io.pyx index 370799d5..f75e1a79 100644 --- a/pyogrio/_io.pyx +++ b/pyogrio/_io.pyx @@ -13,7 +13,7 @@ import sys import warnings from pathlib import Path -from libc.stdint cimport intmax_t, uint8_t, uintptr_t +from libc.stdint cimport uint8_t, uintptr_t from libc.stdlib cimport malloc, free from libc.string cimport strlen from libc.math cimport isnan @@ -886,7 +886,7 @@ cdef process_fields( cdef int field_index cdef int ret_length cdef int *ints_c - cdef intmax_t *int64s_c + cdef GIntBig *int64s_c cdef double *doubles_c cdef char **strings_c cdef GByte *bin_value diff --git a/pyogrio/_ogr.pxd b/pyogrio/_ogr.pxd index bb8409d2..d34f8796 100644 --- a/pyogrio/_ogr.pxd +++ b/pyogrio/_ogr.pxd @@ -1,5 +1,5 @@ # Contains declarations against GDAL / OGR API -from libc.stdint cimport int64_t, int8_t, intmax_t +from libc.stdint cimport int64_t, int8_t from libc.stdio cimport FILE @@ -256,6 +256,7 @@ cdef extern from "arrow_bridge.h" nogil: cdef extern from "ogr_api.h": + ctypedef signed long long GIntBig int OGRGetDriverCount() OGRSFDriverH OGRGetDriver(int) @@ -286,7 +287,7 @@ cdef extern from "ogr_api.h": char ** OGR_F_GetFieldAsStringList(OGRFeatureH feature, int n) const int * OGR_F_GetFieldAsIntegerList( OGRFeatureH feature, int n, int* pnCount) - const intmax_t *OGR_F_GetFieldAsInteger64List( + const GIntBig * OGR_F_GetFieldAsInteger64List( OGRFeatureH feature, int n, int* pnCount) const double * OGR_F_GetFieldAsDoubleList( OGRFeatureH feature, int n, int* pnCount) From d8eca7cbf19db933e5319bfa90344d02140dcfa2 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 20:47:14 +0200 Subject: [PATCH 44/45] Try switching gdal to 3.11.3 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1d149f3..e2eb674d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: needs: [build-sdist] runs-on: ubuntu-latest container: - image: "ghcr.io/osgeo/gdal:ubuntu-small-3.10.3" + image: "ghcr.io/osgeo/gdal:ubuntu-small-3.11.3" steps: - name: Install packages @@ -207,7 +207,7 @@ jobs: path: | ${{ matrix.vcpkg_cache }} # bump the last digit to avoid using previous build cache - key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.10.3-cache0 + key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.11.3-cache0 # MacOS build requires aclocal, which is part of automake, but appears # to be missing in default image From 12f6de251b9db77839296d1d9cf2ac4814c5f8da Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Fri, 29 Aug 2025 20:47:24 +0200 Subject: [PATCH 45/45] pyogrio 0.12.0 --- ci/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/vcpkg.json b/ci/vcpkg.json index a7facd49..26ba740a 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -1,6 +1,6 @@ { "name": "pyogrio", - "version": "0.11.0", + "version": "0.12.0", "dependencies": [ { "name": "libspatialite",