diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71c8e2..8f22746 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - main jobs: main: @@ -8,45 +12,40 @@ jobs: 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 }} diff --git a/README.rst b/README.rst index b87958c..9bf0685 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/mopidy_beets/__init__.py b/mopidy_beets/__init__.py index 490a7c2..f56098b 100644 --- a/mopidy_beets/__init__.py +++ b/mopidy_beets/__init__.py @@ -8,7 +8,6 @@ class BeetsExtension(ext.Extension): - dist_name = "Mopidy-Beets" ext_name = "beets" version = __version__ diff --git a/mopidy_beets/browsers/albums.py b/mopidy_beets/browsers/albums.py index 460a959..9db1494 100644 --- a/mopidy_beets/browsers/albums.py +++ b/mopidy_beets/browsers/albums.py @@ -5,7 +5,6 @@ class AlbumsCategoryBrowser(GenericBrowserBase): - field = None sort_fields = None label_fields = None diff --git a/mopidy_beets/client.py b/mopidy_beets/client.py index bedc378..20c96bc 100644 --- a/mopidy_beets/client.py +++ b/mopidy_beets/client.py @@ -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 @@ -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( diff --git a/mopidy_beets/library.py b/mopidy_beets/library.py index c4cabef..674c85b 100644 --- a/mopidy_beets/library.py +++ b/mopidy_beets/library.py @@ -22,7 +22,6 @@ class BeetsLibraryProvider(backend.LibraryProvider): - root_directory = models.Ref.directory( uri="beets:library", name="Beets library" ) @@ -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": diff --git a/pyproject.toml b/pyproject.toml index bff16e0..04a6524 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools >= 30.3.0", "wheel"] [tool.black] -target-version = ["py37", "py38"] +target-version = ["py39", "py310", "py311"] line-length = 80 diff --git a/setup.cfg b/setup.cfg index 29a0e6c..239915c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,9 +14,9 @@ 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 @@ -24,7 +24,7 @@ classifiers = 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 @@ -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 diff --git a/tox.ini b/tox.ini index 7a34a23..b12d0d6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37, py38, py39, check-manifest, flake8 +envlist = py39, py310, py311, check-manifest, flake8 [testenv] sitepackages = true