From dbfa5b3135c2f229104f5a7383b7afbc85c67384 Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 20 May 2024 23:53:37 +0900 Subject: [PATCH 1/2] python311Packages.cufflinks: format with nixfmt --- .../python-modules/cufflinks/default.nix | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/cufflinks/default.nix b/pkgs/development/python-modules/cufflinks/default.nix index 4884c2e584bc2..5f804e5da5271 100644 --- a/pkgs/development/python-modules/cufflinks/default.nix +++ b/pkgs/development/python-modules/cufflinks/default.nix @@ -1,14 +1,17 @@ -{ lib, buildPythonPackage, fetchPypi -, chart-studio -, colorlover -, ipython -, ipywidgets -, pytest -, nose -, numpy -, pandas -, six -, statsmodels +{ + lib, + buildPythonPackage, + fetchPypi, + chart-studio, + colorlover, + ipython, + ipywidgets, + pytest, + nose, + numpy, + pandas, + six, + statsmodels, }: buildPythonPackage rec { @@ -32,7 +35,10 @@ buildPythonPackage rec { statsmodels ]; - nativeCheckInputs = [ pytest nose ]; + nativeCheckInputs = [ + pytest + nose + ]; # ignore tests which are incompatible with pandas>=1.0 # https://github.com/santosjorge/cufflinks/issues/236 From 9f43e396ddf387fe8b092d8e1ffe73008d7a579e Mon Sep 17 00:00:00 2001 From: natsukium Date: Tue, 21 May 2024 00:13:51 +0900 Subject: [PATCH 2/2] python311Packages.cufflinks: refactor and drop nose --- .../python-modules/cufflinks/default.nix | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/cufflinks/default.nix b/pkgs/development/python-modules/cufflinks/default.nix index 5f804e5da5271..9e2e8df44a003 100644 --- a/pkgs/development/python-modules/cufflinks/default.nix +++ b/pkgs/development/python-modules/cufflinks/default.nix @@ -2,49 +2,52 @@ lib, buildPythonPackage, fetchPypi, - chart-studio, colorlover, ipython, ipywidgets, - pytest, - nose, numpy, pandas, + plotly, + pytestCheckHook, + setuptools, six, - statsmodels, }: buildPythonPackage rec { pname = "cufflinks"; version = "0.17.3"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "0i56062k54dlg5iz3qyl1ykww62mpkp8jr4n450h0c60dm0b7ha8"; + hash = "sha256-SMGzQG3AMABBIZZkie68VRjOpw/U4/FjebSRMoUBpkQ="; }; - propagatedBuildInputs = [ - chart-studio + # replace duplicated pandas method + # https://github.com/santosjorge/cufflinks/pull/249#issuecomment-1759619149 + postPatch = '' + substituteInPlace tests.py \ + --replace-fail "from nose.tools import assert_equals" "def assert_equals(x, y): assert x == y" \ + --replace-fail "df.ix" "df.loc" + ''; + + build-system = [ setuptools ]; + + dependencies = [ colorlover ipython ipywidgets numpy pandas + plotly six - statsmodels ]; - nativeCheckInputs = [ - pytest - nose - ]; + pythonImportsCheck = [ "cufflinks" ]; - # ignore tests which are incompatible with pandas>=1.0 - # https://github.com/santosjorge/cufflinks/issues/236 - checkPhase = '' - pytest tests.py -k 'not bar_row' - ''; + nativeCheckInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "tests.py" ]; meta = with lib; { description = "Productivity Tools for Plotly + Pandas";