From ab147f3188e67961c8d1fbf2b6d54e9dbec94d02 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 Jan 2026 01:23:20 +0100 Subject: [PATCH] Revert "python3Packages.pandas: 2.3.3 -> 3.0.0" This reverts commits 2ad5e32bd7e0f48571f8c7d198be1bcc1e6cee20 and 178b97cdc815288976dcc16af8eb7ad319a07f9c. Pandas was just released as this cycle began and we picked it up less than two hours after its release. This is too early for various packages that couldn't yet deal with its breaking changes. --- .../python-modules/pandas/default.nix | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 2e4f488abb8a..1b6138529d56 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -63,19 +63,32 @@ let pandas = buildPythonPackage rec { pname = "pandas"; - version = "3.0.0"; + version = "2.3.3"; pyproject = true; src = fetchFromGitHub { owner = "pandas-dev"; repo = "pandas"; tag = "v${version}"; - postFetch = '' - sed -i 's/git_refnames = "[^"]*"/git_refnames = " (tag: ${src.tag})"/' $out/pandas/_version.py - ''; - hash = "sha256-sUOPZZalTJBJwcqyXwDkmT9UX7Ni71vUa3YdFRwSiJY="; + hash = "sha256-jY1uM9HmJzoFk26ilbtzJnxAsQhmXS19r73JcFeFWRQ="; }; + # A NOTE regarding the Numpy version relaxing: Both Numpy versions 1.x & + # 2.x are supported. However upstream wants to always build with Numpy 2, + # and with it to still be able to run with a Numpy 1 or 2. We insist to + # perform this substitution even though python3.pkgs.numpy is of version 2 + # nowadays, because our ecosystem unfortunately doesn't allow easily + # separating runtime and build-system dependencies. See also: + # + # https://discourse.nixos.org/t/several-comments-about-priorities-and-new-policies-in-the-python-ecosystem/51790 + # + # Being able to build (& run) with Numpy 1 helps for python environments + # that override globally the `numpy` attribute to point to `numpy_1`. + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "numpy>=2.0" numpy + ''; + build-system = [ cython meson-python @@ -92,6 +105,7 @@ let dependencies = [ numpy python-dateutil + pytz tzdata ]; @@ -151,7 +165,6 @@ let ]; spss = [ pyreadstat ]; sql-other = [ sqlalchemy ]; - timezone = [ pytz ]; xml = [ lxml ]; }; in