1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # Runtime dependencies
8 hatchling,
9 toolz,
10 numpy,
11 jsonschema,
12 typing-extensions,
13 pandas,
14 jinja2,
15 packaging,
16
17 # Build, dev and test dependencies
18 anywidget,
19 ipython,
20 pytestCheckHook,
21 vega-datasets,
22 sphinx,
23}:
24
25buildPythonPackage rec {
26 pname = "altair";
27 version = "5.2.0";
28 format = "pyproject";
29 disabled = pythonOlder "3.8";
30
31 src = fetchFromGitHub {
32 owner = "altair-viz";
33 repo = "altair";
34 rev = "refs/tags/v${version}";
35 hash = "sha256-uTG+V0SQgAQtMjvrVvKVKgIBT9qO+26EPRxQCEXj/gc=";
36 };
37
38 nativeBuildInputs = [ hatchling ];
39
40 propagatedBuildInputs = [
41 jinja2
42 jsonschema
43 numpy
44 packaging
45 pandas
46 toolz
47 ] ++ lib.optional (pythonOlder "3.11") typing-extensions;
48
49 nativeCheckInputs = [
50 anywidget
51 ipython
52 sphinx
53 vega-datasets
54 pytestCheckHook
55 ];
56
57 pythonImportsCheck = [ "altair" ];
58
59 disabledTestPaths = [
60 # Disabled because it requires internet connectivity
61 "tests/test_examples.py"
62 # TODO: Disabled because of missing altair_viewer package
63 "tests/vegalite/v5/test_api.py"
64 # avoid updating files and dependency on black
65 "tests/test_toplevel.py"
66 # require vl-convert package
67 "tests/utils/test_compiler.py"
68 ];
69
70 meta = with lib; {
71 description = "A declarative statistical visualization library for Python.";
72 homepage = "https://altair-viz.github.io";
73 downloadPage = "https://github.com/altair-viz/altair";
74 changelog = "https://altair-viz.github.io/releases/changes.html";
75 license = licenses.bsd3;
76 maintainers = with maintainers; [
77 teh
78 vinetos
79 ];
80 };
81}