From 64b3481235a858de6859ce0c6caf3fc48a6c27da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Sun, 12 Jan 2025 01:42:32 +0000 Subject: [PATCH] Take into account Sphinx updates in docs and release script --- docs/conf.py | 4 ++-- extra/release.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 904aacdc0..a1995ce1d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,7 +5,7 @@ AUTHOR = "Adrian Sampson" extensions = ["sphinx.ext.autodoc", "sphinx.ext.extlinks"] exclude_patterns = ["_build"] -source_suffix = ".rst" +source_suffix = {".rst": "restructuredtext"} master_doc = "index" project = "beets" @@ -66,7 +66,7 @@ html_theme_options = { "logo": { "text": "beets", }, - "pygment_light_style": "bw", + "pygments_light_style": "bw", } html_title = "beets" html_logo = "_static/beets_logo_nobg.png" diff --git a/extra/release.py b/extra/release.py index e1c036b28..81e012968 100755 --- a/extra/release.py +++ b/extra/release.py @@ -46,6 +46,8 @@ class Ref(NamedTuple): Each line has the following structure: [optional title : ] + See the output of + python -m sphinx.ext.intersphinx docs/_build/html/objects.inv """ if len(line_parts := line.split(" ", 1)) == 1: return cls(line, None, None) @@ -82,10 +84,11 @@ def get_refs() -> dict[str, Ref]: with redirect_stdout(captured_output): intersphinx.inspect_main([str(objects_filepath)]) + lines = captured_output.getvalue().replace("\t", " ").splitlines() return { r.id: r - for ln in captured_output.getvalue().split("\n") - if ln.startswith("\t") and (r := Ref.from_line(ln.strip())) + for ln in lines + if ln.startswith(" ") and (r := Ref.from_line(ln.strip())) }