about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/jupytext/default.nix
blob: 0b893f7776a24e5762752e3efda231a2cc42cf2b (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, GitPython
, jupyter-packaging
, jupyter_client
, jupyterlab
, markdown-it-py
, mdit-py-plugins
, nbformat
, notebook
, pytestCheckHook
, pyyaml
, toml
}:

buildPythonPackage rec {
  pname = "jupytext";
  version = "1.11.2";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "mwouts";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-S2SKAC2oT4VIVMMDbu/Puo87noAgnQs1hh88JphutA8=";
  };

  buildInputs = [ jupyter-packaging jupyterlab ];
  propagatedBuildInputs = [
    markdown-it-py
    mdit-py-plugins
    nbformat
    pyyaml
    toml
  ];

  checkInputs = [
    pytestCheckHook
    GitPython
    jupyter_client
    notebook
  ];
  # Tests that use a Jupyter notebook require $HOME to be writable.
  HOME = "$TMPDIR";
  # Pre-commit tests expect the source directory to be a Git repository.
  pytestFlagsArray = [ "--ignore-glob='tests/test_pre_commit_*.py'" ];
  pythonImportsCheck = [ "jupytext" "jupytext.cli" ];

  meta = with lib; {
    description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
    homepage = "https://github.com/mwouts/jupytext";
    license = licenses.mit;
    maintainers = with maintainers; [ timokau ];
  };
}