Update pre-commit and add quarterly autoupdate_schedule
This commit is contained in:
parent
e193106bde
commit
20cd3ff475
|
@ -1,12 +1,12 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.10.0
|
rev: v2.23.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: ["--py36-plus"]
|
args: ["--py36-plus"]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 20.8b1
|
rev: 21.7b0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: ["--target-version", "py36"]
|
args: ["--target-version", "py36"]
|
||||||
|
@ -15,35 +15,38 @@ repos:
|
||||||
types: []
|
types: []
|
||||||
|
|
||||||
- repo: https://github.com/asottile/blacken-docs
|
- repo: https://github.com/asottile/blacken-docs
|
||||||
rev: v1.9.2
|
rev: v1.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: blacken-docs
|
- id: blacken-docs
|
||||||
args: ["--target-version", "py36"]
|
args: ["--target-version", "py36"]
|
||||||
additional_dependencies: [black==20.8b1]
|
additional_dependencies: [black==20.8b1]
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
rev: 5.7.0
|
rev: 5.9.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
|
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 3.8.4
|
rev: 3.9.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
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.7.1
|
rev: v1.9.0
|
||||||
hooks:
|
hooks:
|
||||||
- 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: v3.4.0
|
rev: v4.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
|
|
||||||
- repo: https://github.com/tox-dev/tox-ini-fmt
|
- repo: https://github.com/tox-dev/tox-ini-fmt
|
||||||
rev: 0.5.0
|
rev: 0.5.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: tox-ini-fmt
|
- id: tox-ini-fmt
|
||||||
|
|
||||||
|
ci:
|
||||||
|
autoupdate_schedule: quarterly
|
||||||
|
|
|
@ -1355,7 +1355,7 @@ class _Taggable(_BaseObject):
|
||||||
self.remove_tag(tag)
|
self.remove_tag(tag)
|
||||||
|
|
||||||
def clear_tags(self):
|
def clear_tags(self):
|
||||||
"""Clears all the user-set tags. """
|
"""Clears all the user-set tags."""
|
||||||
|
|
||||||
self.remove_tags(*(self.get_tags()))
|
self.remove_tags(*(self.get_tags()))
|
||||||
|
|
||||||
|
@ -1702,7 +1702,7 @@ class Artist(_Taggable):
|
||||||
self.info = info
|
self.info = info
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "pylast.Artist({}, {})".format(repr(self.get_name()), repr(self.network))
|
return f"pylast.Artist({repr(self.get_name())}, {repr(self.network)})"
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return str(self.get_name())
|
return str(self.get_name())
|
||||||
|
@ -1886,7 +1886,7 @@ class Country(_BaseObject):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "pylast.Country({}, {})".format(repr(self.name), repr(self.network))
|
return f"pylast.Country({repr(self.name)}, {repr(self.network)})"
|
||||||
|
|
||||||
@_string_output
|
@_string_output
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -1902,7 +1902,7 @@ class Country(_BaseObject):
|
||||||
return {"country": self.get_name()}
|
return {"country": self.get_name()}
|
||||||
|
|
||||||
def get_name(self):
|
def get_name(self):
|
||||||
"""Returns the country name. """
|
"""Returns the country name."""
|
||||||
|
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -1964,7 +1964,7 @@ class Library(_BaseObject):
|
||||||
self.user = User(user, self.network)
|
self.user = User(user, self.network)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "pylast.Library({}, {})".format(repr(self.user), repr(self.network))
|
return f"pylast.Library({repr(self.user)}, {repr(self.network)})"
|
||||||
|
|
||||||
@_string_output
|
@_string_output
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -2010,7 +2010,7 @@ class Tag(_Chartable):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "pylast.Tag({}, {})".format(repr(self.name), repr(self.network))
|
return f"pylast.Tag({repr(self.name)}, {repr(self.network)})"
|
||||||
|
|
||||||
@_string_output
|
@_string_output
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -2026,7 +2026,7 @@ class Tag(_Chartable):
|
||||||
return {self.ws_prefix: self.get_name()}
|
return {self.ws_prefix: self.get_name()}
|
||||||
|
|
||||||
def get_name(self, properly_capitalized=False):
|
def get_name(self, properly_capitalized=False):
|
||||||
"""Returns the name of the tag. """
|
"""Returns the name of the tag."""
|
||||||
|
|
||||||
if properly_capitalized:
|
if properly_capitalized:
|
||||||
self.name = _extract(
|
self.name = _extract(
|
||||||
|
@ -2149,12 +2149,12 @@ class Track(_Opus):
|
||||||
return Album(_extract(node, "artist"), _extract(node, "title"), self.network)
|
return Album(_extract(node, "artist"), _extract(node, "title"), self.network)
|
||||||
|
|
||||||
def love(self):
|
def love(self):
|
||||||
"""Adds the track to the user's loved tracks. """
|
"""Adds the track to the user's loved tracks."""
|
||||||
|
|
||||||
self._request(self.ws_prefix + ".love")
|
self._request(self.ws_prefix + ".love")
|
||||||
|
|
||||||
def unlove(self):
|
def unlove(self):
|
||||||
"""Remove the track to the user's loved tracks. """
|
"""Remove the track to the user's loved tracks."""
|
||||||
|
|
||||||
self._request(self.ws_prefix + ".unlove")
|
self._request(self.ws_prefix + ".unlove")
|
||||||
|
|
||||||
|
@ -2220,7 +2220,7 @@ class User(_Chartable):
|
||||||
self.name = user_name
|
self.name = user_name
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "pylast.User({}, {})".format(repr(self.name), repr(self.network))
|
return f"pylast.User({repr(self.name)}, {repr(self.network)})"
|
||||||
|
|
||||||
@_string_output
|
@_string_output
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -2259,7 +2259,7 @@ class User(_Chartable):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def get_friends(self, limit=50, cacheable=False, stream=False):
|
def get_friends(self, limit=50, cacheable=False, stream=False):
|
||||||
"""Returns a list of the user's friends. """
|
"""Returns a list of the user's friends."""
|
||||||
|
|
||||||
def _get_friends():
|
def _get_friends():
|
||||||
for node in _collect_nodes(
|
for node in _collect_nodes(
|
||||||
|
@ -2604,7 +2604,7 @@ class User(_Chartable):
|
||||||
return self.network._get_url(domain_name, "user") % {"name": name}
|
return self.network._get_url(domain_name, "user") % {"name": name}
|
||||||
|
|
||||||
def get_library(self):
|
def get_library(self):
|
||||||
"""Returns the associated Library object. """
|
"""Returns the associated Library object."""
|
||||||
|
|
||||||
return Library(self, self.network)
|
return Library(self, self.network)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue