From 0e2138914cdefcb1f7d9ce70ea57c4ceca197e26 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 6 Dec 2025 09:01:00 +0000 Subject: [PATCH 1/2] python3Packages.hatch-deps-selector: init at 0.1.2 --- .../hatch-deps-selector/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/python-modules/hatch-deps-selector/default.nix diff --git a/pkgs/development/python-modules/hatch-deps-selector/default.nix b/pkgs/development/python-modules/hatch-deps-selector/default.nix new file mode 100644 index 000000000000..5d9e42e8a5ea --- /dev/null +++ b/pkgs/development/python-modules/hatch-deps-selector/default.nix @@ -0,0 +1,37 @@ +{ + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2261142b1fca..1088b0f44464 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { }; From c5a97f2a7e20d2d6acd1b374b5e0274198da040d Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 5 Dec 2025 18:00:13 +0000 Subject: [PATCH 2/2] python3Packages.jupyter-book: 1.0.4 -> 2.1.0 Diff: https://github.com/jupyter-book/jupyter-book/compare/v1.0.4...v2.1.0 Changelog: https://github.com/jupyter-book/jupyter-book/blob/refs/tags/v2.1.0/CHANGELOG.md --- .../python-modules/jupyter-book/default.nix | 138 ++++++------------ 1 file changed, 42 insertions(+), 96 deletions(-) diff --git a/pkgs/development/python-modules/jupyter-book/default.nix b/pkgs/development/python-modules/jupyter-book/default.nix index 729289a8a4b7..dbfcd863f534 100644 --- a/pkgs/development/python-modules/jupyter-book/default.nix +++ b/pkgs/development/python-modules/jupyter-book/default.nix @@ -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 + ]; + + nativeBuildInputs = [ + nodejs + npmHooks.npmConfigHook + ]; + + # jupyter-book requires node at runtime + propagatedBuildInputs = [ + nodejs ]; 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 + ipykernel + jupyter-core + jupyter-server + nodeenv ]; - pythonImportsCheck = [ - "jupyter_book" - "jupyter_book.cli.main" - ]; + pythonImportsCheck = [ "jupyter_book" ]; + # No python tests nativeCheckInputs = [ - jupytext - pytest-regressions - pytest-xdist - pytestCheckHook - sphinx-inline-tabs - texsoup - writableTmpDirAsHomeHook + versionCheckHook ]; - - disabledTests = [ - # touch the network - "test_create_from_cookiecutter" - - # flaky? - "test_execution_timeout" - - # require texlive - "test_toc" - "test_toc_latex_parts" - "test_toc_latex_urllink" - - # 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: - # ResourceWarning: unclosed database in - "test_clean_book" - "test_clean_html" - "test_clean_html_latex" - "test_clean_latex" - ]; - - disabledTestPaths = [ - # require texlive - "tests/test_pdf.py" - ]; - - __darwinAllowLocalNetworking = true; + versionCheckProgramArg = "--version"; meta = { description = "Build a book with Jupyter Notebooks and Sphinx";