Skip to content

BLD/RLS: Update wheels to include GDAL 3.9.2 and libkml #451

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

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- run:
name: Build the Linux aarch64 wheels.
command: |
python3 -m pip install --user cibuildwheel==2.17.0
python3 -m pip install --user cibuildwheel==2.20.0
python3 -m cibuildwheel --output-dir wheelhouse
- run:
name: Test the wheels
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker-gdal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
fail-fast: false
matrix:
container:
- "ghcr.io/osgeo/gdal:ubuntu-small-latest" # >= python 3.10.6
- "ghcr.io/osgeo/gdal:ubuntu-small-3.8.3" # python 3.10.12
- "ghcr.io/osgeo/gdal:ubuntu-small-latest" # >= python 3.12.3
- "ghcr.io/osgeo/gdal:ubuntu-small-3.9.2" # python 3.12.3
- "ghcr.io/osgeo/gdal:ubuntu-small-3.8.5" # python 3.10.12
- "ghcr.io/osgeo/gdal:ubuntu-small-3.7.3" # python 3.10.12
- "ghcr.io/osgeo/gdal:ubuntu-small-3.6.4" # python 3.10.6
- "osgeo/gdal:ubuntu-small-3.5.3" # python 3.8.10
Expand Down
83 changes: 58 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,34 @@ jobs:
needs: [build-sdist]
runs-on: ubuntu-latest
container:
image: "ghcr.io/osgeo/gdal:ubuntu-small-3.8.5"
image: "ghcr.io/osgeo/gdal:ubuntu-small-3.9.2"

steps:
- name: Install packages
run: |
apt-get update && apt-get install -y build-essential python3-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this is now needed? (was there a change in the docker image?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally we were installing python3-pip which also pulled in build-essential and python3-dev as dependencies. We now need to install them directly.


- name: Create virtual environment
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
. $HOME/.cargo/env
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this doing exactly? (is it common practice documented somewhere, or can we add some comments?)
Is it to ensure the python on the path is the one of this venv?

From quickly checking the uv docs (https://docs.astral.sh/uv/pip/environments/), my understanding is that when you use the default .venv name for the environment, then subsequent uv pip .. automatically uses that environment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I suppose it is for the python3 -m pytest .. below? That could maybe also use uv run python -m pytest ... to make it explicit it is using the python from the uv venv?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I believe I was running into issues with uv not automatically activating the virtual environment in subsequent steps. Somehow I missed that you could issue uv run python ... instead; will try that now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just dropping a note that trying uv run python did not work in this case (appears to require [project] section be added to pyproject.toml plus a few more things I didn't investigate fixing); it was easier to just use the environment variables to activate the virtual environment.


- name: Download sdist from artifacts
uses: actions/download-artifact@v4
with:
name: pyogrio-sdist
path: wheelhouse

- name: Install pip
run: |
apt-get update && apt-get install -y python3-pip

- name: Build from sdist and install test dependencies
shell: bash
run: |
python3 -m pip install --no-cache-dir wheelhouse/*.tar.gz
python3 -m pip install --no-cache-dir pytest pandas pyproj shapely>=2
python3 -m pip install --no-cache-dir --no-deps geopandas
python3 -m pip list
uv pip install --no-cache wheelhouse/*.tar.gz
uv pip install --no-cache pytest pandas pyproj shapely>=2
uv pip install --no-cache --no-deps geopandas
uv pip list

- name: Run tests
shell: bash
Expand All @@ -83,7 +91,7 @@ jobs:

build-wheels-linux:
name: Build wheels on Linux
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"

steps:
- name: Checkout
Expand All @@ -103,7 +111,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile
file: ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile
tags: manylinux-vcpkg-gdal:latest
push: false
load: true
Expand All @@ -113,7 +121,7 @@ jobs:
BUILDKIT_PROGRESS: plain

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
uses: pypa/cibuildwheel@v2.20.0

- uses: actions/upload-artifact@v4
with:
Expand All @@ -129,7 +137,7 @@ jobs:
matrix:
include:
- os: "macos-12"
triplet: "x64-osx-dynamic"
triplet: "x64-osx-dynamic-release"
arch: x86_64
vcpkg_cache: "/Users/runner/.cache/vcpkg/archives"
vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log"
Expand Down Expand Up @@ -160,7 +168,7 @@ jobs:
path: |
${{ matrix.vcpkg_cache }}
# bump the last digit to avoid using previous build cache
key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.8.5-cache0
key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.9.2-cache0

# MacOS build requires aclocal, which is part of automake, but appears
# to be missing in default image
Expand All @@ -178,7 +186,7 @@ jobs:
git reset --hard
# pull latest version to ensure the required commit with GDAL 3.8 is available
git pull
git checkout 4f4a1821b2e8c7a2863e4df65a4d514f84144049
git checkout 73794ce5f63fd138fab999a22959ca7c6305d93c

- name: Install GDAL
env:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a --overlay-triplets=./ci/custom-triplets a few lines below here that can then be removed as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we still need to use the custom triplets?

Expand All @@ -196,7 +204,7 @@ jobs:
path: ${{ matrix.vcpkg_logs }}

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
uses: pypa/cibuildwheel@v2.20.0
env:
# CIBW needs to know triplet for the correct install path
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
Expand All @@ -215,17 +223,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "windows-latest", "macos-12", "macos-latest"]
os:
[
"ubuntu-latest",
"ubuntu-20.04",
"windows-latest",
"macos-12",
"macos-latest",
]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: "ubuntu-latest"
artifact: pyogrio-wheel-linux
- os: "ubuntu-20.04"
artifact: pyogrio-wheel-linux
- os: "windows-latest"
artifact: pyogrio-wheel-x64-windows-dynamic-release
- os: "macos-12"
artifact: pyogrio-wheel-x64-osx-dynamic
artifact: pyogrio-wheel-x64-osx-dynamic-release
- os: "macos-latest"
artifact: pyogrio-wheel-x64-osx-dynamic
artifact: pyogrio-wheel-arm64-osx-dynamic-release

steps:
- name: Checkout
Expand All @@ -236,8 +253,24 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: "pip"
cache-dependency-path: "ci/requirements-wheel-test.txt"

- name: Create virtual environment (Linux / MacOS)
if: ${{ runner.os != 'Windows' }}
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
. $HOME/.cargo/env
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH

- name: Create virtual environment (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
irm https://astral.sh/uv/install.ps1 | iex
uv venv .venv
"VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append
"$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append

- name: Download wheels from artifacts
uses: actions/download-artifact@v4
Expand All @@ -248,12 +281,12 @@ jobs:
- name: Install dependencies and pyogrio wheel
shell: bash
run: |
python -m pip install -r ci/requirements-wheel-test.txt
uv pip install --no-cache -r ci/requirements-wheel-test.txt
if [ ${{ matrix.python-version }} != "3.12" ]; then
python -m pip install --no-deps geopandas
uv pip install --no-cache --no-deps geopandas
fi
python -m pip install --pre --find-links wheelhouse pyogrio
python -m pip list
uv pip install --no-cache --pre --no-index --find-links wheelhouse pyogrio
uv pip list

- name: Run tests
shell: bash
Expand Down
9 changes: 8 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

## 0.9.1 (yyyy-mm-dd)
## 0.10.0 (yyyy-mm-dd)

### Packaging

Expand All @@ -18,6 +18,13 @@
- Raise NotImplmentedError when user attempts to write to an open file handle (#442).
- Prevent seek on read from compressed inputs (#443).

### Packaging

- The GDAL library included in the wheels is updated from 3.8.5 to GDAL 3.9.2
and includes the LIBKML driver (#589).
- Updates to manylinux_2_28 for building Linux x64 wheels; these will require
Linux versions with glibc >= 2.28 (#589).

## 0.9.0 (2024-06-17)

### Improvements
Expand Down
6 changes: 3 additions & 3 deletions ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM quay.io/pypa/manylinux2014_x86_64:2024-04-15-dd44d68
FROM quay.io/pypa/manylinux2014_x86_64:2024-07-15-c746fd8

# building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988)
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
# 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 4f4a1821b2e8c7a2863e4df65a4d514f84144049
git -C /opt/vcpkg checkout 73794ce5f63fd138fab999a22959ca7c6305d93c

ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg"
ENV PATH="${PATH}:/opt/vcpkg"
Expand Down
6 changes: 2 additions & 4 deletions ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM quay.io/pypa/manylinux_2_28_aarch64:2024-04-15-dd44d68
FROM quay.io/pypa/manylinux_2_28_aarch64:2024-07-15-c746fd8

# 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 4f4a1821b2e8c7a2863e4df65a4d514f84144049
git -C /opt/vcpkg checkout 73794ce5f63fd138fab999a22959ca7c6305d93c

ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg"
ENV PATH="${PATH}:/opt/vcpkg"
Expand All @@ -24,7 +24,6 @@ RUN bootstrap-vcpkg.sh && \
vcpkg integrate bash

COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/arm64-linux-dynamic-release.cmake
COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/
COPY ci/vcpkg.json opt/vcpkg/

# temporary workaround for https://github.com/microsoft/vcpkg/issues/36094
Expand All @@ -33,7 +32,6 @@ RUN git -C /opt/vcpkg apply vcpkg_linux_crosscompiling.patch

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/arm64-linux-dynamic-release/lib"
RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \
--overlay-ports=opt/vcpkg/custom-ports \
--feature-flags="versions,manifests" \
--x-manifest-root=opt/vcpkg \
--x-install-root=opt/vcpkg/installed && \
Expand Down
33 changes: 33 additions & 0 deletions ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM quay.io/pypa/manylinux_2_28_x86_64:2024-07-15-c746fd8

# 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 73794ce5f63fd138fab999a22959ca7c6305d93c

ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg"
ENV PATH="${PATH}:/opt/vcpkg"

ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic-release"

# mkdir & touch -> workaround for https://github.com/microsoft/vcpkg/issues/27786
RUN bootstrap-vcpkg.sh && \
mkdir -p /root/.vcpkg/ $HOME/.vcpkg && \
touch /root/.vcpkg/vcpkg.path.txt $HOME/.vcpkg/vcpkg.path.txt && \
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/

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib"
RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \
--feature-flags="versions,manifests" \
--x-manifest-root=opt/vcpkg \
--x-install-root=opt/vcpkg/installed && \
vcpkg list

# setting git safe directory is required for properly building wheels when
# git >= 2.35.3
RUN git config --global --add safe.directory "*"
17 changes: 0 additions & 17 deletions ci/vcpkg-custom-ports/zlib/0002-skip-building-examples.patch

This file was deleted.

20 changes: 0 additions & 20 deletions ci/vcpkg-custom-ports/zlib/LICENSE

This file was deleted.

38 changes: 0 additions & 38 deletions ci/vcpkg-custom-ports/zlib/portfile.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions ci/vcpkg-custom-ports/zlib/usage

This file was deleted.

Loading
Loading