Skip to content

Commit

Permalink
Merge pull request #38 from mopidy/jodal/py39+ci
Browse files Browse the repository at this point in the history
Require Python 3.9+ and fix CI
  • Loading branch information
jodal committed Jun 21, 2023
2 parents d5b1b91 + a67a630 commit eeb3b4f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 33 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
name: CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
main:
strategy:
fail-fast: false
matrix:
include:
- name: "Test: Python 3.7"
python: "3.7"
tox: py37
- name: "Test: Python 3.8"
python: "3.8"
tox: py38
- name: "Test: Python 3.9"
python: "3.9"
tox: py39
- name: "Test: Python 3.10"
python: "3.10"
tox: py310
- name: "Test: Python 3.11"
python: "3.11"
tox: py311
coverage: true
- name: "Lint: check-manifest"
python: "3.9"
python: "3.11"
tox: check-manifest
- name: "Lint: flake8"
python: "3.9"
python: "3.11"
tox: flake8

name: ${{ matrix.name }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container: ghcr.io/mopidy/ci:latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- uses: actions/checkout@v3
- name: Fix home dir permissions to enable pip caching
run: chown -R root /github/home
- name: Cache pip
uses: actions/cache@v2
- uses: actions/setup-python@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: setup.cfg
- run: python -m pip install pygobject tox
- run: python -m tox -e ${{ matrix.tox }}
if: ${{ ! matrix.coverage }}
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
if: ${{ matrix.coverage }}
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
if: ${{ matrix.coverage }}
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Mopidy-Beets
:target: https://pypi.org/project/Mopidy-Beets/
:alt: Latest PyPI version

.. image:: https://img.shields.io/github/workflow/status/mopidy/mopidy-beets/CI
.. image:: https://img.shields.io/github/actions/workflow/status/mopidy/mopidy-beets/ci.yml?branch=main
:target: https://github.com/mopidy/mopidy-beets/actions
:alt: CI build status

Expand Down
1 change: 0 additions & 1 deletion mopidy_beets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class BeetsExtension(ext.Extension):

dist_name = "Mopidy-Beets"
ext_name = "beets"
version = __version__
Expand Down
1 change: 0 additions & 1 deletion mopidy_beets/browsers/albums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AlbumsCategoryBrowser(GenericBrowserBase):

field = None
sort_fields = None
label_fields = None
Expand Down
4 changes: 2 additions & 2 deletions mopidy_beets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def quote_and_encode(text):

@cache()
def get_artists(self):
""" returns all artists of one or more tracks """
"""returns all artists of one or more tracks"""
names = self._get("/artist/")["artist_names"]
names.sort()
# remove empty names
Expand All @@ -216,7 +216,7 @@ def get_sorted_unique_album_attributes(self, field):

@cache(ctl=32)
def _get_unique_attribute_values(self, base_url, field, sort_field):
""" returns all artists, genres, ... of tracks or albums """
"""returns all artists, genres, ... of tracks or albums"""
if not hasattr(self, "__legacy_beets_api_detected"):
try:
result = self._get(
Expand Down
3 changes: 1 addition & 2 deletions mopidy_beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@


class BeetsLibraryProvider(backend.LibraryProvider):

root_directory = models.Ref.directory(
uri="beets:library", name="Beets library"
)
Expand Down Expand Up @@ -95,7 +94,7 @@ def search(self, query=None, uris=None, exact=False):

self._validate_query(query)
search_list = []
for (field, values) in query.items():
for field, values in query.items():
for val in values:
# missing / unsupported fields: uri, performer
if field == "any":
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools >= 30.3.0", "wheel"]


[tool.black]
target-version = ["py37", "py38"]
target-version = ["py39", "py310", "py311"]
line-length = 80


Expand Down
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ classifiers =
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Multimedia :: Sound/Audio :: Players


[options]
zip_safe = False
include_package_data = True
packages = find:
python_requires = >= 3.7
python_requires = >= 3.9
install_requires =
Mopidy >= 3.0.0
Pykka >= 2.0.1
Expand Down Expand Up @@ -80,5 +80,7 @@ ignore =
E501
# W503: line break before binary operator (not PEP8 compliant)
W503
# B019: Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks.
B019
# B305: .next() is not a thing on Python 3 (used by playback controller)
B305
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37, py38, py39, check-manifest, flake8
envlist = py39, py310, py311, check-manifest, flake8

[testenv]
sitepackages = true
Expand Down

0 comments on commit eeb3b4f

Please sign in to comment.