Merge pull request #426 from pylast/pre-commit-ci-update-config
This commit is contained in:
commit
f0ea480334
|
@ -6,17 +6,17 @@ repos:
|
||||||
args: [--py37-plus]
|
args: [--py37-plus]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.12.0
|
rev: 23.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: [--target-version=py37]
|
args: [--target-version=py37]
|
||||||
|
|
||||||
- repo: https://github.com/asottile/blacken-docs
|
- repo: https://github.com/asottile/blacken-docs
|
||||||
rev: v1.12.1
|
rev: 1.13.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: blacken-docs
|
- id: blacken-docs
|
||||||
args: [--target-version=py37]
|
args: [--target-version=py37]
|
||||||
additional_dependencies: [black==22.12.0]
|
additional_dependencies: [black==23.3.0]
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
rev: 5.12.0
|
rev: 5.12.0
|
||||||
|
@ -30,7 +30,7 @@ repos:
|
||||||
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
rev: v1.9.0
|
rev: v1.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: python-check-blanket-noqa
|
- id: python-check-blanket-noqa
|
||||||
|
|
||||||
|
@ -45,17 +45,17 @@ repos:
|
||||||
- id: requirements-txt-fixer
|
- id: requirements-txt-fixer
|
||||||
|
|
||||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||||
rev: 0.4.1
|
rev: 0.9.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyproject-fmt
|
- id: pyproject-fmt
|
||||||
|
|
||||||
- repo: https://github.com/abravalheri/validate-pyproject
|
- repo: https://github.com/abravalheri/validate-pyproject
|
||||||
rev: v0.10.1
|
rev: v0.12.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: validate-pyproject
|
- id: validate-pyproject
|
||||||
|
|
||||||
- repo: https://github.com/tox-dev/tox-ini-fmt
|
- repo: https://github.com/tox-dev/tox-ini-fmt
|
||||||
rev: 0.5.2
|
rev: 1.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: tox-ini-fmt
|
- id: tox-ini-fmt
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,6 @@ license = {text = "Apache-2.0"}
|
||||||
maintainers = [{name = "Hugo van Kemenade"}]
|
maintainers = [{name = "Hugo van Kemenade"}]
|
||||||
authors = [{name = "Amr Hassan <amr.hassan@gmail.com> and Contributors", email = "amr.hassan@gmail.com"}]
|
authors = [{name = "Amr Hassan <amr.hassan@gmail.com> and Contributors", email = "amr.hassan@gmail.com"}]
|
||||||
requires-python = ">=3.7"
|
requires-python = ">=3.7"
|
||||||
dependencies = [
|
|
||||||
"httpx",
|
|
||||||
'importlib-metadata; python_version < "3.8"',
|
|
||||||
]
|
|
||||||
dynamic = [
|
|
||||||
"version",
|
|
||||||
]
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"License :: OSI Approved :: Apache Software License",
|
"License :: OSI Approved :: Apache Software License",
|
||||||
|
@ -42,6 +35,13 @@ classifiers = [
|
||||||
"Topic :: Multimedia :: Sound/Audio",
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
]
|
]
|
||||||
|
dynamic = [
|
||||||
|
"version",
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"httpx",
|
||||||
|
'importlib-metadata; python_version < "3.8"',
|
||||||
|
]
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
tests = [
|
tests = [
|
||||||
"flaky",
|
"flaky",
|
||||||
|
@ -50,13 +50,11 @@ tests = [
|
||||||
"pytest-random-order",
|
"pytest-random-order",
|
||||||
"pyyaml",
|
"pyyaml",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Changelog = "https://github.com/pylast/pylast/releases"
|
Changelog = "https://github.com/pylast/pylast/releases"
|
||||||
Homepage = "https://github.com/pylast/pylast"
|
Homepage = "https://github.com/pylast/pylast"
|
||||||
Source = "https://github.com/pylast/pylast"
|
Source = "https://github.com/pylast/pylast"
|
||||||
|
|
||||||
|
|
||||||
[tool.hatch]
|
[tool.hatch]
|
||||||
version.source = "vcs"
|
version.source = "vcs"
|
||||||
|
|
||||||
|
|
|
@ -546,7 +546,6 @@ class _Network:
|
||||||
context=None,
|
context=None,
|
||||||
mbid=None,
|
mbid=None,
|
||||||
):
|
):
|
||||||
|
|
||||||
"""Used to add a track-play to a user's profile.
|
"""Used to add a track-play to a user's profile.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
@ -600,7 +599,6 @@ class _Network:
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
for i in range(len(tracks_to_scrobble)):
|
for i in range(len(tracks_to_scrobble)):
|
||||||
|
|
||||||
params[f"artist[{i}]"] = tracks_to_scrobble[i]["artist"]
|
params[f"artist[{i}]"] = tracks_to_scrobble[i]["artist"]
|
||||||
params[f"track[{i}]"] = tracks_to_scrobble[i]["title"]
|
params[f"track[{i}]"] = tracks_to_scrobble[i]["title"]
|
||||||
|
|
||||||
|
@ -621,7 +619,6 @@ class _Network:
|
||||||
}
|
}
|
||||||
|
|
||||||
for arg in additional_args:
|
for arg in additional_args:
|
||||||
|
|
||||||
if arg in tracks_to_scrobble[i] and tracks_to_scrobble[i][arg]:
|
if arg in tracks_to_scrobble[i] and tracks_to_scrobble[i][arg]:
|
||||||
if arg in args_map_to:
|
if arg in args_map_to:
|
||||||
maps_to = args_map_to[arg]
|
maps_to = args_map_to[arg]
|
||||||
|
@ -736,7 +733,6 @@ class LibreFMNetwork(_Network):
|
||||||
username: str = "",
|
username: str = "",
|
||||||
password_hash: str = "",
|
password_hash: str = "",
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
name="Libre.fm",
|
name="Libre.fm",
|
||||||
homepage="https://libre.fm",
|
homepage="https://libre.fm",
|
||||||
|
|
|
@ -47,7 +47,6 @@ def _no_xfail_rerun_filter(err, name, test, plugin) -> bool:
|
||||||
|
|
||||||
@flaky(max_runs=3, min_passes=1, rerun_filter=_no_xfail_rerun_filter)
|
@flaky(max_runs=3, min_passes=1, rerun_filter=_no_xfail_rerun_filter)
|
||||||
class TestPyLastWithLastFm(PyLastTestCase):
|
class TestPyLastWithLastFm(PyLastTestCase):
|
||||||
|
|
||||||
secrets = None
|
secrets = None
|
||||||
|
|
||||||
def unix_timestamp(self):
|
def unix_timestamp(self):
|
||||||
|
|
15
tox.ini
15
tox.ini
|
@ -1,27 +1,28 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
requires =
|
||||||
|
tox>=4.2
|
||||||
|
env_list =
|
||||||
lint
|
lint
|
||||||
py{py3, 311, 310, 39, 38, 37}
|
py{py3, 311, 310, 39, 38, 37}
|
||||||
isolated_build = true
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
passenv =
|
extras =
|
||||||
|
tests
|
||||||
|
pass_env =
|
||||||
FORCE_COLOR
|
FORCE_COLOR
|
||||||
PYLAST_API_KEY
|
PYLAST_API_KEY
|
||||||
PYLAST_API_SECRET
|
PYLAST_API_SECRET
|
||||||
PYLAST_PASSWORD_HASH
|
PYLAST_PASSWORD_HASH
|
||||||
PYLAST_USERNAME
|
PYLAST_USERNAME
|
||||||
extras =
|
|
||||||
tests
|
|
||||||
commands =
|
commands =
|
||||||
pytest -v -s -W all --cov pylast --cov tests --cov-report term-missing --cov-report xml --random-order {posargs}
|
pytest -v -s -W all --cov pylast --cov tests --cov-report term-missing --cov-report xml --random-order {posargs}
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
passenv =
|
|
||||||
PRE_COMMIT_COLOR
|
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
pre-commit
|
pre-commit
|
||||||
|
pass_env =
|
||||||
|
PRE_COMMIT_COLOR
|
||||||
commands =
|
commands =
|
||||||
pre-commit run --all-files --show-diff-on-failure
|
pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue