Commit graph

13088 commits

Author SHA1 Message Date
Serene
e999987300
Add missed HAVE_REFLINK in test_files.py (#5272) 2024-06-02 14:51:29 +10:00
Serene
4c334ef9e7
Fix formatting of version to please the formatting CI (#5279) 2024-06-02 14:48:50 +10:00
Serene-Arc
d8165aa757
Fix formatting 2024-06-02 14:47:45 +10:00
Serene
731acd848c
Add timeout argument to all requests calls (#5262) 2024-06-02 14:44:28 +10:00
Kirill A. Korinsky
938628b094
Add missed HAVE_REFLINK in test_files.py 2024-05-30 14:09:37 +02:00
Serene
1fba18054a
Fix changelog version (#5270) 2024-05-30 14:26:34 +10:00
Serene-Arc
6edd80a1d5
Fix changelog version 2024-05-30 14:21:30 +10:00
Serene-Arc
33ab22db8c Increment version numbers to 2.0.0 2024-05-30 04:05:25 +00:00
Serene
b88c09720c
Add a workflow for easily creating releases (#4952)
I humbly present a solution our lack of releases: a workflow that can be
triggered to automatically create one. This workflow builds the project,
creates a GitHub release, and publishes beets to PyPi, for a one-stop
solution.

@sampsyo this would make it much easier to create releases, as it
requires only one little interaction: going to the actions tab and
entering a version number. Once that's done, the workflow should take
care of the rest.

I have only tested the `build` job so far, since I can't do anything
about the pypi or do a release just to test, but the code is lifted from
other similar actions and should work fine.

It also requires one piece of setup. This is that PyPi must be set up
with a [trusted publisher](https://docs.pypi.org/trusted-publishers/) to
receive the new package. Once that's done, the process should go off
automatically.
2024-05-30 08:57:02 +10:00
Lev Gorodetskiy
2a4cf0d335
Codestyle 2024-05-26 11:57:24 -03:00
Lev Gorodetskiy
53d72c14ea
Update changelog 2024-05-25 12:28:08 -03:00
Lev Gorodetskiy
2130404217
Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
Šarūnas Nejus
c75f07a0da Define paths to lint in mypy configuration 2024-05-07 21:16:24 +01:00
Šarūnas Nejus
1713011089 Move mypy configuration to setup.cfg 2024-05-07 21:16:24 +01:00
Šarūnas Nejus
e9ce625879
Dedupe get_attribute_converter 2024-05-07 21:15:00 +01:00
Šarūnas Nejus
c1518dbf38
Test fetching each of the documents 2024-05-07 21:14:59 +01:00
Šarūnas Nejus
6ee734685d
Feed in app context and args into Document to allow testing
This will be help with testing each of the documents which do not
any more depend on the 'global' `current_app` and `request`. These two
can now be provided at the time the objects are instantiated.
2024-05-07 19:55:02 +01:00
Šarūnas Nejus
4e07b941f7
Make a random change for testing 2024-05-07 16:28:28 +01:00
Šarūnas Nejus
0e0d9f133f
Use 'pull_request_target' event for the changelog update reminder
See https://github.com/marketplace/actions/comment-pull-request#permissions
for more details.

Additionally, refactor the workflow into a more canonical form utilising
the `tj-actions/changed-files` GitHub action.
2024-05-07 16:28:18 +01:00
Benedikt
329098a0b4
Merge pull request #5220 from snejus/improve-build-output-and-coverage
Improve GitHub build output and configure coverage
2024-05-04 12:21:51 +02:00
Šarūnas Nejus
cdaefe698c
Show diff when isort or black fails 2024-05-04 10:24:28 +01:00
Šarūnas Nejus
8b4983fe7c
Add pytest and coverage configuration
Add `pytest-cov` which automatically measures coverage while tests are
executing and update tox and ci build configuration accordingly.

Add configuration for coverage:
  1. Enable analysing logical branches
  2. Save coverage details as HTML for local development use
  3. Configure the HTML output to include coverage context: on the
     right-hand side of each covered code line there is an expandable
     section which lists every test that ran that line.
2024-05-04 10:24:28 +01:00
Šarūnas Nejus
34a59f98b3
Merge pull request #5210 from snejus/add-in-query-and-remove-named-query
Enforce the same interface across all `...Query` implementations

### Make `PlaylistQuery` a `FieldQuery`
While working on the DB optimization and looking at updates upstream I discovered one query which does not follow the `FieldQuery` interface —`PlaylistQuery`, so I looked into it in more detail and ended up integrating it as a `FieldQuery`.

One special thing about it is that it uses **IN** SQL operator, so I added implementation for this sort of query outside the playlist context, see `InQuery`.

Otherwise, it seems like `PlaylistQuery` is a field query with a special way of resolving values it wants to query. In the future, we may want to consider moving this kind of custom _initialization_ logic away from `init` methods to factory/@classmethod: this should make it more clear that the purpose of such logic is to resolve the data that is required to define a particular `FieldQuery` class fully.


### Remove `NamedQuery` since it is unused

This simplifies query parsing logic in `queryparse.py`. We know that this logic can only receive `FieldQuery` classes thus I adjusted types and removed the logic that handles other cases.

Effectively, this means that the query parsing logic does not need to care whether the query is named by the corresponding DB field. Instead, queries like `SingletonQuery` and `PlaylistQuery` are initialized with the same data as others and take things from there themselves: in this case they translate `singleton` and `playlist` queries to the underlying DB filters.
2024-05-01 16:36:52 +01:00
Šarūnas Nejus
b5e98b59f2
Configure mypy to require types for generics 2024-04-30 22:20:37 +01:00
Šarūnas Nejus
7d636d8f22
Add support for a specific type in InQuery 2024-04-30 22:20:36 +01:00
Šarūnas Nejus
a57c164348
Remove NamedQuery
Remove 'NamedQuery' since it is not being used by any queries any more.

This simplifies query parsing logic in 'queryparse.py'. We know that
this logic can only receive 'FieldQuery' thus I adjusted types and
removed the logic that handles other cases.

Effectively, this means that the query parsing logic does not any more
care whether the query is named by the corresponding DB field. Instead,
queries like 'SingletonQuery' and 'PlaylistQuery' are responsible for
translating 'singleton' and 'playlist' to the underlying DB filters.
2024-04-30 22:20:36 +01:00
Šarūnas Nejus
68eee96c03
Define InQuery and use it in PlaylistQuery
While working on the DB optimisation I discovered one query which does
not follow the 'FieldQuery' interface - 'PlaylistQuery', so I looked
into it in more detail.

One special thing about it is that it uses 'IN' SQL operator, so
I defined 'InQuery' query class to have this logic outside of the
playlist context.

Otherwise, it seems like 'PlaylistQuery' is a field query, even if it
has a very special way of resolving values it wants to query. In the
future, we may want to consider moving this kind of custom
_initialisation_ logic away from '__init__' methods to
factory/@classmethod: this should make it more clear that the purpose of
such logic is to resolve the data that is required to define
a particular FieldQuery class fully.
2024-04-30 22:20:36 +01:00
Šarūnas Nejus
4354ba4f97
Merge pull request #5214 from beetbox/handle-null-path
Handle NULL values in the path column
2024-04-30 19:53:26 +01:00
Šarūnas Nejus
065f091656
Handle NULL values in the path column
As I was devving, I did something wrong and had 'beet mv' command fail on me.

Later, having spent an hour investigating why beets kept throwing me
'User-defined function raised exception' I discovered that it was
failing because that previous 'beet mv' command ended up writing value
'NULL' in one of the items 'path' column. This was not handled well by
the 'BYTELOWER' implementation.

Since we do not have a NOT NULL constraint for the 'path' column, it's
best to insure ourselves against this kind of stuff anyways.
2024-04-30 17:13:17 +01:00
Serene
92fb830559
Merge pull request #5212 from wisp3rwind/lyrics-cleanup
lyrics: remove version switch that became obsolete when we dropped Python 3.5
2024-04-28 19:13:18 +10:00
wisp3rwind
a9423b7b2d lyrics: remove version switch that became obsolete when we dropped Python 3.5 2024-04-27 16:02:26 +02:00
Serene
7543a351ed
Merge pull request #5184 from freddiewanah/master
Enhancement: Refactor Test Code for Efficiency and Quality
2024-04-21 09:06:38 +10:00
Han Wang
f46bbbdb60 Revert back to time.sleep
Signed-off-by: Han Wang <freddie.wanah@gmail.com>
2024-04-20 21:33:35 +01:00
J0J0 Todos
d510177820
Merge pull request #5121 from mgoltzsche/generate-playlist-item-attributes 2024-04-20 08:04:32 +02:00
Max Goltzsche
2e9308f713
docs: mention autogenre plugin 2024-04-20 05:33:48 +02:00
Max Goltzsche
2821eac973
docs: add smartplaylist example config and m3u 2024-04-20 05:33:20 +02:00
Han Wang
e2cef11249 reformat test file to pass the formatting check.
Signed-off-by: Han Wang <freddie.wanah@gmail.com>
2024-04-18 20:25:08 +01:00
Serene
3adca9769b
Merge pull request #5191 from ktetzlaff/config-edit--prefer-visual-over-editor
Prefer VISUAL environment variable over EDITOR (for e.g. `beet config -e`)
2024-04-16 12:47:48 +10:00
ktetzlaff
b47635dc29 Prefer VISUAL environment variable over EDITOR
When unix tools make use of an external editor, they typically check the
environment variable VISUAL and fall back to EDITOR. This commit adds the
additional check for VISUAL to the existing EDITOR check (where VISUAL is
preferred over EDITOR).
2024-04-14 12:15:30 +02:00
Serene
125f26fdb1
Merge pull request #5160 from Dr-Blank/bug-unimported-failing-to-ignore-subdirectories 2024-04-14 12:58:53 +10:00
Max Goltzsche
3c6309fe22
docs: mention Beetstream and webrouter plugins
Also, moves the webm3u plugin link from tne interoperability section to the "Other Plugins" section of the documentation.
2024-04-13 04:55:43 +02:00
Max Goltzsche
883bbb3e4b
smartplaylist: rename output format m3u8 to extm3u 2024-04-13 04:55:43 +02:00
Max Goltzsche
c0afd3eb3c
smartplaylist: allow exporting item fields
Allow generating extm3u playlists so that they contain additional item fields such as the `id`.

The feature is required by the mgoltzsche/beets-webm3u plugin (M3U server) to transform playlists using a request based item URI template which may require additional fields such as the `id`, e.g. `beets:library:track;$id`.
2024-04-13 04:55:37 +02:00
Dr-Blank
57677bd7e6
try return path itself to avoid side effects 2024-04-12 07:36:26 -04:00
Serene
cc941df025
Merge pull request #5187 from Dr-Blank/missing-changelog 2024-04-12 21:10:50 +10:00
Serene
5793635a39
Remove redundant checks
Co-authored-by: Dr.Blank <64108942+Dr-Blank@users.noreply.github.com>
2024-04-12 11:28:05 +10:00
Dr-Blank
dc0b46d0cb
merge #5186 2024-04-11 14:17:24 -04:00
Dr-Blank
c3e922e2d2
missing changelog for #5153 2024-04-11 14:12:46 -04:00
Dr-Blank
6a27a8de3c
satisfy the linter 2024-04-11 13:42:56 -04:00
Dr-Blank
ada2f80de6
add changelog entry for bug-fix 2024-04-11 13:05:46 -04:00