diff --git a/pkgs/development/python-modules/pyecharts/default.nix b/pkgs/development/python-modules/pyecharts/default.nix index d2b09be15f82..38c61fe32499 100644 --- a/pkgs/development/python-modules/pyecharts/default.nix +++ b/pkgs/development/python-modules/pyecharts/default.nix @@ -2,18 +2,32 @@ lib, buildPythonPackage, fetchFromGitHub, + pythonAtLeast, + + # build-system + setuptools, + + # dependencies jinja2, + prettytable, + simplejson, + + # optional-dependencies + pillow, + + # tests numpy, pandas, - pillow, - prettytable, pytestCheckHook, requests, - setuptools, - simplejson, }: -buildPythonPackage rec { +let + optional-dependencies = { + images = [ pillow ]; + }; +in +buildPythonPackage (finalAttrs: { pname = "pyecharts"; version = "2.0.9"; pyproject = true; @@ -21,7 +35,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pyecharts"; repo = "pyecharts"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-AMdPsTQsndc0fr4NF2AnJy98k4I2832/GNWeY4IWSRA="; }; @@ -33,9 +47,7 @@ buildPythonPackage rec { simplejson ]; - optional-dependencies = { - images = [ pillow ]; - }; + inherit optional-dependencies; nativeCheckInputs = [ numpy @@ -52,13 +64,17 @@ buildPythonPackage rec { "test_render_embed_js" "test_display_javascript_v2" "test_lines3d_base" + ] + ++ lib.optionals (pythonAtLeast "3.14") [ + # pyecharts.exceptions.WordCloudMaskImageException + "test_wordcloud_encode_image_to_base64_os_error" ]; meta = { description = "Python Echarts Plotting Library"; homepage = "https://github.com/pyecharts/pyecharts"; - changelog = "https://github.com/pyecharts/pyecharts/releases/tag/${src.tag}"; + changelog = "https://github.com/pyecharts/pyecharts/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ fab ]; }; -} +})