From 6d1b62777dddf6cbd3ed70f29e067ab6f13abcad Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sat, 20 Dec 2025 14:12:09 -0700 Subject: [PATCH 1/4] python3Packages.polars: 1.31.0 -> 1.36.1 --- .../python-modules/polars/avx512.patch | 15 ---- .../python-modules/polars/default.nix | 72 +++++++------------ 2 files changed, 27 insertions(+), 60 deletions(-) delete mode 100644 pkgs/development/python-modules/polars/avx512.patch diff --git a/pkgs/development/python-modules/polars/avx512.patch b/pkgs/development/python-modules/polars/avx512.patch deleted file mode 100644 index 5a4d5ecc9530..000000000000 --- a/pkgs/development/python-modules/polars/avx512.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/crates/polars-compute/src/lib.rs b/crates/polars-compute/src/lib.rs -index ebe1ef753..6e1eee897 100644 ---- a/crates/polars-compute/src/lib.rs -+++ b/crates/polars-compute/src/lib.rs -@@ -5,6 +5,10 @@ - all(feature = "simd", target_arch = "x86_64"), - feature(stdarch_x86_avx512) - )] -+#![cfg_attr( -+ all(feature = "simd", target_arch = "x86_64"), -+ feature(avx512_target_feature) -+)] - - use arrow::types::NativeType; - diff --git a/pkgs/development/python-modules/polars/default.nix b/pkgs/development/python-modules/polars/default.nix index 0fc073681434..bdd9e72e8290 100644 --- a/pkgs/development/python-modules/polars/default.nix +++ b/pkgs/development/python-modules/polars/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, + build, buildPythonPackage, cargo, cmake, @@ -15,7 +16,7 @@ rustc, rustPlatform, runCommand, - + setuptools, mimalloc, jemalloc, rust-jemalloc-sys, @@ -40,7 +41,7 @@ }: let - version = "1.31.0"; + version = "1.36.1"; # Hide symbols to prevent accidental use rust-jemalloc-sys = throw "polars: use polarsMemoryAllocator over rust-jemalloc-sys"; @@ -50,34 +51,26 @@ in buildPythonPackage rec { pname = "polars"; inherit version; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "pola-rs"; repo = "polars"; tag = "py-${version}"; - hash = "sha256-OZ7guV/uxa3jGesAh+ubrFjQSNVp5ImfXfPAQxagTj0="; + hash = "sha256-0usMg/xQZOzrLf2gIfNFtzj96cYVzq5gFaKTFLqyfK0="; }; - patches = [ - ./avx512.patch - ]; - - # Do not type-check assertions because some of them use unstable features (`is_none_or`) - postPatch = '' - while IFS= read -r -d "" path ; do - sed -i 's \(\s*\)debug_assert! \1#[cfg(debug_assertions)]\n\1debug_assert! ' "$path" - done < <( find -iname '*.rs' -print0 ) - ''; - cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; - hash = "sha256-yGTXUW6IVa+nRpmnkEl20/RJ/mxTSAaokETT8QLE+Ns="; + hash = "sha256-20AI4AGSxnmYitQjfwTFwxMBplEqvN4WXPFdoqJBgSg="; }; requiredSystemFeatures = [ "big-parallel" ]; - build-system = [ rustPlatform.maturinBuildHook ]; + build-system = [ + setuptools + build + ]; nativeBuildInputs = [ cargo @@ -86,6 +79,7 @@ buildPythonPackage rec { rustPlatform.cargoSetupHook rustPlatform.cargoBuildHook rustPlatform.cargoInstallHook + rustPlatform.maturinBuildHook rustc ]; @@ -101,12 +95,8 @@ buildPythonPackage rec { # https://discourse.nixos.org/t/nixpkgs-rustplatform-and-nightly/22870 RUSTC_BOOTSTRAP = true; - # Several `debug_assert!` statements use the unstable `Option::is_none_or` method RUSTFLAGS = lib.concatStringsSep " " ( - [ - "-Cdebug_assertions=n" - ] - ++ lib.optionals (polarsMemoryAllocator.pname == "mimalloc") [ + lib.optionals (polarsMemoryAllocator.pname == "mimalloc") [ "--cfg use_mimalloc" ] ); @@ -117,24 +107,17 @@ buildPythonPackage rec { maturinBuildFlags = [ "-m" - "py-polars/Cargo.toml" + "py-polars/runtime/polars-runtime-32/Cargo.toml" ]; - postInstall = '' - # Move polars.abi3.so -> polars.so - local polarsSo="" - local soName="" - while IFS= read -r -d "" p ; do - polarsSo=$p - soName="$(basename "$polarsSo")" - [[ "$soName" == polars.so ]] && break - done < <( find "$out" -iname "polars*.so" -print0 ) - [[ -z "''${polarsSo:-}" ]] && echo "polars.so not found" >&2 && exit 1 - if [[ "$soName" != polars.so ]] ; then - mv "$polarsSo" "$(dirname "$polarsSo")/polars.so" - fi + # maturin builds `_polars_runtime_32`, and we also need the pure-python `polars` wheel itself + preBuild = '' + pyproject-build --no-isolation --outdir dist/ --wheel py-polars ''; + # Fails on polars -> polars-runtime-32 dependency between the two wheels + dontCheckRuntimeDeps = true; + pythonImportsCheck = [ "polars" ]; @@ -219,6 +202,7 @@ buildPythonPackage rec { ps.nest-asyncio ps.numpy ps.openpyxl + ps.orjson ps.pandas ps.pyarrow ps.pydantic @@ -277,14 +261,16 @@ buildPythonPackage rec { "test_scan_credential_provider" "test_scan_credential_provider_serialization" + # Only connecting to localhost, but http URL scheme is disallowed + "test_scan_delta_loads_aws_profile_endpoint_url" + # ModuleNotFoundError: ADBC 'adbc_driver_sqlite.dbapi' driver not detected. "test_read_database" "test_read_database_parameterised_uri" # Untriaged - "test_pickle_lazyframe_nested_function_udf" - "test_serde_udf" - "test_hash_struct" + "test_async_index_error_25209" + "test_parquet_schema_correctness" ]; disabledTestPaths = [ "tests/benchmark" @@ -293,15 +279,11 @@ buildPythonPackage rec { # Internet access "tests/unit/io/cloud/test_credential_provider.py" - # Wrong altair version - "tests/unit/operations/namespaces/test_plot.py" - # adbc "tests/unit/io/database/test_read.py" - # Untriaged - "tests/unit/cloud/test_prepare_cloud_plan.py" - "tests/unit/io/cloud/test_cloud.py" + # Requires pydantic 2.12 + "tests/unit/io/test_iceberg.py" ]; installPhase = "touch $out"; From e4879b5890a78a1cd744fff89a1cf36f5d635114 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sun, 21 Dec 2025 14:03:51 -0700 Subject: [PATCH 2/4] python3Packages.narwhals: 2.10.0 -> 2.14.0 --- pkgs/development/python-modules/narwhals/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/narwhals/default.nix b/pkgs/development/python-modules/narwhals/default.nix index 89901dab34c9..33c0d42a2988 100644 --- a/pkgs/development/python-modules/narwhals/default.nix +++ b/pkgs/development/python-modules/narwhals/default.nix @@ -22,14 +22,14 @@ buildPythonPackage rec { pname = "narwhals"; - version = "2.10.0"; + version = "2.14.0"; pyproject = true; src = fetchFromGitHub { owner = "narwhals-dev"; repo = "narwhals"; tag = "v${version}"; - hash = "sha256-a/X6LVzFxtjyaFcgZapJZ5i9h5LSB39XjGu/HdhPf8k="; + hash = "sha256-5yynyaY5NuxSGEro4pDzFFkf0PsYArzlB23lXYmzydY="; }; build-system = [ hatchling ]; From d7e458617f70fa65f56a126b8f9fbfada34d588d Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sun, 21 Dec 2025 14:04:20 -0700 Subject: [PATCH 3/4] python3Packages.sqlframe: 3.43.7 -> 3.43.8 --- pkgs/development/python-modules/sqlframe/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sqlframe/default.nix b/pkgs/development/python-modules/sqlframe/default.nix index d9ef407e6dcd..d3306e2b2f66 100644 --- a/pkgs/development/python-modules/sqlframe/default.nix +++ b/pkgs/development/python-modules/sqlframe/default.nix @@ -38,14 +38,14 @@ buildPythonPackage rec { pname = "sqlframe"; - version = "3.43.7"; + version = "3.43.8"; pyproject = true; src = fetchFromGitHub { owner = "eakmanrq"; repo = "sqlframe"; tag = "v${version}"; - hash = "sha256-qrKNn13wFEqvMQYzHH8T1pga1EUaVIt701p0k4eXw9c="; + hash = "sha256-gsWA3aBolsR2zPwseHnQXSJRngXUHFGvi55UPevgUHw="; }; build-system = [ setuptools-scm ]; From f98d5cbabc6af39e43c4f6cbbb4a349432ced7af Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sun, 21 Dec 2025 14:04:41 -0700 Subject: [PATCH 4/4] python3Packages.sqlglot: 27.28.1 -> 27.29.0 --- pkgs/development/python-modules/sqlglot/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sqlglot/default.nix b/pkgs/development/python-modules/sqlglot/default.nix index 35e507549ccf..969ba7fc18ec 100644 --- a/pkgs/development/python-modules/sqlglot/default.nix +++ b/pkgs/development/python-modules/sqlglot/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "sqlglot"; - version = "27.28.1"; + version = "27.29.0"; pyproject = true; src = fetchFromGitHub { repo = "sqlglot"; owner = "tobymao"; tag = "v${version}"; - hash = "sha256-DGpxKIlSRwKKXhZGDTTQb8a3iAzy8a7h9/PKHPCuq+g="; + hash = "sha256-kqtsZRtIIgQ0cTbhG5K4N+c3cq7I+Uvd+3s+b0CYLtg="; }; build-system = [