Unverified Commit 9a22baaa authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

python3Packages.jupyter-book: 1.0.4 -> 2.1.0 (#468187)

parents 5d49f5b9 c5a97f2a
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  hatchling,
}:

buildPythonPackage rec {
  pname = "hatch-deps-selector";
  version = "0.1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jupyter-book";
    repo = "hatch-deps-selector";
    tag = "v${version}";
    hash = "sha256-AaHVBUDENF3d+yzDt5mvMnfqO+DSYQafMdHNDyEtz2s=";
  };

  build-system = [
    hatchling
  ];

  pythonImportsCheck = [ "hatch_deps_selector" ];

  # No tests
  doCheck = false;

  meta = {
    description = "Select additional dependencies for pyproject.toml from the environment";
    homepage = "https://github.com/jupyter-book/hatch-deps-selector";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+40 −94
Original line number Diff line number Diff line
@@ -2,130 +2,76 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchNpmDeps,

  # build-system
  hatch-deps-selector,
  hatch-jupyter-builder,
  hatch-nodejs-version,
  hatchling,

  # nativeBuildInputs
  nodejs,
  npmHooks,

  # dependencies
  click,
  jinja2,
  jsonschema,
  linkify-it-py,
  myst-nb,
  myst-parser,
  pyyaml,
  sphinx,
  sphinx-comments,
  sphinx-copybutton,
  sphinx-external-toc,
  sphinx-jupyterbook-latex,
  sphinx-design,
  sphinx-thebe,
  sphinx-book-theme,
  sphinx-togglebutton,
  sphinxcontrib-bibtex,
  sphinx-multitoc-numbering,
  jupyter-core,
  jupyter-server,
  ipykernel,
  nodeenv,

  # tests
  jupytext,
  pytest-regressions,
  pytest-xdist,
  pytestCheckHook,
  sphinx-inline-tabs,
  texsoup,
  writableTmpDirAsHomeHook,
  versionCheckHook,
}:

buildPythonPackage rec {
  pname = "jupyter-book";
  version = "1.0.4";
  version = "2.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jupyter-book";
    repo = "jupyter-book";
    tag = "v${version}";
    hash = "sha256-04I9mzJMXCpvMiOeMD/Bg8FiymkRgHf/Yo9C1VcyTsw=";
    hash = "sha256-Wh3ggKbV0mmcIbpIMsF09UH9ZyVOgpYAx4ppTSUHIKo=";
  };

  build-system = [ hatchling ];
  npmDeps = fetchNpmDeps {
    inherit src;
    hash = "sha256-oNTVzpjDb4bXIpuZcO/6f82UfOVxbkMMluwOKaNM5tE=";
  };

  pythonRelaxDeps = [
    "myst-parser"
    "sphinx"
  build-system = [
    hatch-deps-selector
    hatch-jupyter-builder
    hatch-nodejs-version
    hatchling
  ];

  dependencies = [
    click
    jinja2
    jsonschema
    linkify-it-py
    myst-nb
    myst-parser
    pyyaml
    sphinx
    sphinx-comments
    sphinx-copybutton
    sphinx-external-toc
    sphinx-jupyterbook-latex
    sphinx-design
    sphinx-thebe
    sphinx-book-theme
    sphinx-togglebutton
    sphinxcontrib-bibtex
    sphinx-multitoc-numbering
  nativeBuildInputs = [
    nodejs
    npmHooks.npmConfigHook
  ];

  pythonImportsCheck = [
    "jupyter_book"
    "jupyter_book.cli.main"
  # jupyter-book requires node at runtime
  propagatedBuildInputs = [
    nodejs
  ];

  nativeCheckInputs = [
    jupytext
    pytest-regressions
    pytest-xdist
    pytestCheckHook
    sphinx-inline-tabs
    texsoup
    writableTmpDirAsHomeHook
  dependencies = [
    ipykernel
    jupyter-core
    jupyter-server
    nodeenv
  ];

  disabledTests = [
    # touch the network
    "test_create_from_cookiecutter"

    # flaky?
    "test_execution_timeout"

    # require texlive
    "test_toc"
    "test_toc_latex_parts"
    "test_toc_latex_urllink"
  pythonImportsCheck = [ "jupyter_book" ];

    # AssertionError: assert 'There was an error in building your book' in '1'
    "test_build_errors"

    # WARNING: Executing notebook failed: CellExecutionError [mystnb.exec]
    "test_build_dirhtml_from_template"
    "test_build_from_template"
    "test_build_page"
    "test_build_singlehtml_from_template"

    # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Connection object at 0x115dcc9a0>
    # ResourceWarning: unclosed database in <sqlite3.Connection object at 0x115dcc9a0>
    "test_clean_book"
    "test_clean_html"
    "test_clean_html_latex"
    "test_clean_latex"
  ];

  disabledTestPaths = [
    # require texlive
    "tests/test_pdf.py"
  # No python tests
  nativeCheckInputs = [
    versionCheckHook
  ];

  __darwinAllowLocalNetworking = true;
  versionCheckProgramArg = "--version";

  meta = {
    description = "Build a book with Jupyter Notebooks and Sphinx";
+2 −0
Original line number Diff line number Diff line
@@ -6679,6 +6679,8 @@ self: super: with self; {
  hatch-babel = callPackage ../development/python-modules/hatch-babel { };
  hatch-deps-selector = callPackage ../development/python-modules/hatch-deps-selector { };
  hatch-docstring-description =
    callPackage ../development/python-modules/hatch-docstring-description
      { };