From 742df8b674604959524b90fa7236501c9fe4af1a Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 26 Nov 2018 22:50:06 +0200 Subject: [PATCH 1/2] Drop support for Python 3.4 (EOL 2019-03-16) --- .travis.yml | 2 -- README.md | 4 ++-- setup.py | 5 ++--- tox.ini | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ab965b..5b8e058 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,6 @@ matrix: env: TOXENV=py36 - python: 3.5 env: TOXENV=py35 - - python: 3.4 - env: TOXENV=py34 - python: pypy3 env: TOXENV=pypy3 - python: 3.8-dev diff --git a/README.md b/README.md index 13d8b64..9a43eda 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Installation Install via pip: pip install pylast - + Install latest development version: pip install -U git+https://github.com/pylast/pylast.git @@ -29,7 +29,7 @@ Or from requirements.txt: Note: -* pylast 3.0.0+ supports Python 3.4+ ([#265](https://github.com/pylast/pylast/issues/265)) +* pylast 3.0.0+ supports Python 3.5+ ([#265](https://github.com/pylast/pylast/issues/265)) * pyLast 2.2.0 - 2.4.0 supports Python 2.7.10+, 3.4, 3.5, 3.6, 3.7. * pyLast 2.0.0 - 2.1.0 supports Python 2.7.10+, 3.4, 3.5, 3.6. * pyLast 1.7.0 - 1.9.0 supports Python 2.7, 3.3, 3.4, 3.5, 3.6. diff --git a/setup.py b/setup.py index 78832c1..496bb21 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ with open("pylast/version.py") as f: version = version_dict["__version__"] -if sys.version_info < (3, 4): +if sys.version_info < (3, 5): error = """pylast 3.0 and above are no longer compatible with Python 2. This is pylast {} and you are using Python {}. @@ -64,7 +64,6 @@ setup( "Topic :: Multimedia :: Sound/Audio", "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", @@ -72,7 +71,7 @@ setup( "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], - python_requires=">=3.4", + python_requires=">=3.5", keywords=["Last.fm", "music", "scrobble", "scrobbling"], packages=find_packages(exclude=("tests*",)), license="Apache2", diff --git a/tox.ini b/tox.ini index fe07234..a84fb2a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37, py36, py35, py34, pypy3, py38dev +envlist = py37, py36, py35, pypy3, py38dev recreate = False [testenv] From ee879aa042381f1562d335d73bf7cb32ede3d1f1 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 26 Nov 2018 23:10:38 +0200 Subject: [PATCH 2/2] Upgrade Python syntax with pyupgrade --py3-plus --- pylast/__init__.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index 0a32950..fd367ef 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -138,7 +138,7 @@ logger = logging.getLogger(__name__) logging.getLogger(__name__).addHandler(logging.NullHandler()) -class _Network(object): +class _Network: """ A music social network website such as Last.fm or one with a Last.fm-compatible API. @@ -795,7 +795,7 @@ class LibreFMNetwork(_Network): ) -class _ShelfCacheBackend(object): +class _ShelfCacheBackend: """Used as a backend for caching cacheable requests.""" def __init__(self, file_path=None): @@ -816,7 +816,7 @@ class _ShelfCacheBackend(object): self.shelf[key] = xml_string -class _Request(object): +class _Request: """Representing an abstract web service operation.""" def __init__(self, network, method_name, params=None): @@ -981,7 +981,7 @@ class _Request(object): raise WSError(self.network, status, details) -class SessionKeyGenerator(object): +class SessionKeyGenerator: """Methods of generating a session key: 1) Web Authentication: a. network = get_*_network(API_KEY, API_SECRET) @@ -1104,7 +1104,7 @@ def _string_output(func): return r -class _BaseObject(object): +class _BaseObject: """An abstract webservices object.""" network = None @@ -1193,7 +1193,7 @@ class _BaseObject(object): return _extract(node, section) -class _Chartable(object): +class _Chartable: """Common functions for classes with charts.""" def __init__(self, ws_prefix): @@ -1264,7 +1264,7 @@ class _Chartable(object): return seq -class _Taggable(object): +class _Taggable: """Common functions for classes with tags.""" def __init__(self, ws_prefix): @@ -1593,7 +1593,7 @@ class Album(_Opus): __hash__ = _Opus.__hash__ def __init__(self, artist, title, network, username=None, info=None): - super(Album, self).__init__(artist, title, network, "album", username, info) + super().__init__(artist, title, network, "album", username, info) def get_tracks(self): """Returns the list of Tracks on this album.""" @@ -2062,7 +2062,7 @@ class Track(_Opus): __hash__ = _Opus.__hash__ def __init__(self, artist, title, network, username=None, info=None): - super(Track, self).__init__(artist, title, network, "track", username, info) + super().__init__(artist, title, network, "track", username, info) def get_correction(self): """Returns the corrected track name."""