Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python311Packages.cufflinks: refactor and drop nose #313159

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions pkgs/development/python-modules/cufflinks/default.nix
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
{ lib, buildPythonPackage, fetchPypi
, chart-studio
, colorlover
, ipython
, ipywidgets
, pytest
, nose
, numpy
, pandas
, six
, statsmodels
{
lib,
buildPythonPackage,
fetchPypi,
colorlover,
ipython,
ipywidgets,
numpy,
pandas,
plotly,
pytestCheckHook,
setuptools,
six,
}:

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";
Expand Down