Skip to content

Commit 35a817b

Browse files
author
Pierre Ayoub
committed
Merge branch 'master' into pr-fix-convert-not-mediafile
2 parents e773368 + b6d24ec commit 35a817b

File tree

194 files changed

+12097
-14423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+12097
-14423
lines changed

.git-blame-ignore-revs

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# 2014
2+
# flake8-cleanliness in missing
3+
e21c04e9125a28ae0452374acf03d93315eb4381
4+
5+
# 2016
6+
# Removed unicode_literals from library, logging and mediafile
7+
43572f50b0eb3522239d94149d91223e67d9a009
8+
# Removed unicode_literals from plugins
9+
53d2c8d9db87be4d4750ad879bf46176537be73f
10+
# reformat flake8 errors
11+
1db46dfeb6607c164afb247d8da82443677795c1
12+
13+
# 2021
14+
# pyupgrade root
15+
e26276658052947e9464d9726b703335304c7c13
16+
# pyupgrade beets dir
17+
6d1316f463cb7c9390f85bf35b220e250a35004a
18+
# pyupgrade autotag dir
19+
f8b8938fd8bbe91898d0982552bc75d35703d3ef
20+
# pyupgrade dbcore dir
21+
d288f872903c79a7ee7c5a7c9cc690809441196e
22+
# pyupgrade ui directory
23+
432fa557258d9ff01e23ed750f9a86a96239599e
24+
# pyupgrade util dir
25+
af102c3e2f1c7a49e99839e2825906fe01780eec
26+
# fix unused import and flake8
27+
910354a6c617ed5aa643cff666205b43e1557373
28+
# pyupgrade beetsplug and tests
29+
1ec87a3bdd737abe46c6e614051bf9e314db4619
30+
31+
# 2022
32+
# Reformat flake8 config comments
33+
abc3dfbf429b179fac25bd1dff72d577cd4d04c7
34+
35+
# 2023
36+
# Apply formatting tools to all files
37+
a6e5201ff3fad4c69bf24d17bace2ef744b9f51b
38+
39+
# 2024
40+
# Reformat the codebase
41+
85a17ee5039628a6f3cdcb7a03d7d1bd530fbe89
42+
# Fix lint issues
43+
f36bc497c8c8f89004f3f6879908d3f0b25123e1
44+
# Remove some lint exclusions and fix the issues
45+
5f78d1b82b2292d5ce0c99623ba0ec444b80d24c

.github/workflows/ci.yaml

+27-13
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
platform: [ubuntu-latest, windows-latest]
17-
python-version: ["3.8", "3.9"]
17+
python-version: ["3.9"]
1818
runs-on: ${{ matrix.platform }}
1919
env:
20-
IS_MAIN_PYTHON: ${{ matrix.python-version == '3.8' && matrix.platform == 'ubuntu-latest' }}
20+
IS_MAIN_PYTHON: ${{ matrix.python-version == '3.9' && matrix.platform == 'ubuntu-latest' }}
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Install Python tools
@@ -29,26 +29,40 @@ jobs:
2929
python-version: ${{ matrix.python-version }}
3030
cache: poetry
3131

32-
- name: Install PyGobject dependencies on Ubuntu
32+
- name: Install PyGobject and release script dependencies on Ubuntu
3333
if: matrix.platform == 'ubuntu-latest'
3434
run: |
3535
sudo apt update
36-
sudo apt install ffmpeg gobject-introspection libgirepository1.0-dev
37-
poetry install --extras replaygain
36+
sudo apt install ffmpeg gobject-introspection libcairo2-dev libgirepository1.0-dev pandoc
3837
39-
- name: Install Python dependencies
40-
run: poetry install --only=main,test
38+
- name: Get changed lyrics files
39+
id: lyrics-update
40+
uses: tj-actions/changed-files@v45
41+
with:
42+
files: |
43+
beetsplug/lyrics.py
44+
test/plugins/test_lyrics.py
45+
46+
- name: Add pytest annotator
47+
uses: liskin/gh-problem-matcher-wrap@v3
48+
with:
49+
linters: pytest
50+
action: add
4151

4252
- if: ${{ env.IS_MAIN_PYTHON != 'true' }}
4353
name: Test without coverage
44-
run: poe test
54+
run: |
55+
poetry install --extras=autobpm --extras=lyrics
56+
poe test
4557
4658
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
4759
name: Test with coverage
48-
uses: liskin/gh-problem-matcher-wrap@v3
49-
with:
50-
linters: pytest
51-
run: poe test-with-coverage
60+
env:
61+
LYRICS_UPDATED: ${{ steps.lyrics-update.outputs.any_changed }}
62+
run: |
63+
poetry install --extras=autobpm --extras=lyrics --extras=docs --extras=replaygain --extras=reflink
64+
poe docs
65+
poe test-with-coverage
5266
5367
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
5468
name: Store the coverage report
@@ -75,4 +89,4 @@ jobs:
7589
uses: codecov/codecov-action@v4
7690
with:
7791
files: ./coverage.xml
78-
use_oidc: true
92+
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}

.github/workflows/lint.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- master
88

99
env:
10-
PYTHON_VERSION: 3.8
10+
PYTHON_VERSION: 3.9
1111

1212
jobs:
1313
changed-files:
@@ -60,7 +60,7 @@ jobs:
6060
cache: poetry
6161

6262
- name: Install dependencies
63-
run: poetry install --only=format
63+
run: poetry install --only=lint
6464

6565
- name: Check code formatting
6666
# the job output will contain colored diffs with what needs adjusting
@@ -84,10 +84,7 @@ jobs:
8484
run: poetry install --only=lint
8585

8686
- name: Lint code
87-
uses: liskin/gh-problem-matcher-wrap@v3
88-
with:
89-
linters: flake8
90-
run: poe lint ${{ needs.changed-files.outputs.changed_python_files }}
87+
run: poe lint --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}
9188

9289
mypy:
9390
if: needs.changed-files.outputs.any_python_changed == 'true'
@@ -128,13 +125,13 @@ jobs:
128125
cache: poetry
129126

130127
- name: Install dependencies
131-
run: poetry install --only=docs
128+
run: poetry install --extras=docs
132129

133130
- name: Add Sphinx problem matcher
134131
run: echo "::add-matcher::.github/sphinx-problem-matcher.json"
135132

136133
- name: Build docs
137-
run: |
134+
run: |-
138135
poe docs |& tee /tmp/output
139136
# fail the job if there are issues
140137
grep -q " WARNING:" /tmp/output && exit 1 || exit 0

.github/workflows/make_release.yaml

+24-18
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ on:
1010
env:
1111
PYTHON_VERSION: 3.8
1212
NEW_VERSION: ${{ inputs.version }}
13+
NEW_TAG: v${{ inputs.version }}
1314

1415
jobs:
1516
increment-version:
16-
name: Bump project version and commit it
17+
name: Bump version, commit and create tag
1718
runs-on: ubuntu-latest
1819
steps:
1920
- uses: actions/checkout@v4
@@ -28,20 +29,26 @@ jobs:
2829
run: poetry install --only=release
2930

3031
- name: Bump project version
31-
id: script
3232
run: poe bump "${{ env.NEW_VERSION }}"
3333

3434
- uses: EndBug/add-and-commit@v9
35-
name: Commit the changes
35+
id: commit_and_tag
36+
name: Commit the changes and create tag
3637
with:
3738
message: "Increment version to ${{ env.NEW_VERSION }}"
39+
tag: "${{ env.NEW_TAG }} --force"
3840

3941
build:
4042
name: Get changelog and build the distribution package
4143
runs-on: ubuntu-latest
4244
needs: increment-version
45+
outputs:
46+
changelog: ${{ steps.generate_changelog.outputs.changelog }}
4347
steps:
4448
- uses: actions/checkout@v4
49+
with:
50+
ref: ${{ env.NEW_TAG }}
51+
4552
- name: Install Python tools
4653
uses: BrandonLWhite/[email protected]
4754
- uses: actions/setup-python@v5
@@ -50,16 +57,23 @@ jobs:
5057
cache: poetry
5158

5259
- name: Install dependencies
53-
run: poetry install --only=release
60+
run: poetry install --with=release --extras=docs
5461

5562
- name: Install pandoc
5663
run: sudo apt update && sudo apt install pandoc -y
5764

5865
- name: Obtain the changelog
59-
run: echo "changelog=$(poe changelog)" >> $GITHUB_OUTPUT
66+
id: generate_changelog
67+
run: |
68+
poe docs
69+
{
70+
echo 'changelog<<EOF'
71+
poe --quiet changelog
72+
echo EOF
73+
} >> "$GITHUB_OUTPUT"
6074
6175
- name: Build a binary wheel and a source tarball
62-
run: poetry build
76+
run: poe build
6377

6478
- name: Store the distribution packages
6579
uses: actions/upload-artifact@v4
@@ -88,36 +102,28 @@ jobs:
88102
make-github-release:
89103
name: Create GitHub release
90104
runs-on: ubuntu-latest
91-
needs: publish-to-pypi
105+
needs: [build, publish-to-pypi]
92106
env:
93107
CHANGELOG: ${{ needs.build.outputs.changelog }}
94108
steps:
95-
- name: Tag the commit
96-
id: tag_version
97-
uses: mathieudutour/github-tag-action@v6
98-
with:
99-
github_token: ${{ secrets.GITHUB_TOKEN }}
100-
custom_tag: ${{ env.NEW_VERSION }}
101-
102109
- name: Download all the dists
103-
uses: actions/download-artifact@v3
110+
uses: actions/download-artifact@v4
104111
with:
105112
name: python-package-distributions
106113
path: dist/
107114

108115
- name: Create a GitHub release
109116
id: make_release
110117
uses: ncipollo/release-action@v1
111-
env:
112-
NEW_TAG: ${{ steps.tag_version.outputs.new_tag }}
113118
with:
114119
tag: ${{ env.NEW_TAG }}
115120
name: Release ${{ env.NEW_TAG }}
116121
body: ${{ env.CHANGELOG }}
117122
artifacts: dist/*
118123
- name: Send release toot to Fosstodon
119124
uses: cbrgm/mastodon-github-action@v2
125+
continue-on-error: true
120126
with:
121127
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
122128
url: ${{ secrets.MASTODON_URL }}
123-
message: "Version ${{ steps.tag_version.outputs.new_tag }} of beets has been released! Check out all of the new changes at ${{ steps.create_release.outputs.html_url }}"
129+
message: "Version ${{ env.NEW_TAG }} of beets has been released! Check out all of the new changes at ${{ steps.make_release.outputs.html_url }}"

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ ENV/
9191
/.pydevproject
9292
/.settings
9393
.vscode
94+
95+
# pyright
96+
pyrightconfig.json

.pre-commit-config.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33

44
repos:
5-
- repo: https://github.com/psf/black
6-
rev: 24.2.0
5+
- repo: https://github.com/astral-sh/ruff-pre-commit
6+
rev: v0.8.1
77
hooks:
8-
- id: black
9-
10-
- repo: https://github.com/pycqa/isort
11-
rev: 5.13.2
12-
hooks:
13-
- id: isort
14-
name: isort (python)
8+
- id: ruff-format

0 commit comments

Comments
 (0)