diff --git a/.cruft.json b/.cruft.json index 03e63efd..ccf07951 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "8c6abe9294f083e19c990f9c8e79d82b0eecbc8d", + "commit": "27f1e4abced9f9b7c557955c3c8ac3344fb542a6", "checkout": null, "context": { "cookiecutter": { @@ -37,7 +37,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "8c6abe9294f083e19c990f9c8e79d82b0eecbc8d" + "_commit": "27f1e4abced9f9b7c557955c3c8ac3344fb542a6" } }, "directory": null diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 67eb948d..91e60fdf 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,7 +4,6 @@ build: os: ubuntu-24.04 tools: python: "3.14" - nodejs: latest jobs: create_environment: - asdf plugin add uv diff --git a/biome.jsonc b/biome.jsonc index 77113ed9..7cf1686f 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -2,6 +2,7 @@ "$schema": "https://biomejs.dev/schemas/2.6.3/schema.json", "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, "formatter": { "useEditorconfig": true }, + "markdown": { "parser": { "frontmatter": true } }, "overrides": [ { "includes": ["./.vscode/*.json", "**/*.jsonc"], diff --git a/docs/_templates/.gitkeep b/docs/_templates/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/conf.py b/docs/conf.py index d6683e3a..55d9f5e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,23 +1,9 @@ # Configuration file for the Sphinx documentation builder. +# `scverse_doc` sets the theme and shared defaults, see https://scverse-doc.readthedocs.io +# For the full list of options, see https://www.sphinx-doc.org/page/usage/configuration.html -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/page/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- -import shutil -import sys from datetime import datetime from importlib.metadata import metadata -from pathlib import Path - -from sphinxcontrib import katex - -HERE = Path(__file__).parent -sys.path.insert(0, str(HERE / "extensions")) - - -# -- Project information ----------------------------------------------------- # NOTE: If you installed your project in editable mode, this might be stale. # If this is the case, reinstall it to refresh the metadata @@ -25,113 +11,28 @@ project = info["Name"] author = info["Author"] copyright = f"{datetime.now():%Y}, {author}." -version = info["Version"] +version = release = info["Version"] urls = dict(pu.split(", ") for pu in info.get_all("Project-URL")) -repository_url = urls["Source"] - -# The full version, including alpha/beta/rc tags -release = info["Version"] +source_repository = urls["Source"] -bibtex_bibfiles = ["references.bib"] -templates_path = ["_templates"] -nitpicky = True # Warn about broken links -needs_sphinx = "4.0" - -html_context = { - "display_github": True, # Integrate GitHub - "github_user": "scverse", - "github_repo": project, - "github_version": "main", - "conf_py_path": "/docs/", -} - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. -# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - "myst_nb", - "sphinx_copybutton", - "sphinx.ext.autodoc", - "sphinx.ext.intersphinx", - "sphinx.ext.autosummary", - "sphinx.ext.napoleon", + "scverse_doc", + "scverse_misc.sphinx_ext", "sphinxcontrib.bibtex", - "sphinxcontrib.katex", "sphinx_autodoc_typehints", - "sphinx_design", "IPython.sphinxext.ipython_console_highlighting", - "sphinxext.opengraph", - "scverse_misc.sphinx_ext", - *[p.stem for p in (HERE / "extensions").glob("*.py")], ] -autosummary_generate = True -autodoc_member_order = "groupwise" -default_role = "literal" -napoleon_google_docstring = False -napoleon_numpy_docstring = True -napoleon_include_init_with_doc = False -napoleon_use_rtype = True # having a separate entry generally helps readability -napoleon_use_param = True -myst_heading_anchors = 6 # create anchors for h1-h6 -myst_enable_extensions = [ - "amsmath", - "colon_fence", - "deflist", - "dollarmath", - "html_image", - "html_admonition", -] -myst_url_schemes = ("http", "https", "mailto") -nb_output_stderr = "remove" -nb_execution_mode = "off" -nb_merge_streams = True +bibtex_bibfiles = ["references.bib"] typehints_defaults = "braces" always_use_bars_union = True # use `|` instead of `Union` in types even when building with Python ≤3.14 -source_suffix = { - ".rst": "restructuredtext", - ".ipynb": "myst-nb", - ".myst": "myst-nb", -} - -intersphinx_mapping = { - "python": ("https://docs.python.org/3", None), - "anndata": ("https://anndata.scverse.org/en/stable/", None), - "scanpy": ("https://scanpy.scverse.org/en/stable/", None), - "numpy": ("https://numpy.org/doc/stable/", None), -} - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_book_theme" html_static_path = ["_static"] html_css_files = ["css/custom.css"] -html_title = project - -html_theme_options = { - "repository_url": repository_url, - "use_repository_button": True, - "path_to_docs": "docs/", - "navigation_with_keys": False, +xref_overrides = { + # If building the documentation fails because a type annotation links to a private path + # (e.g. `igraph._igraph.GraphBase`), map it to the documented name here. + # For a missing link that can’t be fixed this way, add it to `nitpick_ignore` instead. + # "igraph._igraph.GraphBase": "igraph.GraphBase", } - -pygments_style = "default" -katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None - -nitpick_ignore = [ - # If building the documentation fails because of a missing link that is outside your control, - # you can add an exception to this list. - # ("py:class", "igraph.Graph"), -] diff --git a/pyproject.toml b/pyproject.toml index 059c46ab..66a725fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,17 +45,11 @@ test = [ doc = [ "ipykernel", "ipython", - "myst-nb>=1.1", "pandas", - "scverse-misc[sphinx]>=0.1.2", - "sphinx>=8.1", + "scverse-doc[full]>=0.5", + "scverse-misc[sphinx]>=0.1.8", "sphinx-autodoc-typehints", - "sphinx-book-theme>=1", - "sphinx-copybutton", - "sphinx-design", "sphinxcontrib-bibtex>=1", - "sphinxcontrib-katex", - "sphinxext-opengraph", ] typecheck = [ "mypy",