1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, GitPython
6, jupyter-packaging
7, jupyter-client
8, jupyterlab
9, markdown-it-py
10, mdit-py-plugins
11, nbformat
12, notebook
13, pytestCheckHook
14, pyyaml
15, toml
16}:
17
18buildPythonPackage rec {
19 pname = "jupytext";
20 version = "1.11.2";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchFromGitHub {
26 owner = "mwouts";
27 repo = pname;
28 rev = "v${version}";
29 hash = "sha256-S2SKAC2oT4VIVMMDbu/Puo87noAgnQs1hh88JphutA8=";
30 };
31
32 buildInputs = [ jupyter-packaging jupyterlab ];
33 propagatedBuildInputs = [
34 markdown-it-py
35 mdit-py-plugins
36 nbformat
37 pyyaml
38 toml
39 ];
40
41 checkInputs = [
42 pytestCheckHook
43 GitPython
44 jupyter-client
45 notebook
46 ];
47 # Tests that use a Jupyter notebook require $HOME to be writable.
48 HOME = "$TMPDIR";
49 # Pre-commit tests expect the source directory to be a Git repository.
50 pytestFlagsArray = [ "--ignore-glob='tests/test_pre_commit_*.py'" ];
51 pythonImportsCheck = [ "jupytext" "jupytext.cli" ];
52
53 meta = with lib; {
54 description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
55 homepage = "https://github.com/mwouts/jupytext";
56 license = licenses.mit;
57 maintainers = with maintainers; [ timokau ];
58 };
59}