From 3fd02ea2485c61a82963dd874fca31ee2358a432 Mon Sep 17 00:00:00 2001 From: Mario <191101255+wariuccio@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:26:20 +0000 Subject: [PATCH] python3Packages.vegafusion: init at 2.0.3 Co-authored-by: Sandro --- .../python-modules/vegafusion/default.nix | 101 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 103 insertions(+) create mode 100644 pkgs/development/python-modules/vegafusion/default.nix diff --git a/pkgs/development/python-modules/vegafusion/default.nix b/pkgs/development/python-modules/vegafusion/default.nix new file mode 100644 index 000000000000..c53d97e00fdc --- /dev/null +++ b/pkgs/development/python-modules/vegafusion/default.nix @@ -0,0 +1,101 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + rustPlatform, + pytestCheckHook, + # Deps + arro3-core, + protobuf, + psutil, + altair, + ipywidgets, + vl-convert-python, + anywidget, + polars, + grpcio, + pyarrow, + # optional-dependencies + duckdb, + vega-datasets, + scikit-image, + jupytext, + ipykernel, + selenium, + flaky, + tenacity, +}: +buildPythonPackage rec { + pname = "vegafusion"; + version = "2.0.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "hex-inc"; + repo = "vegafusion"; + tag = "v${version}"; + hash = "sha256-yiECw9WGd+03KFOWa+bwR10gQFqzx4Riy6uw2zwdc3s="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-T/4k4ZWiO/AQvCxsbjyLMvV/zKq8ywy2rAQYMsJ73t4="; + }; + + buildAndTestSubdir = "vegafusion-python"; + + buildInputs = [ protobuf ]; + + nativeBuildInputs = with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]; + + dependencies = [ + arro3-core + psutil + altair + ipywidgets + vl-convert-python + anywidget + polars + grpcio + pyarrow + ]; + + optional-dependencies = { + test = [ + duckdb + vega-datasets + scikit-image + jupytext + ipykernel + selenium + flaky + tenacity + ]; + }; + + pythonImportsCheck = [ "vegafusion" ]; + + nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.test; + + disabledTests = [ + # Require network access + "test_input_utc" + "test_pretransform" + "test_pretransform_specs" + "test_transformed_data" + + # Relies on selenium's chromedriver_binary + "test_jupyter_widget" + ]; + + meta = with lib; { + description = "Core tools for using VegaFusion from Python"; + homepage = "https://github.com/hex-inc/vegafusion"; + license = lib.licenses.bsd3; + maintainers = with maintainers; [ wariuccio ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ba7043d0f868..139fb8eb77e1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -20366,6 +20366,8 @@ self: super: with self; { vega-datasets = callPackage ../development/python-modules/vega-datasets { }; + vegafusion = callPackage ../development/python-modules/vegafusion { }; + vegehub = callPackage ../development/python-modules/vegehub { }; vehicle = callPackage ../development/python-modules/vehicle { };