python3Packages.plotnine: relax mizani dependency and adapt to breaking changes

This commit is contained in:
Gaetan Lepage
2025-07-10 13:58:08 +02:00
parent 414c77359a
commit 216f731386
@@ -19,6 +19,7 @@
pytestCheckHook,
pytest-cov-stub,
scikit-misc,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
@@ -33,8 +34,26 @@ buildPythonPackage rec {
hash = "sha256-nTMu0zx13XepqQyrJrAvBCjjHdY02tlXlFk2kITHZfI=";
};
# Fixes: TypeError: hue_pal.__init__() got an unexpected keyword argument 'color_space'
#
# In the mizani 0.14.0 release, hue_pal was changed to use HCL color space from HSL (or HSLuv) space.
# The previous functionality is still available with hls_pal.
postPatch = ''
substituteInPlace plotnine/scales/scale_color.py \
--replace-fail \
"from mizani.palettes import hue_pal" \
"from mizani.palettes import hls_pal" \
--replace-fail \
"hue_pal(" \
"hls_pal("
'';
build-system = [ setuptools-scm ];
pythonRelaxDeps = [
"mizani"
];
dependencies = [
matplotlib
mizani
@@ -49,12 +68,9 @@ buildPythonPackage rec {
pytestCheckHook
pytest-cov-stub
scikit-misc
writableTmpDirAsHomeHook
];
preCheck = ''
export HOME=$(mktemp -d)
'';
pythonImportsCheck = [ "plotnine" ];
disabledTests = [