about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/bqscales/default.nix
blob: 8b0ebb610ad9d4b2051f08c1041a6e10431ee817 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, hatchling
, jupyter-packaging
, ipywidgets
, numpy
, traitlets
, traittypes
}:

buildPythonPackage rec {
  pname = "bqscales";
  version = "0.3.1";
  format = "pyproject";
  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-C+/GLpqYpePngbn5W0MwvpdmVgFZF7aGHyKMgO5XM90=";
  };

  # We relax dependencies here instead of pulling in a patch because upstream
  # has released a new version using hatch-jupyter-builder, but it is not yet
  # trivial to upgrade to that.
  #
  # Per https://github.com/bqplot/bqscales/issues/76, jupyterlab is not needed
  # as a build dependency right now.
  #
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace '"jupyterlab==3.*",' "" \
      --replace 'jupyter_packaging~=' 'jupyter_packaging>='
  '';

  nativeBuildInputs = [
    hatchling
    jupyter-packaging
  ];

  propagatedBuildInputs = [
    ipywidgets
    numpy
    traitlets
    traittypes
  ];

  # no tests in PyPI dist
  doCheck = false;

  pythonImportsCheck = [ "bqscales" ];

  meta = {
    description = "Grammar of Graphics scales for bqplot and other Jupyter widgets libraries";
    homepage = "https://github.com/bqplot/bqscales";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}