Open
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces coupling to beets.autotag package re-exports by switching callers to import symbols directly from their defining modules (beets.autotag.hooks / beets.autotag.match).
Changes:
- Update app code to import
AlbumInfo/TrackInfo/*Match/Proposal/Recommendationdirectly frombeets.autotag.hooksandbeets.autotag.match. - Update plugins to use explicit autotag submodule imports (e.g.,
musicbrainz,deezer,mbsubmit,bench). - Update tests to use the same explicit imports and remove
beets.autotagnamespace usage.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/ui/commands/test_import.py | Switch test imports to beets.autotag.hooks and construct AlbumMatch directly. |
| test/test_importer.py | Replace beets.autotag re-export import with beets.autotag.hooks import. |
| test/plugins/test_mbpseudo.py | Consolidate autotag match/info imports under beets.autotag.hooks. |
| test/plugins/test_art.py | Replace beets.autotag re-export import with beets.autotag.hooks import. |
| test/autotag/test_match.py | Replace beets.autotag.match module import with explicit function imports. |
| test/autotag/test_distance.py | Replace beets.autotag re-export import with beets.autotag.hooks import. |
| beetsplug/musicbrainz.py | Replace beets.autotag.hooks.* references with direct AlbumInfo/TrackInfo imports and type hints. |
| beetsplug/mbsubmit.py | Import Recommendation directly from beets.autotag.match. |
| beetsplug/mbpseudo.py | Update TYPE_CHECKING AlbumMatch import to beets.autotag.hooks. |
| beetsplug/deezer.py | Replace beets.autotag re-export import with beets.autotag.hooks import. |
| beetsplug/bench.py | Replace match.tag_album usage with direct tag_album import/call. |
| beets/ui/commands/import_/session.py | Replace beets.autotag namespace usage with explicit hooks/match imports. |
| beets/ui/commands/import_/display.py | Replace hooks module usage with direct TrackInfo/*Match/Match types from beets.autotag.hooks. |
| beets/importer/tasks.py | Replace autotag.* types/calls with explicit hooks/match imports. |
| beets/autotag/match.py | Stop importing match classes via beets.autotag package surface; import from .hooks directly. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6459 +/- ##
==========================================
- Coverage 69.74% 69.74% -0.01%
==========================================
Files 145 145
Lines 18495 18497 +2
Branches 3007 3007
==========================================
+ Hits 12899 12900 +1
- Misses 4967 4969 +2
+ Partials 629 628 -1
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
beets.autotagnamespace imports with explicit submodule importsThis PR replaces broad
beets.autotagpackage-level imports with direct imports from their canonical submodules (beets.autotag.hooksandbeets.autotag.match).The change reduces implicit coupling to the
beets.autotagre-export surface. Callers now depend on the module that actually defines each symbol, making ownership clear and reducing the risk of circular imports.