Skip to content

Commit fa10dcf

Browse files
authored
Fix docs build (#5492)
Seems like readthedocs build expects docs dependencies to be available as an extra, see one of the failing builds: https://app.readthedocs.org/projects/beets/builds/26079213/. You can see this has been failing due to missing 'pydata_sphinx_theme' which is one of our dependencies: ``` raise ThemeError(__('no theme named %r found (missing theme.toml?)') % name) sphinx.errors.ThemeError: no theme named 'pydata_sphinx_theme' found (missing theme.toml?) Theme error: no theme named 'pydata_sphinx_theme' found (missing theme.toml?) ```
2 parents f0f87cc + 6180ce1 commit fa10dcf

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test
22
on:
3-
pull_request_target:
3+
pull_request:
44
push:
55
branches:
66
- master

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Lint check
22
run-name: Lint code
33
on:
4-
pull_request_target:
4+
pull_request:
55
push:
66
branches:
77
- master
@@ -125,7 +125,7 @@ jobs:
125125
cache: poetry
126126

127127
- name: Install dependencies
128-
run: poetry install --only=docs
128+
run: poetry install --extras=docs
129129

130130
- name: Add Sphinx problem matcher
131131
run: echo "::add-matcher::.github/sphinx-problem-matcher.json"

beetsplug/convert.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def get_format(fmt=None):
8484

8585
return (command.encode("utf-8"), extension.encode("utf-8"))
8686

87+
8788
def in_no_convert(item: Item) -> bool:
8889
no_convert_query = config["convert"]["no_convert"].as_str()
8990

@@ -92,7 +93,8 @@ def in_no_convert(item: Item) -> bool:
9293
return query.match(item)
9394
else:
9495
return False
95-
96+
97+
9698
def should_transcode(item, fmt):
9799
"""Determine whether the item should be transcoded as part of
98100
conversion (i.e., its bitrate is high or it has the wrong format).

poetry.lock

Lines changed: 18 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ resampy = { version = ">=0.4.3", optional = true }
6767
requests-oauthlib = { version = ">=0.6.1", optional = true }
6868
soco = { version = "*", optional = true }
6969

70+
pydata-sphinx-theme = { version = "*", optional = true }
71+
sphinx = { version = "*", optional = true }
72+
7073
[tool.poetry.group.test.dependencies]
7174
beautifulsoup4 = "*"
7275
codecov = ">=2.1.13"
@@ -96,10 +99,6 @@ types-PyYAML = "*"
9699
types-requests = "*"
97100
types-urllib3 = "*"
98101

99-
[tool.poetry.group.docs.dependencies]
100-
pydata-sphinx-theme = "*"
101-
sphinx = "*"
102-
103102
[tool.poetry.group.release.dependencies]
104103
click = ">=8.1.7"
105104
packaging = ">=24.0"
@@ -115,6 +114,7 @@ beatport = ["requests-oauthlib"]
115114
bpd = ["PyGObject"] # python-gi and GStreamer 1.0+
116115
chroma = ["pyacoustid"] # chromaprint or fpcalc
117116
# convert # ffmpeg
117+
docs = ["pydata-sphinx-theme", "sphinx"]
118118
discogs = ["python3-discogs-client"]
119119
embedart = ["Pillow"] # ImageMagick
120120
embyupdate = ["requests"]

test/plugins/test_convert.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
import re
1919
import sys
2020
import unittest
21-
import pytest
2221

22+
import pytest
2323
from mediafile import MediaFile
2424

2525
from beets import util
26-
from beetsplug import convert
2726
from beets.library import Item
2827
from beets.test import _common
2928
from beets.test.helper import (
@@ -34,6 +33,7 @@
3433
control_stdin,
3534
)
3635
from beets.util import bytestring_path, displayable_path
36+
from beetsplug import convert
3737

3838

3939
def shell_quote(text):
@@ -352,7 +352,6 @@ class TestNoConvert:
352352
("bitrate:320 , format:ogg", True),
353353
],
354354
)
355-
356355
def test_no_convert_skip(self, config_value, should_skip):
357356
item = Item(format="ogg", bitrate=256)
358357
convert.config["convert"]["no_convert"] = config_value

0 commit comments

Comments
 (0)