From 537a5da3ce3b2e380248ff4eb9a780a1f663b6c0 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:50:20 +0000 Subject: [PATCH] docs: Fill out `versioning` docs --- tools/versioning.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/versioning.py b/tools/versioning.py index d733f1a7a..a4487fa9f 100644 --- a/tools/versioning.py +++ b/tools/versioning.py @@ -14,6 +14,7 @@ >>> VERSIONS # doctest: +SKIP {'vega-datasets': 'v2.11.0', + 'vega-embed': '6', 'vega-lite': 'v5.20.1', 'vegafusion': '1.5.0', 'vl-convert-python': '1.7.0'} @@ -74,6 +75,7 @@ def _keypath(mapping: Mapping[str, Any], path: Iterable[str], /) -> Any: def update_vega_embed() -> None: + """Updates the **Vega-Lite** version used in ``JupyterChart``.""" fp = _REPO_ROOT / _JUPYTER_INDEX embed = VERSIONS["vega-embed"] vega = parse_version(vlc.get_vega_version()).major @@ -89,11 +91,21 @@ def update_vega_embed() -> None: f.writelines(lines) -def inline_versions_literal(name: str) -> Iterable[str]: +def inline_versions_literal(name: str, /) -> Iterable[str]: """ - Write at the bottom of ``altair.utils.schemapi``. + Yields the ``[tool.altair.vega]`` table as an inline ``dict``. - Used in ``altair.utils._importers``. + Includes a type annotation and docstring. + + Parameters + ---------- + name + Variable name for the literal. + + Notes + ----- + - Write at the bottom of ``altair.utils.schemapi``. + - Used in ``altair.utils._importers``. """ ann = f"Mapping[{spell_literal(VERSIONS)}, str]" table = f"[{'.'.join(_TABLE_PATH)}]"