diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5bd3973..5002205 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,7 +12,7 @@ on: jobs: deploy: if: github.repository_owner == 'pylast' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -24,7 +24,7 @@ jobs: with: python-version: "3.10" cache: pip - cache-dependency-path: "setup.py" + cache-dependency-path: setup.cfg - name: Install dependencies run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d9014a8..b095963 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch] jobs: lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/require-pr-label.yml b/.github/workflows/require-pr-label.yml new file mode 100644 index 0000000..a2c74d5 --- /dev/null +++ b/.github/workflows/require-pr-label.yml @@ -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" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9dc716..6a63739 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10"] - os: [ubuntu-20.04] - include: - # Include new variables for Codecov - - { codecov-flag: GHA_Ubuntu2004, os: ubuntu-20.04 } + python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"] + os: [ubuntu-latest] steps: - uses: actions/checkout@v2 @@ -25,7 +22,7 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip - cache-dependency-path: "setup.py" + cache-dependency-path: setup.cfg - name: Install dependencies run: | @@ -45,5 +42,13 @@ jobs: - name: Upload coverage uses: codecov/codecov-action@v2 with: - flags: ${{ matrix.codecov-flag }} + flags: ${{ matrix.os }} name: ${{ matrix.os }} Python ${{ matrix.python-version }} + + success: + needs: test + runs-on: ubuntu-latest + name: test successful + steps: + - name: Success + run: echo Test successful diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fd1e6d..b09254b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v2.32.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -35,7 +35,7 @@ repos: - id: python-check-blanket-noqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: check-merge-conflict - id: check-yaml @@ -44,6 +44,7 @@ repos: rev: v1.20.1 hooks: - id: setup-cfg-fmt + args: [--max-py-version=3.11] - repo: https://github.com/tox-dev/tox-ini-fmt rev: 0.5.2 diff --git a/setup.cfg b/setup.cfg index a48f245..5fa2a3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Internet diff --git a/setup.py b/setup.py index 668794a..630d39e 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ 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) to be able to upload to Test PyPI""" return "" diff --git a/tests/test_track.py b/tests/test_track.py index 3430e29..70d2044 100755 --- a/tests/test_track.py +++ b/tests/test_track.py @@ -110,13 +110,13 @@ class TestPyLastTrack(TestPyLastWithLastFm): def test_track_get_duration(self) -> None: # Arrange - track = pylast.Track("Cher", "Believe", self.network) + track = pylast.Track("Radiohead", "Creep", self.network) # Act duration = track.get_duration() # Assert - assert duration >= 200000 + assert duration >= 100000 def test_track_get_album(self) -> None: # Arrange diff --git a/tox.ini b/tox.ini index 48e8339..0f07848 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = lint - py{py3, 310, 39, 38, 37} + py{py3, 311, 310, 39, 38, 37} [testenv] passenv =