commit
d3ba0be1a3
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
|
@ -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: |
|
||||||
|
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -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
18
.github/workflows/require-pr-label.yml
vendored
Normal 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"
|
19
.github/workflows/test.yml
vendored
19
.github/workflows/test.yml
vendored
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -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 ""
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue