Skip to content

Conversation

@semohr
Copy link
Contributor

@semohr semohr commented Sep 15, 2025

This PR moves the art.py module, which is only used by the plugin architecture, to avoid polluting the main beets namespace.

Added commit where file is moved to the .git-blame-ignore-revs file.

  • Changelog

Summary by Sourcery

Move the plugin-only art module out of the core namespace and into the beetsplug._utils package

Enhancements:

  • Relocate art.py to beetsplug._utils to prevent namespace pollution
  • Update plugin imports in convert and embedart to reference the new art location

Documentation:

  • Add changelog entry for the module relocation

Chores:

  • Add the moved file commit to .git-blame-ignore-revs

Copilot AI review requested due to automatic review settings September 15, 2025 22:11
@semohr semohr requested a review from a team as a code owner September 15, 2025 22:11
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 15, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR reorganizes the art utility by moving it out of the core namespace into the beetsplug._utils package, updates all plugin code and tests to import from the new location, adds the move to .git-blame-ignore-revs, and records the change in the changelog.

File-Level Changes

Change Details Files
Relocate art module to plugin utilities and ignore in blame
  • Move art.py from core to beetsplug/_utils
  • Add entry to .git-blame-ignore-revs for the move
beets/art.py
beetsplug/_utils/art.py
.git-blame-ignore-revs
Update plugin imports to use relocated art
  • Remove imports of art from beets
  • Add imports of art from beetsplug._utils
beetsplug/convert.py
beetsplug/embedart.py
Record change in project changelog
  • Add summary entry for art module relocation
docs/changelog.rst
Adjust tests for new art import path
  • Update test imports to reference beetsplug._utils.art
test/plugins/test_embedart.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves the art.py utility module from the main beets namespace to beetsplug._utils to avoid polluting the core namespace, since it's only used by plugins.

  • Moved art.py module from beets to beetsplug._utils
  • Updated import statements in plugins and tests to use the new location
  • Added changelog entry documenting the namespace change

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/plugins/test_embedart.py Updated import to use new beetsplug._utils.art location
docs/changelog.rst Added changelog entry documenting the module move
beetsplug/embedart.py Updated import to use new beetsplug._utils.art location
beetsplug/convert.py Updated import to use new beetsplug._utils.art location
.git-blame-ignore-revs Added commit hash to ignore list for git blame

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@beetbox beetbox deleted a comment from Copilot AI Sep 15, 2025
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.53%. Comparing base (c56cb69) to head (73dc8f2).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6013   +/-   ##
=======================================
  Coverage   66.52%   66.53%           
=======================================
  Files         117      117           
  Lines       18102    18104    +2     
  Branches     3067     3067           
=======================================
+ Hits        12043    12045    +2     
  Misses       5405     5405           
  Partials      654      654           
Files with missing lines Coverage Δ
beetsplug/_utils/art.py 53.84% <ø> (ø)
beetsplug/convert.py 70.96% <100.00%> (+0.09%) ⬆️
beetsplug/embedart.py 72.03% <100.00%> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@snejus
Copy link
Member

snejus commented Sep 19, 2025

It's only used by plugins - I don't think it belongs under beets core. What about beetsplug/_art.py?

@semohr
Copy link
Contributor Author

semohr commented Sep 19, 2025

Thought initially a shared folder for common beetsplug functions might be useful.We have the same issue with the vfs.py file in #6017.

Am not sure what is more maintainable in the long run. No strong opinion either way as long as it is kinda consistent.

@snejus
Copy link
Member

snejus commented Sep 19, 2025

beets/vfs.py is also only used by plugins, so it should be placed under beetsplug methinks.

@semohr
Copy link
Contributor Author

semohr commented Sep 20, 2025

Glad that we agree here 👍 That's why I started the PRs...

  • ATM the files are placed in beetsplug/_utils/*.py.
  • We can move them if you feel like they should be move

As I said:

Am not sure what is more maintainable in the long run. No strong opinion either way as long as it is kinda consistent.

@snejus
Copy link
Member

snejus commented Sep 20, 2025

Sorry - I'm an idiot. For some reason, I assumed that you moved them under beets/_utils 🤦🏼

@semohr
Copy link
Contributor Author

semohr commented Sep 20, 2025

No worries. I already thought you might have misread it. That's why I clarified 🙃

@semohr semohr enabled auto-merge September 20, 2025 12:05
@semohr semohr merged commit dc4e4e5 into master Sep 20, 2025
19 checks passed
@semohr semohr deleted the move_art branch September 20, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants