Skip to content

Update conf.py to retrieve version numbers for various libraries, so they can be referred to dynamically in various docs #7447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,42 @@ def _get_pyodide_version():
raise NotImplementedError(F"{PYODIDE_VERSION=} is not valid")

def update_versions(app, docname, source):
from panel.models.deckgl import DECKGL_VERSION
from panel.models.echarts import ECHARTS_VERSION
from panel.models.katex import KATEX_VERSION
from panel.models.mathjax import MATHJAX_VERSION
from panel.models.perspective import PERSPECTIVE_VERSION
from panel.models.plotly import PLOTLY_VERSION
from panel.models.pydeck import PYDECK_VERSION
from panel.models.pyecharts import PYECHARTS_VERSION
from panel.models.tabulator import TABULATOR_VERSION
from panel.models.textual import TEXTUAL_VERSION
from panel.models.vega import VEGA_VERSION
from panel.models.vizzu import VIZZU_VERSION
from panel.models.vtk import VTK_VERSION
from panel.models.vtkjs import VTKJS_VERSION

# Inspired by: https://stackoverflow.com/questions/8821511
version_replace = {
"{{PANEL_VERSION}}" : PY_VERSION,
"{{BOKEH_VERSION}}" : BOKEH_VERSION,
"{{PYSCRIPT_VERSION}}" : PYSCRIPT_VERSION,
"{{PYODIDE_VERSION}}" : _get_pyodide_version(),
"{{TABULATOR_VERSION}}" : TABULATOR_VERSION,
"{{VIZZU_VERSION}}" : VIZZU_VERSION,
"{{PANEL_VERSION}}": PY_VERSION,
"{{BOKEH_VERSION}}": BOKEH_VERSION,
"{{PYSCRIPT_VERSION}}": PYSCRIPT_VERSION,
"{{PYODIDE_VERSION}}": _get_pyodide_version(),
"{{ALTAIR_VERSION}}": ALTAIR_VERSION,
"{{DECKGL_VERSION}}": DECKGL_VERSION,
"{{ECHARTS_VERSION}}": ECHARTS_VERSION,
"{{KATEX_VERSION}}": KATEX_VERSION,
"{{MATHJAX_VERSION}}": MATHJAX_VERSION,
"{{PERSPECTIVE_VERSION}}": PERSPECTIVE_VERSION,
"{{PLOTLY_VERSION}}": PLOTLY_VERSION,
"{{PYDECK_VERSION}}": PYDECK_VERSION,
"{{PYECHARTS_VERSION}}": PYECHARTS_VERSION,
"{{TEXTUAL_VERSION}}": TEXTUAL_VERSION,
"{{TABULATOR_VERSION}}": TABULATOR_VERSION,
"{{VEGA_VERSION}}": VEGA_VERSION,
"{{VIZZU_VERSION}}": VIZZU_VERSION,
"{{VTK_VERSION}}": VTK_VERSION,
"{{VTKJS_VERSION}}": VTKJS_VERSION,
}

for old, new in version_replace.items():
Expand Down