Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest to loosen the dependency on spotipy #2

Open
Agnes-U opened this issue Nov 29, 2022 · 0 comments
Open

Suggest to loosen the dependency on spotipy #2

Agnes-U opened this issue Nov 29, 2022 · 0 comments

Comments

@Agnes-U
Copy link

Agnes-U commented Nov 29, 2022

Hi, your project chimera requires "spotipy==2.4.4" in its dependency. After analyzing the source code, we found that some other versions of spotipy can also be suitable without affecting your project, i.e., spotipy 2.4.3. Therefore, we suggest to loosen the dependency on spotipy from "spotipy==2.4.4" to "spotipy>=2.4.3,<=2.4.4" to avoid any possible conflict for importing more packages or for downstream projects that may use chimera.

May I pull a request to loosen the dependency on spotipy?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



For your reference, here are details in our analysis.

Your project chimera(commit id: 1452f88) directly uses 11 APIs from package spotipy.

spotipy.oauth2.SpotifyOAuth.__init__, spotipy.client.Spotify.current_user_playlists, spotipy.oauth2.SpotifyOAuth.get_cached_token, spotipy.client.Spotify.artist_top_tracks, spotipy.client.Spotify.current_user_saved_tracks, spotipy.client.Spotify.track, spotipy.client.Spotify.__init__, spotipy.client.Spotify.user, spotipy.oauth2.SpotifyOAuth.get_authorize_url, spotipy.client.Spotify.user_playlist, spotipy.client.Spotify.next

From which, 22 functions are then indirectly called, including 13 spotipy's internal APIs and 9 outsider APIs, as follows (neglecting some repeated function occurrences).

[/KGTasa/chimera]
+--spotipy.oauth2.SpotifyOAuth.__init__
|      +--spotipy.oauth2.SpotifyOAuth._normalize_scope
+--spotipy.client.Spotify.current_user_playlists
|      +--spotipy.client.Spotify._get
|      |      +--spotipy.client.Spotify._internal_call
|      |      |      +--spotipy.client.Spotify._auth_headers
|      |      |      +--json.dumps
|      |      |      +--spotipy.client.SpotifyException.__init__
|      |      +--time.sleep
+--spotipy.oauth2.SpotifyOAuth.get_cached_token
|      +--json.loads
|      +--spotipy.oauth2.SpotifyOAuth._is_token_expired
|      |      +--time.time
|      +--spotipy.oauth2.SpotifyOAuth.refresh_access_token
|      |      +--base64.b64encode
|      |      +--requests.post
|      |      +--spotipy.oauth2.SpotifyOAuth._warn
|      |      +--spotipy.oauth2.SpotifyOAuth._add_custom_values_to_token_info
|      |      |      +--time.time
|      |      +--spotipy.oauth2.SpotifyOAuth._save_token_info
|      |      |      +--json.dumps
|      |      |      +--spotipy.oauth2.SpotifyOAuth._warn
|      +--spotipy.oauth2.SpotifyOAuth._is_scope_subset
+--spotipy.client.Spotify.artist_top_tracks
|      +--spotipy.client.Spotify._get_id
|      |      +--spotipy.client.Spotify._warn
|      +--spotipy.client.Spotify._get
+--spotipy.client.Spotify.current_user_saved_tracks
|      +--spotipy.client.Spotify._get
+--spotipy.client.Spotify.track
|      +--spotipy.client.Spotify._get_id
|      +--spotipy.client.Spotify._get
+--spotipy.client.Spotify.__init__
|      +--requests.Session
+--spotipy.client.Spotify.user
|      +--spotipy.client.Spotify._get
+--spotipy.oauth2.SpotifyOAuth.get_authorize_url
|      +--urllib.urlencode
|      +--urllib.parse.urlencode
+--spotipy.client.Spotify.user_playlist
|      +--spotipy.client.Spotify._get
|      +--spotipy.client.Spotify._get_id
+--spotipy.client.Spotify.next
|      +--spotipy.client.Spotify._get

We scan spotipy's versions among [2.4.3] and 2.4.4, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 2.4.4(original) 2.4.3
['spotipy.client.Spotify', 'spotipy.client.Spotify.user_playlist_change_details']

As for other packages, the APIs of @outside_package_name are called by spotipy in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on spotipy from "spotipy==2.4.4" to "spotipy>=2.4.3,<=2.4.4". This will improve the applicability of chimera and reduce the possibility of any further dependency conflict with other projects/packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant