about summary refs log tree commit diff
path: root/pkgs/development/python-modules/jupyter-book/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/jupyter-book/default.nix')
-rw-r--r--pkgs/development/python-modules/jupyter-book/default.nix63
1 files changed, 53 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/jupyter-book/default.nix b/pkgs/development/python-modules/jupyter-book/default.nix
index 620ca92312088..47e36e157eb10 100644
--- a/pkgs/development/python-modules/jupyter-book/default.nix
+++ b/pkgs/development/python-modules/jupyter-book/default.nix
@@ -1,7 +1,7 @@
 {
   lib,
   buildPythonPackage,
-  fetchPypi,
+  fetchFromGitHub,
   pythonOlder,
   flit-core,
   click,
@@ -22,24 +22,33 @@
   sphinx-togglebutton,
   sphinxcontrib-bibtex,
   sphinx-multitoc-numbering,
+  pytestCheckHook,
+  texsoup,
+  jupytext,
+  pytest-regressions,
+  pytest-xdist,
+  sphinx-inline-tabs,
 }:
 
 buildPythonPackage rec {
   pname = "jupyter-book";
-  version = "1.0.0";
+  version = "1.0.2";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
 
-  src = fetchPypi {
-    inherit version;
-    pname = "jupyter_book";
-    hash = "sha256-U5xdBJNUYgDZ3ie9S1936uoDEV+JN/gl1P+Cs4AamH4=";
+  src = fetchFromGitHub {
+    owner = "jupyter-book";
+    repo = "jupyter-book";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-NlCMfkfvquonqf7FdaJ7AC9ebM7VSifn+zM7gWh32LQ=";
   };
 
-  nativeBuildInputs = [ flit-core ];
+  build-system = [ flit-core ];
 
-  propagatedBuildInputs = [
+  pythonRelaxDeps = [ "myst-parser" ];
+
+  dependencies = [
     click
     jinja2
     jsonschema
@@ -65,12 +74,46 @@ buildPythonPackage rec {
     "jupyter_book.cli.main"
   ];
 
+  nativeCheckInputs = [
+    jupytext
+    pytest-regressions
+    pytest-xdist
+    pytestCheckHook
+    sphinx-inline-tabs
+    texsoup
+  ];
+
+  preCheck = ''
+    export HOME=$TMPDIR
+  '';
+
+  disabledTests = [
+    # touch the network
+    "test_create_from_cookiecutter"
+    # flaky?
+    "test_execution_timeout"
+    # require texlive
+    "test_toc"
+    "test_toc_latex_parts"
+    "test_toc_latex_urllink"
+    # WARNING: Executing notebook failed: CellExecutionError [mystnb.exec]
+    "test_build_dirhtml_from_template"
+    "test_build_from_template"
+    "test_build_page"
+    "test_build_singlehtml_from_template"
+  ];
+
+  disabledTestPaths = [
+    # require texlive
+    "tests/test_pdf.py"
+  ];
+
   meta = with lib; {
     description = "Build a book with Jupyter Notebooks and Sphinx";
     homepage = "https://jupyterbook.org/";
-    changelog = "https://github.com/executablebooks/jupyter-book/blob/v${version}/CHANGELOG.md";
+    changelog = "https://github.com/jupyter-book/jupyter-book/blob/${src.rev}/CHANGELOG.md";
     license = licenses.bsd3;
-    maintainers = with maintainers; [ ];
+    maintainers = teams.jupyter.members;
     mainProgram = "jupyter-book";
   };
 }