Skip to content
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

MAINT: drop Python 3.8 support #473

Merged
merged 9 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .github/workflows/docker-gdal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- "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
- "osgeo/gdal:ubuntu-small-3.4.3" # python 3.8.10
- "osgeo/gdal:ubuntu-small-3.5.3" # python 3.8.10?
- "osgeo/gdal:ubuntu-small-3.4.3" # python 3.8.10?
Copy link
Member

Choose a reason for hiding this comment

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

I just pulled osgeo/gdal:ubuntu-small-3.4.3 and osgeo/gdal:ubuntu-small-3.5.3 locally and confirmed they have 3.8.10.

We could use uv's python management to bootstrap Python 3.9 instead of using the system one from GDAL Docker image for these tests.

Copy link
Member Author

@jorisvandenbossche jorisvandenbossche Sep 16, 2024

Choose a reason for hiding this comment

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

Yeah, I just added the question mark so that I could comment on those lines ;)

I was also thinking doing something similar as we do in the release workflow using uv, but then indeed installing another python version.

Another option would be to use apt to install another python version from the deadsnakes ppa (in other projects we also use that to install a non-system-supported python version in those cases).

Given we already are using uv (also in this workflow), will first give that a go.

Copy link
Member Author

Choose a reason for hiding this comment

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

One thing I don't understand from the current failure on the docker build is why uv was trying to use Python 3.13.0rc2 for those older images ..

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe because it noticed from pyproject.toml that the available python 3.8 would not work for this project?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, @brendan-ward I tried both approaches (for the gdal 3.4 vs 3.5 images), and when using uv to get python 3.9, we still get the same error (that I don't really understand) about "clang" when building pyogrio (for some reason it tries to use clang for building instead of gcc? some consequence of how the python from uv is built?)

When the python is installed with the deadsnakes ppa, it also gets picked up automatically by uv but then building goes fine

Copy link
Member Author

Choose a reason for hiding this comment

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

(updated to have both use the ppa approach)

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for trying it both ways! Not sure why the uv version of python didn't work; it works properly when I try to build within these containers locally (Arm64 containers on MacOS M1 host).

Installing python via deadsnakes ppa is just fine too.


container:
image: ${{ matrix.container }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:
"macos-12",
"macos-latest",
]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- os: "ubuntu-latest"
artifact: pyogrio-wheel-linux-manylinux2014_x86_64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ substantial change. Please see [CHANGES](CHANGES.md).

## Requirements

Supports Python 3.8 - 3.11 and GDAL 3.4.x - 3.8.x.
Supports Python 3.9 - 3.13 and GDAL 3.4.x - 3.9.x.

Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

Supports Python 3.8 - 3.11 and GDAL 3.4.x - 3.8.x
Supports Python 3.9 - 3.13 and GDAL 3.4.x - 3.9.x

Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.

Expand Down
3 changes: 1 addition & 2 deletions pyogrio/_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import logging
import os
import platform
import sys
from contextlib import contextmanager
from pathlib import Path

Expand All @@ -28,7 +27,7 @@

gdal_dll_dir = None

if platform.system() == "Windows" and sys.version_info >= (3, 8):
if platform.system() == "Windows":
# if loading of extension modules fails, search for gdal dll directory
try:
import pyogrio._io # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: GIS",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = ["certifi", "numpy", "packaging"]

[project.optional-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
logger = logging.getLogger(__name__)


MIN_PYTHON_VERSION = (3, 8, 0)
MIN_PYTHON_VERSION = (3, 9, 0)
MIN_GDAL_VERSION = (2, 4, 0)


if sys.version_info < MIN_PYTHON_VERSION:
raise RuntimeError("Python >= 3.8 is required")
raise RuntimeError("Python >= 3.9 is required")


def copy_data_tree(datadir, destdir):
Expand Down
Loading