Commit Graph

14876 Commits

Author SHA1 Message Date
Šarūnas Nejus
3e9ea8ebe8 Refactor template evaluation to handle format strings ONLY
- Handle formats as strings ONLY and evaluate them through a shared
  cached template helper.
- This removes the need for conditional logic that acts on Template
  objects or strings.
2026-07-03 09:56:39 +01:00
Šarūnas Nejus
c90f42dbdb test: move test modules under packages that they belong to (#6775)
- Move test files from the top-level `test/` directory into
package-specific folders like `test/dbcore/`, `test/plugins/`,
`test/util/`, and `test/extra/`.

- Keep test coverage the same, but make the test suite match the
codebase structure more closely. This makes ownership and navigation
clearer, and helps reviewers find related tests faster.

- Add the large file-move commit to `.git-blame-ignore-revs` so `git
blame` stays useful and points at real logic changes instead of this
mechanical reorganization.
2026-06-30 21:54:16 +01:00
Šarūnas Nejus
312a993332 Add last two commits to blame ignore revs 2026-06-30 21:48:43 +01:00
Šarūnas Nejus
aef9c64cb0 Move DummyIMBackend to fixtures 2026-06-30 21:48:40 +01:00
Šarūnas Nejus
900543baca Move test modules under folders that they belong to 2026-06-30 21:48:40 +01:00
Šarūnas Nejus
7002103ee4 test: split test_dbcore.py and test_files.py (#6774)
#### What changed

- Reorganized tests so they live closer to the subsystem they cover:
- query parsing tests moved from `test/test_dbcore.py` to
`test/test_queryparse.py`
- utility/path tests moved from `test/test_files.py` to
`test/test_util.py`
- Added shared lightweight db test fixtures in `beets/test/fixtures.py`,
and updated tests to import `ModelFixture1` and `SortFixture` from
there.
- Added the related refactor commits to `.git-blame-ignore-revs` so `git
blame` stays focused on real logic changes.

#### Why this matters

- The test suite is now structured by responsibility instead of growing
large mixed-purpose test files.
- Shared fixtures remove duplicate dbcore test setup and make cross-file
reuse simpler.
- This lowers coupling between test modules and makes future test
changes easier to find and review.

#### High-level impact

- Test-only refactor; no production behavior changes.
- Improves maintainability, readability, and ownership of the test
architecture.
- Keeps blame history cleaner after the test file split.
2026-06-30 21:48:23 +01:00
Šarūnas Nejus
0dd1725131 Add three commits to blame ignore revs 2026-06-30 21:40:26 +01:00
Šarūnas Nejus
816cddbfd5 Define DB fixtures in a shared place 2026-06-30 21:39:34 +01:00
Šarūnas Nejus
88202493ad Rip out queryparse tests away from test_dbcore 2026-06-30 21:39:34 +01:00
Šarūnas Nejus
b1ae461723 Rip out util tests from test_files 2026-06-30 21:39:34 +01:00
Šarūnas Nejus
8bfcfb1870 Switch to uv (#6535)
I think we've had enough of poetry so I let Claude Code migrate the code
base to `uv`. Let's see.

Fixes: #5783
2026-06-30 12:49:50 +01:00
Šarūnas Nejus
84a558dff5 Pin poethepoet below 0.47.0
See https://github.com/nat-n/poethepoet/issues/408
2026-06-30 12:44:24 +01:00
Šarūnas Nejus
4cfbb0167d Replace pipx tool installs with uv tool
- Use uv tool install for poethepoet in GitHub workflows and contributor docs.
- Recommend uv tool for isolated beets and plugin installs.
2026-06-30 12:44:24 +01:00
Šarūnas Nejus
d6a9b6d7fe Add --locked flag to all uv installs 2026-06-30 12:44:24 +01:00
Šarūnas Nejus
f8bf95e0d9 Add dev dependency group 2026-06-30 12:44:24 +01:00
Šarūnas Nejus
9ba0d723f8 Make docs a dependency group 2026-06-30 12:44:24 +01:00
Šarūnas Nejus
a3547b486c Do not attempt to install linux-specific deps on Windows 2026-06-30 12:44:24 +01:00
Šarūnas Nejus
a4e00380a8 Add a note to the changelog 2026-06-30 12:44:24 +01:00
Šarūnas Nejus
99b5da869d Replace poetry by uv 2026-06-30 12:44:21 +01:00
Sebastian Mohr
dbeba765f0 Remove logging import sideeffect (#6755)
This PR refactors configuration and logging initialization in the beets
UI layer.

Logging is no longer implicitly configured as a side effect of import;
it is now initialized explicitly during UI startup. This allows library
users to fully control logging configuration themselves, and enables
more granular logging setup based on user configuration (future PR).

It also clarifies startup order by deferring heavier initialization
until after logging is available for proper error reporting.

---
This is related to the multi-step efforts to improve logging in beets
https://github.com/beetbox/beets/issues/6553
2026-06-30 13:07:34 +02:00
Sebastian Mohr
a5d17fcc58 Minor fixup: added typehint and improved docstring 2026-06-29 11:38:48 +02:00
Sebastian Mohr
222d132003 Enhanced comment. See thread https://github.com/beetbox/beets/pull/6755#discussion_r3444580358 2026-06-29 11:38:48 +02:00
Sebastian Mohr
289e7e3fe7 Short round of reviews, typo and use logging function. 2026-06-29 11:38:48 +02:00
Sebastian Mohr
3c01762ae6 Ensure default config is read, even on config error. 2026-06-29 11:38:48 +02:00
Sebastian Mohr
44f8445303 Moved early logging error on windows into place where the error
will propagate and log properly.
2026-06-29 11:38:48 +02:00
Sebastian Mohr
15be14c9a5 Moved ui logging setup into own setup/bootstrap function. 2026-06-29 11:38:48 +02:00
Sebastian Mohr
08081f3c44 Remove per-file MIT license headers. (#6777)
## Description

Every `.py` file in the repo carries the full 13-line MIT license text
as a header. The license is already shipped in the distribution, it's in
the top-level `LICENSE` file and included in our sdist/wheels.
Duplicating it across 170+ source files is just noise imo: it pushes the
actual code down, adds nothing for users or contributors, and creates
churn whenever a new file is scaffolded.

This PR strips the headers from all Python files. No functional change,
purely cosmetic cleanup.

```
wheel:  651,685 -> 615,351 bytes  (―36 KB)
sdist: 2,382,290 -> 2,369,828 bytes  (―12 KB)
────
                total: -48 KB
```
2026-06-29 11:38:02 +02:00
Sebastian Mohr
54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Sebastian Mohr
8435084fbd tidal: add cover art support via coverArt relationship (#6743)
## Description

Include `coverArt` in album API requests and parse the `coverArts`
resources from the included array. The `cover_art_url` is passed to
`AlbumInfo(cover_art_url=...)`, which the fetchart plugin uses to
retrieve album art. Falls back to constructing a URL from the cover art
resource ID when no direct URL is available in the API response.
2026-06-29 11:14:57 +02:00
Alok Saboo
60d60eacfb Merge branch 'master' into tidal-coverart 2026-06-27 10:11:11 -04:00
Šarūnas Nejus
37e2a8b38a tests: do not create db backups (#6780)
This updates the test config setup in `beets/test/helper.py` so
`ConfigMixin` always sets `config["create_backup_before_migrations"] =
False`.

Tests no longer create database backups whenever `Database` is
initialised. I saw a significant increase in test durations after #6742
was merged.
2026-06-27 12:16:36 +01:00
Šarūnas Nejus
97b2430b8a Only rely on configuration for db backup conditional 2026-06-27 09:32:37 +01:00
Šarūnas Nejus
5bfa95a025 Set create_backup_before_migrations=False in ConfigMixin 2026-06-27 09:32:37 +01:00
Šarūnas Nejus
59a456e185 tidal: replace AlbumAttributes/TrackAttributes union with Attributes (#6768)
@semohr, as discussed:

- Extracts the Tidal fields shared by albums and tracks into a new
`Attributes` `TypedDict` in `beetsplug/tidal/api_types.py`.

- Updates parser helpers in `beetsplug/tidal/__init__.py` to depend on
`Attributes` instead of the `AlbumAttributes | TrackAttributes` union
when they only read common metadata like title, links, label, and
popularity.

- High-level impact: this reduces duplicated type definitions, makes the
shared contract clearer, and simplifies future changes to common Tidal
metadata without changing album- and track-specific types.
2026-06-27 09:26:18 +01:00
Šarūnas Nejus
609f83e338 tidal: Add missing return types in TidalPlugin 2026-06-27 09:20:38 +01:00
Šarūnas Nejus
3171334f4d Add docs 2026-06-27 09:03:36 +01:00
Šarūnas Nejus
ccccdef8b8 Extract shared Tidal attributes type
- Factor common album and track Tidal fields into a shared
  MediaAttributes TypedDict.
- Use the shared type in parser helpers that only need common Tidal
  metadata.
2026-06-27 09:03:36 +01:00
Sebastian Mohr
4e6e49d9c2 Removed a return. Still a bit complicated but
I don't think there is a way to further optimize.
2026-06-24 14:13:57 -04:00
Alok Saboo
1eecbf3726 update changelog 2026-06-24 14:13:55 -04:00
Alok Saboo
a0f092ff14 fix test_parse_artwork_url placement into TestStaticHelpers class 2026-06-24 14:10:11 -04:00
Alok Saboo
9c39443067 fix changelog formatting 2026-06-24 14:10:11 -04:00
Alok Saboo
01b12dca3b rename CoverArt types to Artwork to match Tidal API 2026-06-24 14:10:11 -04:00
Alok Saboo
26d90bbcfa make cover_art_by_id required and remove broken fallback URL 2026-06-24 14:10:10 -04:00
Alok Saboo
d26cfdedbc fix cover art types and parsing to match API response 2026-06-24 14:03:58 -04:00
Alok Saboo
9ec30f82a0 tidal: fix docstrfmt formatting in tidal.rst 2026-06-24 14:03:58 -04:00
Alok Saboo
28fa210422 tidal: fix mypy docref and dict access
- Fix mypy: avoid {} default in relationships.get() that creates Never type

- Fix doc build: use :doc:\etchart\ instead of :doc:\plugins/fetchart\ from within plugins/ directory
2026-06-24 14:03:58 -04:00
Alok Saboo
23d4edc4d7 tidal: fix mypy errors in cover art parsing
- Make CoverArtAttributes.url NotRequired

- Use direct index access on TypedDict instead of .get() to avoid mypy Never-type inference
2026-06-24 14:03:58 -04:00
Alok Saboo
659ee7df0b add cover art support 2026-06-24 14:03:56 -04:00
Šarūnas Nejus
bf879d5e1e tests: refactor test_sort.py (#6718)
- Consolidates `test/dbcore/test_sort.py` around a smaller set of
parameterized pytest cases instead of many near-duplicate test branches.

- Simplifies the test architecture by:
  - sharing library setup through fixtures,
- expressing sort coverage through query strings instead of separate
sort object permutations,
  - grouping related behavior into broader, table-driven tests.

- Tightens config-related tests to use the `config` fixture, which keeps
sort override assertions local to each test and avoids leaking global
config state.

- Reduces duplicate edge-case coverage for missing fields and mixed
field presence by keeping one clear representative path for each
behavior.

- High-level impact:
  - no production sorting logic changes,
  - same core sort behavior remains covered,
  - test suite becomes easier to read, maintain, and extend,
  - future sort changes should require updating fewer places.
2026-06-24 17:59:02 +01:00
Šarūnas Nejus
de5c690181 Use class-scoped config across the test module 2026-06-24 17:01:19 +01:00