Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 2026
# Reformat the codebase
d906c2375d78f81fb27083c9042a87e282ad8789
# Fix lint issues
37f25ae3ed9c1d1cfbb4e17025af8c19f27725d5
33 changes: 33 additions & 0 deletions .github/workflows/changelog_reminder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Verify changelog updated

on:
pull_request_target:
types:
- opened
- ready_for_review

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

- name: Get all updated Python files
id: changed-python-files
uses: tj-actions/changed-files@v47
with:
files: |
**.py

- name: Check for the changelog update
id: changelog-update
uses: tj-actions/changed-files@v47
with:
files: docs/changelog.rst

- 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@v3
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 }}'
107 changes: 107 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Lint check
run-name: Lint code
on:
pull_request:
push:
branches:
- master

concurrency:
# Cancel previous workflow run when a new commit is pushed to a feature branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

env:
PYTHON_VERSION: "3.10"

jobs:
changed-files:
runs-on: ubuntu-latest
name: Get changed files
outputs:
any_python_changed: ${{ steps.raw-changed-python-files.outputs.any_changed }}
changed_python_files: ${{ steps.changed-python-files.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v6
- name: Get changed python files
id: raw-changed-python-files
uses: tj-actions/changed-files@v47
with:
files: |
**.py
poetry.lock

- name: Check changed python files
id: changed-python-files
env:
CHANGED_PYTHON_FILES: ${{ steps.raw-changed-python-files.outputs.all_changed_files }}
run: |
if [[ " $CHANGED_PYTHON_FILES " == *" poetry.lock "* ]]; then
# if poetry.lock is changed, we need to check everything
CHANGED_PYTHON_FILES="."
fi
echo "all_changed_files=$CHANGED_PYTHON_FILES" >> "$GITHUB_OUTPUT"

format:
if: needs.changed-files.outputs.any_python_changed == 'true'
runs-on: ubuntu-latest
name: Check formatting
needs: changed-files
steps:
- uses: actions/checkout@v6
- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Install dependencies
run: poetry install

- name: Check code formatting
# the job output will contain colored diffs with what needs adjusting
run: poe check-format --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}

lint:
if: needs.changed-files.outputs.any_python_changed == 'true'
runs-on: ubuntu-latest
name: Check linting
needs: changed-files
steps:
- uses: actions/checkout@v6
- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Install dependencies
run: poetry install

- name: Lint code
run: poe lint --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}

mypy:
if: needs.changed-files.outputs.any_python_changed == 'true'
runs-on: ubuntu-latest
name: Check types with mypy
needs: changed-files
steps:
- uses: actions/checkout@v6
- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Install dependencies
run: poetry install

- name: Type check code
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: mypy
run: poe check-types --show-column-numbers --no-error-summary .
51 changes: 51 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test
on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Run tests
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- name: Setup Python with poetry caching
# poetry cache requires poetry to already be installed, weirdly
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install system dependencies
run: |
sudo apt install --yes --no-install-recommends \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
libchromaprint-tools

- name: Test
run: |-
poetry install
poe test-with-coverage

- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload code coverage
uses: codecov/codecov-action@v5
with:
flags: ${{ matrix.platform}}_python${{ matrix.python-version }}
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
79 changes: 79 additions & 0 deletions .github/workflows/make_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Make a release

on:
workflow_dispatch:
inputs:
version:
description: 'Version of the new release, just as a number with no prepended "v"'
required: true

env:
PYTHON_VERSION: 3.10
NEW_VERSION: ${{ inputs.version }}
NEW_TAG: v${{ inputs.version }}

jobs:
increment-version:
name: Bump version, commit and create tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Bump project version
run: poetry version "${{ env.NEW_VERSION }}"

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

build:
name: Build the distribution package
runs-on: ubuntu-latest
needs: increment-version
steps:
- uses: actions/checkout@v6
with:
ref: ${{ env.NEW_TAG }}

- name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v1.0.3
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Build a binary wheel and a source tarball
run: poetry build

- name: Store the package
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish distribution 📦 to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/pyacoustid
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ in C but portable, and the Web service, which provides fingerprint lookups.
Installation
------------

This library works with Python 2 (2.7+, possibly also 2.6) and Python 3
(3.3+).
This library works with Python 3.10+.

First, install the `Chromaprint`_ fingerprinting library by `Lukáš Lalinský`__.
(The library itself depends on an FFT library, but it's smart enough to use an
Expand Down
Loading
Loading