scverse-doc 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/CHANGELOG.md +8 -1
  2. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/PKG-INFO +1 -1
  3. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/config.py +50 -27
  4. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.codecov.yaml +0 -0
  5. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.cruft.json +0 -0
  6. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.editorconfig +0 -0
  7. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  8. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  9. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  10. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/dependabot.yml +0 -0
  11. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/autofix.yaml +0 -0
  12. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/build.yaml +0 -0
  13. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/pr.yaml +0 -0
  14. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/release.yaml +0 -0
  15. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/sync.yaml +0 -0
  16. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.github/workflows/test.yaml +0 -0
  17. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.gitignore +0 -0
  18. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.pre-commit-config.yaml +0 -0
  19. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.readthedocs.yaml +0 -0
  20. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.vscode/extensions.json +0 -0
  21. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.vscode/launch.json +0 -0
  22. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/.vscode/settings.json +0 -0
  23. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/LICENSE +0 -0
  24. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/README.md +0 -0
  25. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/biome.jsonc +0 -0
  26. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/pyproject.toml +0 -0
  27. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/scripts/check_changelog.py +0 -0
  28. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/scripts/sync_brand_tokens.py +0 -0
  29. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/__init__.py +0 -0
  30. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/_accents.json +0 -0
  31. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/_color.py +0 -0
  32. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/autodoc/__init__.py +0 -0
  33. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/autodoc/templates/autosummary/class.rst +0 -0
  34. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/autodoc/templates/autosummary/module.rst +0 -0
  35. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/napoleon.py +0 -0
  36. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/py.typed +0 -0
  37. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/registry.py +0 -0
  38. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/release_notes.py +0 -0
  39. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/source.py +0 -0
  40. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/__init__.py +0 -0
  41. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/scverse-ecosystem.html +0 -0
  42. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/scverse-footer.html +0 -0
  43. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/scverse-sidebar-nav.html +0 -0
  44. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/sidebar-versions.html +0 -0
  45. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/toggle-primary-sidebar.html +0 -0
  46. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/components/toggle-secondary-sidebar.html +0 -0
  47. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/layout.html +0 -0
  48. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/static/_tokens.css +0 -0
  49. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/static/scripts/readthedocs-integration.js +0 -0
  50. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/static/scverse-fa.svg +0 -0
  51. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/static/styles/scverse.css +0 -0
  52. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/theme/scverse/theme.toml +0 -0
  53. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/typed_fields.py +0 -0
  54. {scverse_doc-0.2.2 → scverse_doc-0.2.3}/src/scverse_doc/xref_overrides.py +0 -0
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning][].
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ### Added
14
+
15
+ - `scverse_doc.config.DEFAULTS` is now a class (#69)
16
+
17
+ ## [0.2.2]
18
+
13
19
  ### Fixed
14
20
 
15
21
  - run the private-base-skipping code on the real class names in more cases (#66)
@@ -46,7 +52,8 @@ and this project adheres to [Semantic Versioning][].
46
52
  - Read the Docs integration: version selector and search, both with dark mode
47
53
  - Autodoc, prose, and confval rendering extensions (from scverse-misc)
48
54
 
49
- [Unreleased]: https://github.com/scverse/scverse-doc/compare/v0.2.1...main
55
+ [Unreleased]: https://github.com/scverse/scverse-doc/compare/v0.2.2...main
56
+ [0.2.2]: https://github.com/scverse/scverse-doc/releases/tag/v0.2.2
50
57
  [0.2.1]: https://github.com/scverse/scverse-doc/releases/tag/v0.2.1
51
58
  [0.2.0]: https://github.com/scverse/scverse-doc/releases/tag/v0.2.0
52
59
  [0.1.1]: https://github.com/scverse/scverse-doc/releases/tag/v0.1.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scverse-doc
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Scverse documentation theme and utilities.
5
5
  Project-URL: Documentation, https://scverse-doc.readthedocs.io/
6
6
  Project-URL: Homepage, https://github.com/scverse/scverse-doc
@@ -7,7 +7,8 @@ and fills in :data:`DEFAULTS`. Anything set in `conf.py` always wins.
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- from typing import TYPE_CHECKING
10
+ from dataclasses import dataclass, field, fields
11
+ from typing import TYPE_CHECKING, Final
11
12
 
12
13
  from sphinx.util.typing import ExtensionMetadata
13
14
 
@@ -15,11 +16,11 @@ if TYPE_CHECKING:
15
16
  from sphinx.application import Sphinx
16
17
  from sphinx.config import Config
17
18
 
18
- __all__ = ["DEFAULTS", "EXTENSIONS", "MYST_ENABLE_EXTENSIONS", "setup"]
19
+ __all__ = ["DEFAULTS", "EXTENSIONS", "Defaults", "MYST_ENABLE_EXTENSIONS", "setup"]
19
20
 
20
21
  #: Extensions set up alongside this one,
21
22
  #: so packages list only ``scverse_doc``.
22
- EXTENSIONS = (
23
+ EXTENSIONS: Final = (
23
24
  "myst_nb",
24
25
  "sphinx.ext.autodoc",
25
26
  "sphinx.ext.autosummary",
@@ -31,7 +32,7 @@ EXTENSIONS = (
31
32
  )
32
33
 
33
34
  #: The MyST syntax extensions, i.e. the ``myst_enable_extensions`` entry of :data:`~scverse_doc.config.DEFAULTS`.
34
- MYST_ENABLE_EXTENSIONS = (
35
+ MYST_ENABLE_EXTENSIONS: Final = (
35
36
  "amsmath",
36
37
  "colon_fence",
37
38
  "deflist",
@@ -40,28 +41,48 @@ MYST_ENABLE_EXTENSIONS = (
40
41
  "html_admonition",
41
42
  )
42
43
 
43
- #: Sphinx config values applied unless `conf.py` sets them.
44
- DEFAULTS: dict[str, object] = {
45
- "autosummary_generate": True,
46
- "autodoc_member_order": "groupwise",
47
- "napoleon_google_docstring": False,
48
- "napoleon_numpy_docstring": True,
49
- "napoleon_include_init_with_doc": False,
50
- "napoleon_use_param": True,
51
- "napoleon_use_rtype": True,
52
- "default_role": "literal",
53
- "myst_enable_extensions": list(MYST_ENABLE_EXTENSIONS),
54
- "myst_heading_anchors": 6,
55
- "source_suffix": {".rst": "restructuredtext", ".md": "myst-nb", ".ipynb": "myst-nb"},
44
+
45
+ @dataclass(frozen=True)
46
+ class Defaults:
47
+ """Sphinx config values applied unless `conf.py` sets them."""
48
+
49
+ autosummary_generate: bool = True
50
+ autodoc_member_order: str = "groupwise"
51
+ napoleon_google_docstring: bool = False
52
+ napoleon_numpy_docstring: bool = True
53
+ napoleon_include_init_with_doc: bool = False
54
+ napoleon_use_param: bool = True
55
+ napoleon_use_rtype: bool = True
56
+ default_role: str = "literal"
57
+ myst_enable_extensions: list[str] = field(default_factory=list(MYST_ENABLE_EXTENSIONS).copy)
58
+ myst_heading_anchors: int = 6
59
+ source_suffix: dict[str, str] = field(
60
+ default_factory={".rst": "restructuredtext", ".md": "myst-nb", ".ipynb": "myst-nb"}.copy
61
+ )
56
62
  # Off: tutorials needing a GPU or a large download must not gate a docs build.
57
- "nb_execution_mode": "off",
58
- "nb_output_stderr": "remove",
59
- "nb_merge_streams": True,
63
+ nb_execution_mode: str = "off"
64
+ nb_output_stderr: str = "remove"
65
+ nb_merge_streams: bool = True
60
66
  # One unreachable host must not stall the build.
61
- "intersphinx_timeout": 10,
62
- "exclude_patterns": ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"],
63
- "nitpicky": True,
64
- }
67
+ intersphinx_timeout: int = 10
68
+ exclude_patterns: list[str] = field(
69
+ default_factory=["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"].copy
70
+ )
71
+ nitpicky: bool = True
72
+
73
+
74
+ #: Sphinx config values applied unless `conf.py` sets them.
75
+ #:
76
+ #: A frozen :func:`~dataclasses.dataclass` instance:
77
+ #: use :func:`dataclasses.asdict` to get a :class:`dict`.
78
+ #: Access them by name to create variations of their values, e.g.
79
+ #:
80
+ #: .. code-block:: python
81
+ #:
82
+ #: from scverse_doc.config import DEFAULTS
83
+ #:
84
+ #: exclude_patterns = [*DEFAULTS.exclude_patterns, ...]
85
+ DEFAULTS: Final = Defaults()
65
86
 
66
87
 
67
88
  def _is_set_by_user(config: Config, name: str) -> bool:
@@ -71,10 +92,12 @@ def _is_set_by_user(config: Config, name: str) -> bool:
71
92
 
72
93
  def _apply_defaults(config: Config) -> None:
73
94
  """Fill in the values `conf.py` did not set."""
74
- for name, value in DEFAULTS.items():
75
- if _is_set_by_user(config, name):
95
+ # A fresh instance, so builds don’t share (and mutate) the same lists and dicts.
96
+ defaults = Defaults()
97
+ for f in fields(defaults):
98
+ if _is_set_by_user(config, f.name):
76
99
  continue
77
- setattr(config, name, value)
100
+ setattr(config, f.name, getattr(defaults, f.name))
78
101
 
79
102
 
80
103
  def _configure(app: Sphinx, config: Config) -> None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes