-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Python bindings: add a pyproject.toml with numpy as a build requirement #8926
Changes from all commits
bc4e370
c86ca7c
99fe5a7
442b785
59ff2eb
f17a7bd
927aaf3
feb8bed
0be30ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From c8e8942b5dd50d1abb4369662b0cb9d282c3bf69 Mon Sep 17 00:00:00 2001 | ||
From: Even Rouault <even.rouault@spatialys.com> | ||
Date: Wed, 6 Dec 2023 19:06:08 +0100 | ||
Subject: [PATCH] Fix build of Python bindings due to | ||
https://github.com/OSGeo/gdal/pull/8926 changes | ||
|
||
--- | ||
recipe/install_python.sh | 14 ++++++++------ | ||
1 file changed, 8 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/recipe/install_python.sh b/recipe/install_python.sh | ||
index 4bcd219..1561771 100644 | ||
--- a/recipe/install_python.sh | ||
+++ b/recipe/install_python.sh | ||
@@ -21,12 +21,14 @@ cmake "-UPython*" \ | ||
cmake --build . --target python_generated_files | ||
cd swig/python | ||
|
||
-cat >pyproject.toml <<EOF | ||
-[build-system] | ||
-requires = ["setuptools>=40.8.0", "wheel"] | ||
-build-backend = "setuptools.build_meta" | ||
-EOF | ||
- | ||
$PYTHON setup.py build_ext | ||
|
||
+# Cf https://github.com/OSGeo/gdal/pull/8926 | ||
+# The above build_ext has been run with numpy already installed in the environment | ||
+# because otherwise it would have failed. | ||
+# But as we run pip install without dependencies, we have to force | ||
+# GDAL_PYTHON_BINDINGS_WITHOUT_NUMPY=YES to disable the related check. | ||
+# This is OK here since the bindings have already been built, and it is just | ||
+# a matter of bundling them in the wheel. | ||
+export GDAL_PYTHON_BINDINGS_WITHOUT_NUMPY=YES | ||
$PYTHON -m pip install --no-deps --ignore-installed . | ||
-- | ||
2.25.1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0.0", "oldest-supported-numpy", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "GDAL" | ||
dynamic = ["version", "scripts"] | ||
authors = [ | ||
{name = "Frank Warmerdam"}, | ||
{name = "Howard Butler"}, | ||
{name = "Even Rouault"}, | ||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a few fields that are duplicated between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
sigh, yet another config file... I'd prefer sticking with the current 2 file setup, unless we see that it is broken... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that you no longer need
Almost all the metadata can be simply moved from |
||
] | ||
maintainers = [ | ||
{name = "GDAL contributors", email = "gdal-dev@lists.osgeo.org"}, | ||
] | ||
description = "GDAL: Geospatial Data Abstraction Library" | ||
readme = "README.rst" | ||
keywords = ["gis", "raster", "vector"] | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: C", | ||
"Programming Language :: C++", | ||
"Topic :: Scientific/Engineering :: GIS", | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
] | ||
requires-python = ">=3.8" | ||
|
||
[project.optional-dependencies] | ||
numpy = ['numpy>1.0.0'] | ||
|
||
[project.urls] | ||
Homepage = "https://gdal.org" | ||
Documentation = "https://gdal.org" | ||
Repository = "https://github.com/OSGeo/GDAL.git" | ||
Changelog = "https://github.com/OSGeo/gdal/blob/master/NEWS.md" | ||
Issues = "https://github.com/OSGeo/gdal/issues" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I think this does something I have not accounted for: Does the trailing
.*
account for versions like3.8.1.1
where a new version of the Python package has been released to fix some bug with the package itself? I have always done "gdal==$(gdal-config --version)".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes