From 4a4e321ffdc1378540f883b6c4ce632621e22a61 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 2 Nov 2024 15:19:49 +0900 Subject: [PATCH] python312Packages.plotly: fix compatibility with numpy>=2 --- pkgs/development/python-modules/plotly/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix index ab177fa01b32..9823c41c4fec 100644 --- a/pkgs/development/python-modules/plotly/default.nix +++ b/pkgs/development/python-modules/plotly/default.nix @@ -38,9 +38,18 @@ buildPythonPackage rec { sourceRoot = "${src.name}/packages/python/plotly"; + # tracking numpy 2 issue: https://github.com/plotly/plotly.py/pull/4622 postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "\"jupyterlab~=3.0;python_version>='3.6'\"," "" + + substituteInPlace plotly/tests/test_optional/test_utils/test_utils.py \ + --replace-fail "np.NaN" "np.nan" \ + --replace-fail "np.NAN" "np.nan" \ + --replace-fail "np.Inf" "np.inf" + + substituteInPlace plotly/tests/test_optional/test_px/test_imshow.py \ + --replace-fail "- 255 * img.max()" "- np.int64(255) * img.max()" ''; env.SKIP_NPM = true; @@ -91,6 +100,9 @@ buildPythonPackage rec { # AssertionError: assert "plotly" not in sys.modules "test_dependencies_not_imported" "test_lazy_imports" + # numpy2 related error, RecursionError + # https://github.com/plotly/plotly.py/pull/4622#issuecomment-2452886352 + "test_masked_constants_example" ]; disabledTestPaths = [