Merge pull request #399 from pylast/add-3.11

Support Python 3.11
This commit is contained in:
Hugo van Kemenade 2022-05-02 18:13:01 +03:00 committed by GitHub
commit d3ba0be1a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 41 additions and 16 deletions

View file

@ -12,7 +12,7 @@ on:
jobs: jobs:
deploy: deploy:
if: github.repository_owner == 'pylast' if: github.repository_owner == 'pylast'
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -24,7 +24,7 @@ jobs:
with: with:
python-version: "3.10" python-version: "3.10"
cache: pip cache: pip
cache-dependency-path: "setup.py" cache-dependency-path: setup.cfg
- name: Install dependencies - name: Install dependencies
run: | run: |

View file

@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]
jobs: jobs:
lint: lint:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

18
.github/workflows/require-pr-label.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Require PR label
on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
mode: minimum
count: 1
labels:
"changelog: Added, changelog: Changed, changelog: Deprecated, changelog:
Fixed, changelog: Removed, changelog: Security, changelog: skip"

View file

@ -11,11 +11,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10"] python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
os: [ubuntu-20.04] os: [ubuntu-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu2004, os: ubuntu-20.04 }
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -25,7 +22,7 @@ jobs:
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: pip cache: pip
cache-dependency-path: "setup.py" cache-dependency-path: setup.cfg
- name: Install dependencies - name: Install dependencies
run: | run: |
@ -45,5 +42,13 @@ jobs:
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
with: with:
flags: ${{ matrix.codecov-flag }} flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} name: ${{ matrix.os }} Python ${{ matrix.python-version }}
success:
needs: test
runs-on: ubuntu-latest
name: test successful
steps:
- name: Success
run: echo Test successful

View file

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.31.1 rev: v2.32.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]
@ -35,7 +35,7 @@ repos:
- id: python-check-blanket-noqa - id: python-check-blanket-noqa
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 rev: v4.2.0
hooks: hooks:
- id: check-merge-conflict - id: check-merge-conflict
- id: check-yaml - id: check-yaml
@ -44,6 +44,7 @@ repos:
rev: v1.20.1 rev: v1.20.1
hooks: hooks:
- id: setup-cfg-fmt - id: setup-cfg-fmt
args: [--max-py-version=3.11]
- repo: https://github.com/tox-dev/tox-ini-fmt - repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2 rev: 0.5.2

View file

@ -18,6 +18,7 @@ classifiers =
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy Programming Language :: Python :: Implementation :: PyPy
Topic :: Internet Topic :: Internet

View file

@ -1,7 +1,7 @@
from setuptools import setup from setuptools import setup
def local_scheme(version) -> str: def local_scheme(version: str) -> str:
"""Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) """Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2)
to be able to upload to Test PyPI""" to be able to upload to Test PyPI"""
return "" return ""

View file

@ -110,13 +110,13 @@ class TestPyLastTrack(TestPyLastWithLastFm):
def test_track_get_duration(self) -> None: def test_track_get_duration(self) -> None:
# Arrange # Arrange
track = pylast.Track("Cher", "Believe", self.network) track = pylast.Track("Radiohead", "Creep", self.network)
# Act # Act
duration = track.get_duration() duration = track.get_duration()
# Assert # Assert
assert duration >= 200000 assert duration >= 100000
def test_track_get_album(self) -> None: def test_track_get_album(self) -> None:
# Arrange # Arrange

View file

@ -1,7 +1,7 @@
[tox] [tox]
envlist = envlist =
lint lint
py{py3, 310, 39, 38, 37} py{py3, 311, 310, 39, 38, 37}
[testenv] [testenv]
passenv = passenv =