python312Packages.pandas: use cython 3

This is a hack to allow pandas 2.1.3 to build on python 3.12, which is
only supported from 2.2.0

Cython 2 still calls into distutils, Cython 3 does not.
This commit is contained in:
Martin Weinelt 2023-12-05 03:46:00 +01:00
parent 8037c388b0
commit 57c8d87e96
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -2,10 +2,12 @@
, stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonAtLeast
, pythonOlder
# build-system
, cython
, cython_3
, meson-python
, meson
, oldest-supported-numpy
@ -77,12 +79,14 @@ let pandas = buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace "Cython>=0.29.33,<3" "Cython" \
--replace "meson-python==0.13.1" "meson-python>=0.13.1" \
--replace "meson==1.2.1" "meson>=1.2.1"
'';
nativeBuildInputs = [
cython
# TODO: hack to support pandas on python3.12, remove with pandas 2.2.0
(if pythonAtLeast "3.12" then cython_3 else cython)
meson-python
meson
numpy