1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 altair,
7 ipytablewidgets,
8 ipywidgets,
9 jupyter,
10 jupyter-core,
11 jupyterlab,
12 pandas,
13 poetry-core,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "vega";
19 version = "4.1.0";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-8lrmhCvwczqBpiQRCkPjmiYsJPHEFnZab/Azkh+i7ls=";
27 };
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 pythonRelaxDeps = [ "pandas" ];
34
35 propagatedBuildInputs = [
36 ipytablewidgets
37 jupyter
38 jupyter-core
39 pandas
40 ];
41
42 optional-dependencies = {
43 widget = [ ipywidgets ];
44 jupyterlab = [ jupyterlab ];
45 };
46
47 nativeCheckInputs = [
48 altair
49 pytestCheckHook
50 ];
51
52 disabledTestPaths = [
53 # these tests are broken with jupyter-notebook >= 7
54 "vega/tests/test_entrypoint.py"
55 ];
56
57 pythonImportsCheck = [ "vega" ];
58
59 meta = with lib; {
60 description = "IPython/Jupyter widget for Vega and Vega-Lite";
61 longDescription = ''
62 To use this you have to enter a nix-shell with vega. Then run:
63
64 jupyter nbextension install --user --py vega
65 jupyter nbextension enable --user vega
66 '';
67 homepage = "https://github.com/vega/ipyvega";
68 license = licenses.bsd3;
69 maintainers = with maintainers; [ teh ];
70 };
71}