nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 jinja2,
12 jsonschema,
13 narwhals,
14 numpy,
15 packaging,
16 pandas,
17 toolz,
18 typing-extensions,
19
20 # tests
21 anywidget,
22 ipython,
23 ipywidgets,
24 mistune,
25 polars,
26 pytest-xdist,
27 pytestCheckHook,
28 vega-datasets,
29 vl-convert-python,
30 writableTmpDirAsHomeHook,
31}:
32
33buildPythonPackage (finalAttrs: {
34 pname = "altair";
35 version = "6.0.0";
36 pyproject = true;
37
38 src = fetchFromGitHub {
39 owner = "altair-viz";
40 repo = "altair";
41 tag = "v${finalAttrs.version}";
42 hash = "sha256-+Qc51L4tL1pRDpWwadxPpTE4tDH3FTO/wH67FtXMN7k=";
43 };
44
45 build-system = [ hatchling ];
46
47 dependencies = [
48 jinja2
49 jsonschema
50 narwhals
51 numpy
52 packaging
53 pandas
54 toolz
55 ]
56 ++ lib.optionals (pythonOlder "3.14") [
57 typing-extensions
58 ];
59
60 nativeCheckInputs = [
61 anywidget
62 ipython
63 ipywidgets
64 mistune
65 polars
66 pytest-xdist
67 pytestCheckHook
68 vega-datasets
69 vl-convert-python
70 writableTmpDirAsHomeHook
71 ];
72
73 pythonImportsCheck = [ "altair" ];
74
75 enabledTestPaths = [
76 "tests/"
77 ];
78
79 disabledTests = [
80 # ValueError: Saving charts in 'svg' format requires the vl-convert-python or altair_saver package: see http://github.com/altair-viz/altair_saver/
81 "test_renderer_with_none_embed_options"
82
83 # Sometimes conflict due to parallelism
84 "test_dataframe_to_csv[polars]"
85 "test_dataframe_to_csv[pandas]"
86
87 # Network access
88 "test_chart_validation_errors"
89 "test_data_consistency"
90 "test_load_call"
91 "test_loader_call"
92 "test_multiple_field_strings_in_condition"
93 "test_no_remote_connection"
94 "test_pandas_date_parse"
95 "test_pandas_date_parse"
96 "test_polars_date_read_json_roundtrip"
97 "test_polars_date_read_json_roundtrip"
98 "test_polars_date_read_json_roundtrip"
99 "test_polars_date_read_json_roundtrip"
100 "test_reader_cache"
101 "test_theme_remote_lambda"
102 "test_tsv"
103 ];
104
105 disabledTestPaths = [
106 # Network access
107 "altair/datasets/_data.py"
108 "tests/test_examples.py"
109
110 # avoid updating files and dependency on black
111 "tests/test_toplevel.py"
112 ];
113
114 meta = {
115 description = "Declarative statistical visualization library for Python";
116 homepage = "https://altair-viz.github.io";
117 downloadPage = "https://github.com/altair-viz/altair";
118 changelog = "https://altair-viz.github.io/releases/changes.html";
119 license = lib.licenses.bsd3;
120 maintainers = with lib.maintainers; [
121 teh
122 vinetos
123 ];
124 };
125})