From 57c8d87e96c6b85b2f08e64da3103cbb38856c4c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 5 Dec 2023 03:46:00 +0100 Subject: [PATCH] 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. --- pkgs/development/python-modules/pandas/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 818cb783dd2a..7351e6536416 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -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