From 0555d189a32eac7f86121bfd06ac64be1e81dc87 Mon Sep 17 00:00:00 2001 From: eljamm Date: Wed, 17 Jun 2026 18:55:51 +0200 Subject: [PATCH] {python3Packages.,}sphinx-gallery: init at 0.21.0 Assisted-By: nix-init --- pkgs/by-name/sp/sphinx-gallery/package.nix | 3 + .../python-modules/sphinx-gallery/default.nix | 134 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 139 insertions(+) create mode 100644 pkgs/by-name/sp/sphinx-gallery/package.nix create mode 100644 pkgs/development/python-modules/sphinx-gallery/default.nix diff --git a/pkgs/by-name/sp/sphinx-gallery/package.nix b/pkgs/by-name/sp/sphinx-gallery/package.nix new file mode 100644 index 000000000000..1558af239da3 --- /dev/null +++ b/pkgs/by-name/sp/sphinx-gallery/package.nix @@ -0,0 +1,3 @@ +{ python3Packages }: + +python3Packages.toPythonApplication python3Packages.sphinx-gallery diff --git a/pkgs/development/python-modules/sphinx-gallery/default.nix b/pkgs/development/python-modules/sphinx-gallery/default.nix new file mode 100644 index 000000000000..67dcad4afd97 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-gallery/default.nix @@ -0,0 +1,134 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + setuptools-scm, + + # dependencies + pillow, + sphinx, + + # optional-dependencies + absl-py, + graphviz, + intersphinx-registry, + ipython, + joblib, + jupyterlite-sphinx, + lxml, + matplotlib, + mypy, + numpy, + packaging, + plotly, + pydata-sphinx-theme, + pytest, + pytest-cov, + seaborn, + sphinx-design, + statsmodels, + types-docutils, + types-pillow, + memory-profiler, + + # tests + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "sphinx-gallery"; + version = "0.21.0"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "sphinx-gallery"; + repo = "sphinx-gallery"; + tag = "v${finalAttrs.version}"; + hash = "sha256-eWU2xNnguyXi2AZ/PpBp0Pv3IsgL9wQMyPuQpNbn9cY="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + pillow + sphinx + ]; + + optional-dependencies = { + animations = [ + #sphinxcontrib-video + ]; + dev = [ + absl-py + graphviz + intersphinx-registry + ipython + joblib + jupyterlite-sphinx + lxml + matplotlib + mypy + numpy + packaging + plotly + pydata-sphinx-theme + pytest + pytest-cov + seaborn + sphinx-design + #sphinxcontrib-video + statsmodels + types-docutils + types-pillow + #types-pygments + ]; + jupyterlite = [ + jupyterlite-sphinx + ]; + parallel = [ + joblib + ]; + recommender = [ + numpy + ]; + show-api-usage = [ + graphviz + ]; + show-memory = [ + memory-profiler + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + ] + ++ finalAttrs.passthru.optional-dependencies.dev; + + # TODO: + disabledTests = [ + # requires the sphinxcontrib.video package + "test_dummy_image" + # urllib.error.URLError: + "test_embed_code_links_get_data" + ]; + + pythonImportsCheck = [ + "sphinx_gallery" + ]; + + meta = { + description = "Sphinx extension for automatic generation of an example gallery"; + homepage = "https://github.com/sphinx-gallery/sphinx-gallery"; + changelog = "https://github.com/sphinx-gallery/sphinx-gallery/blob/${finalAttrs.src.rev}/CHANGES.rst"; + mainProgram = "sphinx_gallery_py2jupyter"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ eljamm ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5aaf723e57e5..9bff7c953aa8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18593,6 +18593,8 @@ self: super: with self; { sphinx-fortran = callPackage ../development/python-modules/sphinx-fortran { }; + sphinx-gallery = callPackage ../development/python-modules/sphinx-gallery { }; + sphinx-inline-tabs = callPackage ../development/python-modules/sphinx-inline-tabs { }; sphinx-intl = callPackage ../development/python-modules/sphinx-intl { };