Drop support for EOL Python 3.7 (#1065)

* Add python_requires to help pip

* Update supported versions in tox.ini

* Upgrade Python syntax with pyupgrade --py37-plus

* Bump GitHub Actions

* Add Python 3.11 and 3.12 to CI

* Remove six dependency

* Remove redundant dependencies

* Remove redudant Python 3.5 code

* Drop support for EOL Python 3.7

* Upgrade Python syntax with pyupgrade --py38-plus

* Update CHANGELOG

* More f-strings

---------

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
Hugo van KemenadeandHugo van Kemenade authored and GitHub committed 2024-05-21 18:32:01 +02:00
1 parent 958ff6ad2b
commit 85c9d74dc1
29 files changed
+85 -125

No files matched your search

+1 -2
View File
@@ -1,6 +1,5 @@
# shows audio analysis for the given track
from __future__ import print_function # (at top of module)
from spotipy.oauth2 import SpotifyClientCredentials
import json
import spotipy
@@ -20,4 +19,4 @@ start = time.time()
analysis = sp.audio_analysis(tid)
delta = time.time() - start
print(json.dumps(analysis, indent=4))
print("analysis retrieved in %.2f seconds" % (delta,))
print(f"analysis retrieved in {delta:.2f} seconds")
+1 -3
View File
@@ -1,7 +1,5 @@
# shows acoustic features for tracks for the given artist
from __future__ import print_function # (at top of module)
from spotipy.oauth2 import SpotifyClientCredentials
import json
import spotipy
@@ -33,4 +31,4 @@ for feature in features:
analysis = sp._get(feature['analysis_url'])
print(json.dumps(analysis, indent=4))
print()
print("features retrieved in %.2f seconds" % (delta,))
print(f"features retrieved in {delta:.2f} seconds")
+1 -4
View File
@@ -1,8 +1,5 @@
# shows acoustic features for tracks for the given artist
from __future__ import print_function # (at top of module)
from spotipy.oauth2 import SpotifyClientCredentials
import json
import spotipy
@@ -22,4 +19,4 @@ if len(sys.argv) > 1:
features = sp.audio_features(tids)
delta = time.time() - start
print(json.dumps(features, indent=4))
print("features retrieved in %.2f seconds" % (delta,))
print(f"features retrieved in {delta:.2f} seconds")
+1 -1
View File
@@ -11,7 +11,7 @@ scope = 'user-library-read'
if len(sys.argv) > 1:
tid = sys.argv[1]
else:
print("Usage: %s track-id ..." % (sys.argv[0],))
print(f"Usage: {sys.argv[0]} track-id ...")
sys.exit()
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
+1 -1
View File
@@ -11,7 +11,7 @@ scope = 'user-library-modify'
if len(sys.argv) > 1:
tid = sys.argv[1]
else:
print("Usage: %s track-id ..." % (sys.argv[0],))
print(f"Usage: {sys.argv[0]} track-id ...")
sys.exit()
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
@@ -15,8 +15,7 @@ if len(sys.argv) > 2:
track_ids.append({"uri": tid, "positions": [int(pos)]})
else:
print(
"Usage: %s playlist_id track_id,pos track_id,pos ..." %
(sys.argv[0],))
f"Usage: {sys.argv[0]} playlist_id track_id,pos track_id,pos ...")
sys.exit()
scope = 'playlist-modify-public'
+1 -1
View File
@@ -10,7 +10,7 @@ if len(sys.argv) > 2:
playlist_id = sys.argv[2]
track_ids = sys.argv[3:]
else:
print("Usage: %s playlist_id track_id ..." % (sys.argv[0]))
print(f"Usage: {sys.argv[0]} playlist_id track_id ...")
sys.exit()
scope = 'playlist-modify-public'
+1 -1
View File
@@ -10,7 +10,7 @@ if len(sys.argv) > 3:
playlist_id = sys.argv[1]
track_ids = sys.argv[2:]
else:
print("Usage: %s playlist_id track_id ..." % (sys.argv[0],))
print(f"Usage: {sys.argv[0]} playlist_id track_id ...")
sys.exit()
scope = 'playlist-modify-public'
-1
View File
@@ -1,4 +1,3 @@
# shows album info for a URN or URL
from spotipy.oauth2 import SpotifyClientCredentials
-1
View File
@@ -1,4 +1,3 @@
# shows related artists for the given seed artist
from spotipy.oauth2 import SpotifyClientCredentials
+1 -1
View File
@@ -13,4 +13,4 @@ while results['next']:
albums.extend(results['items'])
for album in albums:
print((album['name']))
print(album['name'])
-1
View File
@@ -1,4 +1,3 @@
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
+1 -1
View File
@@ -13,7 +13,7 @@ client_credentials_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
skiplist = set(['dm', 'remix'])
skiplist = {'dm', 'remix'}
max_offset = 500
seen = set()