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