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