about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/ipyvuetify/default.nix
blob: 0a55f0bb4a9308b946419cc7e851b3dd1a86fa40 (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
{ lib
, buildPythonPackage
, fetchPypi
  # Python Inputs
, jupyter-packaging
, jupyterlab
, setuptools
, wheel
, ipyvue
}:

buildPythonPackage rec {
  pname = "ipyvuetify";
  version = "1.9.1";
  pyproject = true;

  # GitHub version tries to run npm (Node JS)
  src = fetchPypi {
    inherit pname version;
    hash = "sha256-MAqO6wREtnaVCgG88UXYsKlLpkizbtPqmeQ9u3UVnU0=";
  };

  # drop pynpm which tries to install node_modules
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "jupyter_packaging~=0.7.9" "jupyter_packaging" \
      --replace-fail "jupyterlab~=3.0" "jupyterlab" \
      --replace-fail '"pynpm"' ""

    substituteInPlace setup.py \
      --replace-fail "from pynpm import NPMPackage" "" \
      --replace-fail "from generate_source import generate_source" "" \
      --replace-fail 'setup(cmdclass={"egg_info": js_prerelease(egg_info)})' 'setup()'
  '';

  nativeBuildInputs = [
    jupyter-packaging
    jupyterlab
    setuptools
    wheel
  ];

  propagatedBuildInputs = [ ipyvue ];

  doCheck = false;  # no tests on PyPi/GitHub
  pythonImportsCheck = [ "ipyvuetify" ];

  meta = with lib; {
    description = "Jupyter widgets based on Vuetify UI Components.";
    homepage = "https://github.com/mariobuikhuizen/ipyvuetify";
    license = licenses.mit;
    maintainers = with maintainers; [ drewrisinger ];
  };
}