Skip to content

Rafactored beets/random.py and moved into beetsplug/random.py #5924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

semohr
Copy link
Contributor

@semohr semohr commented Aug 9, 2025

The beets/random.py module was only used by the random plugin, so I moved its functions into beetsplug/random.py to keep core modules cleaner.

Changes:

  • Moved beets/random.py functions into beetsplug/random.py
  • Added typehints for better readability and tooling support
  • Added additional tests for improved coverage
  • General tidy up and refactor, keeping the core functionality unchanged

@Copilot Copilot AI review requested due to automatic review settings August 9, 2025 12:30
@semohr semohr added refactor plugin Pull requests that are plugins related labels Aug 9, 2025

This comment was marked as resolved.

Copy link
Contributor

@Copilot 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 beets/random.py module into beetsplug/random.py to consolidate random functionality with its only consumer, the random plugin, thereby keeping core modules cleaner.

  • Moved all functions from beets/random.py into beetsplug/random.py
  • Added comprehensive type hints for better code clarity and tooling support
  • Enhanced test coverage with additional test cases for edge cases and different functionality modes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
beets/random.py Complete removal of the standalone random module
beetsplug/random.py Integration of moved functions with added type hints and improved implementation
test/plugins/test_random.py Updated import path and added comprehensive test cases for better coverage

@semohr semohr force-pushed the random_move branch 2 times, most recently from 13aa1e0 to daf1136 Compare August 9, 2025 12:34
Copy link

codecov bot commented Aug 9, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.90%. Comparing base (c2d1bc3) to head (3941fd3).

Files with missing lines Patch % Lines
beetsplug/random.py 93.33% 1 Missing and 2 partials ⚠️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@semohr semohr changed the title Moved beets/random.py into beetsplug/random.py Rafactored beets/random.py and moved into beetsplug/random.py Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Pull requests that are plugins related refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants