Skip to content

Commit 2c2e978

Browse files
committed
python3Packages.plotly: cleanup, fix build
1 parent 4564414 commit 2c2e978

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

pkgs/development/python-modules/plotly/default.nix

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,41 @@
3636
xarray,
3737
}:
3838

39-
buildPythonPackage rec {
39+
buildPythonPackage (finalAttrs: {
4040
pname = "plotly";
4141
version = "6.5.2";
4242
pyproject = true;
4343

4444
src = fetchFromGitHub {
4545
owner = "plotly";
4646
repo = "plotly.py";
47-
tag = "v${version}";
47+
tag = "v${finalAttrs.version}";
4848
hash = "sha256-7rMatpaZvHuNPpiXR5eUHultqNnLER1iW+GR3dwgkyo=";
4949
};
5050

5151
postPatch = ''
5252
substituteInPlace pyproject.toml \
5353
--replace-fail '"hatch", ' "" \
5454
--replace-fail "jupyter_packaging~=0.10.0" jupyter_packaging
55+
''
56+
# AttributeError: module 'numpy' has no attribute 'in1d'
57+
+ ''
58+
substituteInPlace \
59+
tests/test_optional/test_px/test_px.py \
60+
tests/test_optional/test_px/test_px_functions.py \
61+
--replace-fail "np.in1d(" "np.isin("
62+
''
63+
+ ''
64+
substituteInPlace plotly/figure_factory/_violin.py \
65+
--replace-fail \
66+
'np.percentile(x, 50, interpolation="linear")' \
67+
'np.percentile(x, 50, method="linear")' \
68+
--replace-fail \
69+
'np.percentile(x, 25, interpolation="lower")' \
70+
'np.percentile(x, 25, method="lower")' \
71+
--replace-fail \
72+
'np.percentile(x, 75, interpolation="higher")'
73+
'np.percentile(x, 75, method="higher")'
5574
'';
5675

5776
env.SKIP_NPM = true;
@@ -90,7 +109,12 @@ buildPythonPackage rec {
90109
which
91110
xarray
92111
]
93-
++ lib.concatAttrValues optional-dependencies;
112+
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
113+
114+
pytestFlags = [
115+
# pytest.PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated
116+
"-Wignore::pytest.PytestRemovedIn9Warning"
117+
];
94118

95119
disabledTests = [
96120
# failed pinning test, sensitive to dep versions
@@ -151,4 +175,4 @@ buildPythonPackage rec {
151175
sarahec
152176
];
153177
};
154-
}
178+
})

0 commit comments

Comments
 (0)