1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 jupyter-packaging,
7 jupyterlab,
8 bqscales,
9 ipywidgets,
10 numpy,
11 pandas,
12 traitlets,
13 traittypes,
14}:
15
16buildPythonPackage rec {
17 pname = "bqplot";
18 version = "0.12.43";
19
20 format = "pyproject";
21 disabled = pythonOlder "3.6";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-8rRp0fA99PUYc8sEBqJLVs30qDX8WqlWB3b8Y2uLNEk=";
26 };
27
28 # upstream seems in flux for 0.13 release. they seem to want to migrate from
29 # jupyter_packaging to hatch, so let's patch instead of fixing upstream
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace "jupyter_packaging~=" "jupyter_packaging>=" \
33 --replace "jupyterlab~=" "jupyterlab>="
34 '';
35
36 nativeBuildInputs = [
37 jupyter-packaging
38 jupyterlab
39 ];
40
41 propagatedBuildInputs = [
42 bqscales
43 ipywidgets
44 numpy
45 pandas
46 traitlets
47 traittypes
48 ];
49
50 # no tests in PyPI dist, and not obvious to me how to build the js files from GitHub
51 doCheck = false;
52
53 pythonImportsCheck = [
54 "bqplot"
55 "bqplot.pyplot"
56 ];
57
58 meta = {
59 description = "2D plotting library for Jupyter based on Grammar of Graphics";
60 homepage = "https://bqplot.github.io/bqplot";
61 license = lib.licenses.asl20;
62 maintainers = with lib.maintainers; [ bcdarwin ];
63 };
64}