Skip to content

Commit

Permalink
Merge branch 'master' into pr-fix-convert-not-mediafile
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreay authored Jul 3, 2024
2 parents 01f39fb + 240c5fc commit a939053
Show file tree
Hide file tree
Showing 125 changed files with 4,903 additions and 1,958 deletions.
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

16 changes: 0 additions & 16 deletions .github/flake8-problem-matcher.json

This file was deleted.

25 changes: 11 additions & 14 deletions .github/sphinx-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "sphinx",
"pattern": [
{
"owner": "sphinx",
"pattern": [
{
"regexp": "^Warning, treated as error:$"
},
{
"regexp": "^(.*?):(\\d+):(.*)$",
"file": 1,
"line": 2,
"message": 3
}
]
"regexp": "^([^:]+):(\\d+): (WARNING: )?(.+)$",
"file": 1,
"line": 2,
"message": 4
}
]
]
}
]
}
28 changes: 14 additions & 14 deletions .github/workflows/changelog_reminder.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Verify changelog updated

on:
pull_request:
pull_request_target:
types:
- opened
- ready_for_review


jobs:
check_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get all updated Python files
id: changed-python-files
uses: tj-actions/changed-files@v44
with:
fetch-depth: 0
files: |
**.py
- name: Get changed files
id: getfile
run: |
echo "Files changed:"
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
echo "$CHANGED_FILES"
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV
echo "$CHANGED_FILES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Check for the changelog update
id: changelog-update
uses: tj-actions/changed-files@v44
with:
files: docs/changelog.rst

- name: Comment PR
- name: Comment under the PR with a reminder
if: steps.changed-python-files.outputs.any_changed == 'true' && steps.changelog-update.outputs.any_changed == 'false'
uses: thollander/actions-comment-pull-request@v2
with:
message: 'Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
if: contains(env.CHANGED_FILES, '.py') && !contains(env.CHANGED_FILES, 'changelog.rst')
141 changes: 51 additions & 90 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,117 +1,78 @@
name: ci
name: Test
on:
push:
branches:
- master
pull_request:
push:
branches:
- master
env:
PY_COLORS: 1

jobs:
test:
runs-on: ${{ matrix.platform }}
name: Run tests
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.x']

python-version: ["3.8", "3.9"]
runs-on: ${{ matrix.platform }}
env:
PY_COLORS: 1

IS_MAIN_PYTHON: ${{ matrix.python-version == '3.8' && matrix.platform == 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- name: Setup Python with poetry caching
# poetry cache requires poetry to already be installed, weirdly
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

# tox fails on Windows if version > 3.8.3
- name: Install base dependencies - Windows
if: matrix.platform == 'windows-latest'
run: |
python -m pip install --upgrade pip
python -m pip install tox==3.8.3 sphinx
- name: Install base dependencies - Ubuntu
if: matrix.platform != 'windows-latest'
run: |
python -m pip install --upgrade pip
python -m pip install tox sphinx
- name: Install optional dependencies
if: matrix.platform != 'windows-latest'
- name: Install PyGobject dependencies on Ubuntu
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install ffmpeg # For replaygain
sudo apt install ffmpeg gobject-introspection libgirepository1.0-dev
poetry install --extras replaygain
- name: Test older Python versions with tox
if: matrix.python-version != '3.x'
run: |
tox -e py-test
- name: Install Python dependencies
run: poetry install --only=main,test

- name: Test latest Python version with tox and get coverage
if: matrix.python-version == '3.x'
run: |
tox -vv -e py-cov
- name: Test latest Python version with tox and mypy
if: matrix.python-version == '3.x'
# continue-on-error is not ideal since it doesn't give a visible
# warning, but there doesn't seem to be anything better:
# https://github.com/actions/toolkit/issues/399
continue-on-error: true
run: |
tox -vv -e py-mypy
- if: ${{ env.IS_MAIN_PYTHON != 'true' }}
name: Test without coverage
run: poe test

- name: Upload code coverage
if: matrix.python-version == '3.x'
run: |
pip install codecov || true
codecov || true
test-docs:
runs-on: ubuntu-latest

env:
PY_COLORS: 1

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v2
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Test with coverage
uses: liskin/gh-problem-matcher-wrap@v3
with:
python-version: '3.x'

- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox sphinx
- name: Add problem matcher
run: echo "::add-matcher::.github/sphinx-problem-matcher.json"
linters: pytest
run: poe test-with-coverage

- name: Build and check docs using tox
run: tox -e docs
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Store the coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .reports/coverage.xml

lint:
upload-coverage:
name: Upload coverage report
needs: test
runs-on: ubuntu-latest

permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.x
uses: actions/setup-python@v2
- name: Get the coverage report
uses: actions/download-artifact@v4
with:
python-version: '3.x'
name: coverage-report

- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox sphinx
- name: Add problem matcher
run: echo "::add-matcher::.github/flake8-problem-matcher.json"

- name: Lint with flake8
run: tox -e py-lint
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
use_oidc: true
14 changes: 0 additions & 14 deletions .github/workflows/formatting_check.yml

This file was deleted.

33 changes: 14 additions & 19 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,29 @@ name: integration tests
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * SUN' # run every Sunday at midnight
- cron: "0 0 * * SUN" # run every Sunday at midnight
jobs:
test_integration:
runs-on: ubuntu-latest

env:
PY_COLORS: 1

steps:
- uses: actions/checkout@v2

- name: Set up latest Python version
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- uses: actions/setup-python@v5
with:
python-version: 3.9-dev
python-version: 3.8
cache: poetry

- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox sphinx
- name: Install dependencies
run: poetry install

- name: Test with tox
run: |
tox -e int
- name: Test
env:
INTEGRATION_TEST: 1
run: poe test

- name: Check external links in docs
run: |
tox -e links
run: poe check-docs-links

- name: Notify on failure
if: ${{ failure() }}
Expand Down
Loading

0 comments on commit a939053

Please sign in to comment.