Compare commits

..

No commits in common. "main" and "5.3.0" have entirely different histories.
main ... 5.3.0

4 changed files with 58 additions and 60 deletions

View file

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.4.4
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
@ -11,7 +11,7 @@ repos:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.16.0
hooks:
- id: blacken-docs
args: [--target-version=py38]
@ -33,20 +33,21 @@ repos:
exclude: .github/(ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE).md
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
rev: 0.28.4
hooks:
- id: check-github-workflows
- id: check-renovate
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
rev: v1.7.0
hooks:
- id: actionlint
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18

View file

@ -15,16 +15,22 @@ Use the pydoc utility for help on usage or see [tests/](tests/) for examples.
## Installation
Install via pip:
```sh
python3 -m pip install pylast
```
Install latest development version:
```sh
python3 -m pip install -U git+https://git.hirad.it/Hirad/pylast
python3 -m pip install -U git+https://github.com/pylast/pylast
```
Or from requirements.txt:
```txt
-e https://git.hirad.it/Hirad/pylast#egg=pylast
-e https://github.com/pylast/pylast.git#egg=pylast
```
Note:

View file

@ -15,13 +15,9 @@ keywords = [
"scrobble",
"scrobbling",
]
license = { text = "Apache-2.0" }
maintainers = [
{ name = "Hugo van Kemenade" },
]
authors = [
{ name = "Amr Hassan <amr.hassan@gmail.com> and Contributors", email = "amr.hassan@gmail.com" },
]
license = {text = "Apache-2.0"}
maintainers = [{name = "Hugo van Kemenade"}]
authors = [{name = "Amr Hassan <amr.hassan@gmail.com> and Contributors", email = "amr.hassan@gmail.com"}]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
@ -45,16 +41,18 @@ dynamic = [
dependencies = [
"httpx",
]
optional-dependencies.tests = [
[project.optional-dependencies]
tests = [
"flaky",
"pytest",
"pytest-cov",
"pytest-random-order",
"pyyaml",
]
urls.Changelog = "https://github.com/pylast/pylast/releases"
urls.Homepage = "https://github.com/pylast/pylast"
urls.Source = "https://github.com/pylast/pylast"
[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"
@ -62,10 +60,8 @@ version.source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.ruff]
fix = true
lint.select = [
[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"EM", # flake8-errmsg
@ -74,24 +70,19 @@ lint.select = [
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"RUF022", # unsorted-dunder-all
"RUF100", # unused noqa (yesqa)
"RUF022", # unsorted-dunder-all
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
lint.extend-ignore = [
extend-ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]
lint.isort.known-first-party = [
"pylast",
]
lint.isort.required-imports = [
"from __future__ import annotations",
]
[tool.pyproject-fmt]
max_supported_python = "3.13"
[tool.ruff.lint.isort]
known-first-party = ["pylast"]
required-imports = ["from __future__ import annotations"]

View file

@ -1,6 +1,6 @@
#
# pylast -
# A Python interface to Last.fm and music.lonestar.it
# A Python interface to Last.fm and Libre.fm
#
# Copyright 2008-2010 Amr Hassan
# Copyright 2013-2021 hugovk
@ -705,7 +705,7 @@ class LastFMNetwork(_Network):
class LibreFMNetwork(_Network):
"""
A preconfigured _Network object for music.lonestar.it
A preconfigured _Network object for Libre.fm
api_key: a provided API_KEY
api_secret: a provided API_SECRET
@ -727,27 +727,27 @@ class LibreFMNetwork(_Network):
password_hash: str = "",
) -> None:
super().__init__(
name="music.lonestar.it",
homepage="https://music.lonestar.it",
ws_server=("music.lonestar.it", "/2.0/"),
name="Libre.fm",
homepage="https://libre.fm",
ws_server=("libre.fm", "/2.0/"),
api_key=api_key,
api_secret=api_secret,
session_key=session_key,
username=username,
password_hash=password_hash,
domain_names={
DOMAIN_ENGLISH: "music.lonestar.it",
DOMAIN_GERMAN: "music.lonestar.it",
DOMAIN_SPANISH: "music.lonestar.it",
DOMAIN_FRENCH: "music.lonestar.it",
DOMAIN_ITALIAN: "music.lonestar.it",
DOMAIN_POLISH: "music.lonestar.it",
DOMAIN_PORTUGUESE: "music.lonestar.it",
DOMAIN_SWEDISH: "music.lonestar.it",
DOMAIN_TURKISH: "music.lonestar.it",
DOMAIN_RUSSIAN: "music.lonestar.it",
DOMAIN_JAPANESE: "music.lonestar.it",
DOMAIN_CHINESE: "music.lonestar.it",
DOMAIN_ENGLISH: "libre.fm",
DOMAIN_GERMAN: "libre.fm",
DOMAIN_SPANISH: "libre.fm",
DOMAIN_FRENCH: "libre.fm",
DOMAIN_ITALIAN: "libre.fm",
DOMAIN_POLISH: "libre.fm",
DOMAIN_PORTUGUESE: "libre.fm",
DOMAIN_SWEDISH: "libre.fm",
DOMAIN_TURKISH: "libre.fm",
DOMAIN_RUSSIAN: "libre.fm",
DOMAIN_JAPANESE: "libre.fm",
DOMAIN_CHINESE: "libre.fm",
},
urls={
"album": "artist/%(artist)s/album/%(album)s",