Skip to content
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

Fix Sphinx configuration post-update #5588

Merged
merged 6 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
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
23 changes: 13 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,26 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install ffmpeg gobject-introspection libgirepository1.0-dev pandoc
poetry install --with=release --extras=docs --extras=replaygain --extras=reflink
poe docs
sudo apt install ffmpeg gobject-introspection libcairo2-dev libgirepository1.0-dev pandoc
snejus marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Python dependencies
run: poetry install --only=main,test --extras=autobpm
- name: Add pytest annotator
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: pytest
action: add

- if: ${{ env.IS_MAIN_PYTHON != 'true' }}
name: Test without coverage
run: poe test
run: |
poetry install --extras=autobpm
poe test

- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Test with coverage
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: pytest
run: poe test-with-coverage
run: |
poetry install --extras=autobpm --extras=docs --extras=replaygain --extras=reflink
poe docs
poe test-with-coverage

- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Store the coverage report
Expand Down
10 changes: 2 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extensions = ["sphinx.ext.autodoc", "sphinx.ext.extlinks"]

exclude_patterns = ["_build"]
source_suffix = ".rst"
source_suffix = {".rst": "restructuredtext"}
snejus marked this conversation as resolved.
Show resolved Hide resolved
master_doc = "index"

project = "beets"
Expand Down Expand Up @@ -61,13 +61,7 @@

# Options for pydata theme
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"collapse_navigation": True,
"logo": {
"text": "beets",
},
"pygment_light_style": "bw",
}
html_theme_options = {"collapse_navigation": True, "logo": {"text": "beets"}}
html_title = "beets"
html_logo = "_static/beets_logo_nobg.png"
html_static_path = ["_static"]
Expand Down
10 changes: 6 additions & 4 deletions extra/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def from_line(cls, line: str) -> Ref:
Each line has the following structure:
<id> [optional title : ] <relative-url-path>

See the output of
python -m sphinx.ext.intersphinx docs/_build/html/objects.inv
snejus marked this conversation as resolved.
Show resolved Hide resolved
"""
if len(line_parts := line.split(" ", 1)) == 1:
return cls(line, None, None)
Expand Down Expand Up @@ -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()))
snejus marked this conversation as resolved.
Show resolved Hide resolved
}


Expand Down Expand Up @@ -132,8 +135,7 @@ def make_ref_link(ref_id: str, name: str | None = None) -> str:


MD_REPLACEMENTS: list[Replacement] = [
(r"^ (- )", r"\1"), # remove indent from top-level bullet points
(r"^ +( - )", r"\1"), # adjust nested bullet points indent
(r"<span[^>]+>([^<]+)</span>", r"_\1"), # remove a couple of wild span refs
snejus marked this conversation as resolved.
Show resolved Hide resolved
(r"^(\w[^\n]{,80}):(?=\n\n[^ ])", r"### \1"), # format section headers
(r"^(\w[^\n]{81,}):(?=\n\n[^ ])", r"**\1**"), # and bolden too long ones
(r"### [^\n]+\n+(?=### )", ""), # remove empty sections
Expand Down
8 changes: 4 additions & 4 deletions test/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def rst_changelog():
def md_changelog():
return r"""### New features

- [Substitute Plugin](https://beets.readthedocs.io/en/stable/plugins/substitute.html): Some substitute multi-line change. :bug: (\#5467)
- [Substitute Plugin](https://beets.readthedocs.io/en/stable/plugins/substitute.html): Some substitute multi-line change. :bug: (#5467)
- [list](https://beets.readthedocs.io/en/stable/reference/cli.html#list-cmd) Update.

You can do something with this command:
Expand All @@ -82,9 +82,9 @@ def md_changelog():
- Another fix with its own bullet points using correct indentation:
- First
- Second
- Some fix thanks to @username. :bug: (\#5467)
- Some fix thanks to @username. :bug: (#5467)
- Some fix that mentions user @username.
- Some fix that refers to an issue. :bug: (\#5467)
- Some fix that refers to an issue. :bug: (#5467)
- Some fix with its own bullet points using incorrect indentation:
- First nested bullet point with some text that wraps to the next line
- Second nested bullet point
Expand All @@ -93,7 +93,7 @@ def md_changelog():

### Other changes

- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (\#4855)
- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (#4855)
snejus marked this conversation as resolved.
Show resolved Hide resolved

# 2.1.0 (November 22, 2024)

Expand Down
4 changes: 4 additions & 0 deletions test/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,10 @@ def test_plugin_command_from_pluginpath(self):


@_common.slow_test()
@pytest.mark.xfail(
os.environ.get("GITHUB_ACTIONS") == "true" and sys.platform == "linux",
reason="Completion is for some reason unhappy on Ubuntu 24.04 in CI",
)
snejus marked this conversation as resolved.
Show resolved Hide resolved
class CompletionTest(TestPluginTestCase):
def test_completion(self):
# Do not load any other bash completion scripts on the system.
Expand Down
Loading