Skip to content

Commit

Permalink
Fix docs build (#5492)
Browse files Browse the repository at this point in the history
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?)
```
  • Loading branch information
snejus authored Oct 31, 2024
2 parents f0f87cc + 6180ce1 commit fa10dcf
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test
on:
pull_request_target:
pull_request:
push:
branches:
- master
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Lint check
run-name: Lint code
on:
pull_request_target:
pull_request:
push:
branches:
- master
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
cache: poetry

- name: Install dependencies
run: poetry install --only=docs
run: poetry install --extras=docs

- name: Add Sphinx problem matcher
run: echo "::add-matcher::.github/sphinx-problem-matcher.json"
Expand Down
4 changes: 3 additions & 1 deletion beetsplug/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def get_format(fmt=None):

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


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

Expand All @@ -92,7 +93,8 @@ def in_no_convert(item: Item) -> bool:
return query.match(item)
else:
return False



def should_transcode(item, fmt):
"""Determine whether the item should be transcoded as part of
conversion (i.e., its bitrate is high or it has the wrong format).
Expand Down
35 changes: 18 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ resampy = { version = ">=0.4.3", optional = true }
requests-oauthlib = { version = ">=0.6.1", optional = true }
soco = { version = "*", optional = true }

pydata-sphinx-theme = { version = "*", optional = true }
sphinx = { version = "*", optional = true }

[tool.poetry.group.test.dependencies]
beautifulsoup4 = "*"
codecov = ">=2.1.13"
Expand Down Expand Up @@ -96,10 +99,6 @@ types-PyYAML = "*"
types-requests = "*"
types-urllib3 = "*"

[tool.poetry.group.docs.dependencies]
pydata-sphinx-theme = "*"
sphinx = "*"

[tool.poetry.group.release.dependencies]
click = ">=8.1.7"
packaging = ">=24.0"
Expand All @@ -115,6 +114,7 @@ beatport = ["requests-oauthlib"]
bpd = ["PyGObject"] # python-gi and GStreamer 1.0+
chroma = ["pyacoustid"] # chromaprint or fpcalc
# convert # ffmpeg
docs = ["pydata-sphinx-theme", "sphinx"]
discogs = ["python3-discogs-client"]
embedart = ["Pillow"] # ImageMagick
embyupdate = ["requests"]
Expand Down
5 changes: 2 additions & 3 deletions test/plugins/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
import re
import sys
import unittest
import pytest

import pytest
from mediafile import MediaFile

from beets import util
from beetsplug import convert
from beets.library import Item
from beets.test import _common
from beets.test.helper import (
Expand All @@ -34,6 +33,7 @@
control_stdin,
)
from beets.util import bytestring_path, displayable_path
from beetsplug import convert


def shell_quote(text):
Expand Down Expand Up @@ -352,7 +352,6 @@ class TestNoConvert:
("bitrate:320 , format:ogg", True),
],
)

def test_no_convert_skip(self, config_value, should_skip):
item = Item(format="ogg", bitrate=256)
convert.config["convert"]["no_convert"] = config_value
Expand Down

0 comments on commit fa10dcf

Please sign in to comment.