From 28aee0fde463f1e18dfdba1994e2bdb80833722f Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Mon, 15 Sep 2025 23:56:43 +0200 Subject: [PATCH 1/4] Moved arts.py file into beetsplug namespace as it is not used in core. --- {beets => beetsplug/_utils}/art.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {beets => beetsplug/_utils}/art.py (100%) diff --git a/beets/art.py b/beetsplug/_utils/art.py similarity index 100% rename from beets/art.py rename to beetsplug/_utils/art.py From a796d6d7999b6e579932b96e489cabc609d35638 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Mon, 15 Sep 2025 23:57:15 +0200 Subject: [PATCH 2/4] New import location for art.py --- beetsplug/_utils/__init__.py | 0 beetsplug/convert.py | 3 ++- beetsplug/embedart.py | 3 ++- test/plugins/test_embedart.py | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 beetsplug/_utils/__init__.py diff --git a/beetsplug/_utils/__init__.py b/beetsplug/_utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/beetsplug/convert.py b/beetsplug/convert.py index e9db3592e..102976dd7 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -25,12 +25,13 @@ from string import Template import mediafile from confuse import ConfigTypeError, Optional -from beets import art, config, plugins, ui, util +from beets import config, plugins, ui, util from beets.library import Item, parse_query_string from beets.plugins import BeetsPlugin from beets.util import par_map from beets.util.artresizer import ArtResizer from beets.util.m3u import M3UFile +from beetsplug._utils import art _fs_lock = threading.Lock() _temp_files = [] # Keep track of temporary transcoded files for deletion. diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 1a59e4f9c..cbf40f570 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -20,11 +20,12 @@ from mimetypes import guess_extension import requests -from beets import art, config, ui +from beets import config, ui from beets.plugins import BeetsPlugin from beets.ui import print_ from beets.util import bytestring_path, displayable_path, normpath, syspath from beets.util.artresizer import ArtResizer +from beetsplug._utils import art def _confirm(objs, album): diff --git a/test/plugins/test_embedart.py b/test/plugins/test_embedart.py index 58d2a5f63..734183d3b 100644 --- a/test/plugins/test_embedart.py +++ b/test/plugins/test_embedart.py @@ -23,7 +23,7 @@ from unittest.mock import MagicMock, patch import pytest from mediafile import MediaFile -from beets import art, config, logging, ui +from beets import config, logging, ui from beets.test import _common from beets.test.helper import ( BeetsTestCase, @@ -33,6 +33,7 @@ from beets.test.helper import ( ) from beets.util import bytestring_path, displayable_path, syspath from beets.util.artresizer import ArtResizer +from beetsplug._utils import art from test.test_art_resize import DummyIMBackend From 4ab1bb4df463ef54a066e293661cd8db3c91995f Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 16 Sep 2025 00:03:16 +0200 Subject: [PATCH 3/4] Added changelog and git blame ignore rev --- .git-blame-ignore-revs | 4 +++- docs/changelog.rst | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index fbe32b497..ed86e3f8c 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -70,4 +70,6 @@ d93ddf8dd43e4f9ed072a03829e287c78d2570a2 # Moved dev docs 07549ed896d9649562d40b75cd30702e6fa6e975 # Moved plugin docs Further Reading chapter -33f1a5d0bef8ca08be79ee7a0d02a018d502680d \ No newline at end of file +33f1a5d0bef8ca08be79ee7a0d02a018d502680d +# Moved art.py utility module from beets into beetsplug +a7b69e50108eebef8ce92c015f18a42f8bf7276f \ No newline at end of file diff --git a/docs/changelog.rst b/docs/changelog.rst index 8a35569c9..674f3ff28 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -29,6 +29,9 @@ Other changes: match :bug:`6020` - :doc:`guides/tagger`: Section on no matching release found, related to possibly disabled musicbrainz plugin :bug:`6020` +- Moved ``art.py`` utility module from ``beets`` into ``beetsplug`` namespace as it + is not used in the core beets codebase. It can now be found in + ``beetsplug._utils``. 2.4.0 (September 13, 2025) -------------------------- From 73dc8f2bc74c78fd74d7afc844535fc3b9e64da3 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 16 Sep 2025 00:18:04 +0200 Subject: [PATCH 4/4] fix test by changing patch --- .git-blame-ignore-revs | 2 +- docs/changelog.rst | 4 ++-- test/plugins/test_embedart.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index ed86e3f8c..2ee64a97d 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -72,4 +72,4 @@ d93ddf8dd43e4f9ed072a03829e287c78d2570a2 # Moved plugin docs Further Reading chapter 33f1a5d0bef8ca08be79ee7a0d02a018d502680d # Moved art.py utility module from beets into beetsplug -a7b69e50108eebef8ce92c015f18a42f8bf7276f \ No newline at end of file +28aee0fde463f1e18dfdba1994e2bdb80833722f \ No newline at end of file diff --git a/docs/changelog.rst b/docs/changelog.rst index 674f3ff28..ba6a357b7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -29,8 +29,8 @@ Other changes: match :bug:`6020` - :doc:`guides/tagger`: Section on no matching release found, related to possibly disabled musicbrainz plugin :bug:`6020` -- Moved ``art.py`` utility module from ``beets`` into ``beetsplug`` namespace as it - is not used in the core beets codebase. It can now be found in +- Moved ``art.py`` utility module from ``beets`` into ``beetsplug`` namespace as + it is not used in the core beets codebase. It can now be found in ``beetsplug._utils``. 2.4.0 (September 13, 2025) diff --git a/test/plugins/test_embedart.py b/test/plugins/test_embedart.py index 734183d3b..d40025374 100644 --- a/test/plugins/test_embedart.py +++ b/test/plugins/test_embedart.py @@ -284,7 +284,7 @@ class DummyArtResizer(ArtResizer): @patch("beets.util.artresizer.subprocess") -@patch("beets.art.extract") +@patch("beetsplug._utils.art.extract") class ArtSimilarityTest(unittest.TestCase): def setUp(self): self.item = _common.item()