diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/audio/spotdl/default.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/audio/spotdl/default.nix | 87 |
1 files changed, 73 insertions, 14 deletions
diff --git a/nixpkgs/pkgs/tools/audio/spotdl/default.nix b/nixpkgs/pkgs/tools/audio/spotdl/default.nix index 32dc47f53188..cd856770f79d 100644 --- a/nixpkgs/pkgs/tools/audio/spotdl/default.nix +++ b/nixpkgs/pkgs/tools/audio/spotdl/default.nix @@ -1,35 +1,65 @@ { lib , python3 +, fetchPypi , fetchFromGitHub , ffmpeg }: -python3.pkgs.buildPythonApplication rec { +let + python = python3.override { + packageOverrides = self: super: { + ytmusicapi = super.ytmusicapi.overridePythonAttrs (old: rec { + version = "0.25.1"; + src = fetchPypi { + inherit (old) pname; + inherit version; + hash = "sha256-uc/fgDetSYaCRzff0SzfbRhs3TaKrfE2h6roWkkj8yQ="; + }; + }); + }; + }; +in python.pkgs.buildPythonApplication rec { pname = "spotdl"; - version = "3.9.6"; + version = "4.1.10"; + + format = "pyproject"; src = fetchFromGitHub { owner = "spotDL"; repo = "spotify-downloader"; rev = "refs/tags/v${version}"; - hash = "sha256-JoeNVMuEslz7A7G4ZvikimZrG75YrH5Mx3Oamtfy4cM="; + hash = "sha256-SmyUoMOlBJZTJH19NwTKbz/vo7Oh4tGHCQrW5DVZQWQ="; }; - propagatedBuildInputs = with python3.pkgs; [ + nativeBuildInputs = with python.pkgs; [ + poetry-core + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = true; + + propagatedBuildInputs = with python.pkgs; [ spotipy - pytube - rich - rapidfuzz - mutagen ytmusicapi + pytube yt-dlp + mutagen + rich beautifulsoup4 requests - unidecode - setuptools - ]; + rapidfuzz + python-slugify + uvicorn + pydantic + fastapi + platformdirs + pykakasi + syncedlyrics + typing-extensions + setuptools # for pkg_resources + ] ++ python-slugify.optional-dependencies.unidecode; - checkInputs = with python3.pkgs; [ + nativeCheckInputs = with python.pkgs; [ pytestCheckHook pytest-mock pytest-vcr @@ -37,8 +67,36 @@ python3.pkgs.buildPythonApplication rec { pytest-subprocess ]; - # requires networking - doCheck = false; + preCheck = '' + export HOME=$TMPDIR + ''; + + disabledTestPaths = [ + # require networking + "tests/test_init.py" + "tests/test_matching.py" + "tests/utils/test_m3u.py" + "tests/utils/test_metadata.py" + "tests/utils/test_search.py" + ]; + + disabledTests = [ + # require networking + "test_album_from_string" + "test_album_from_url" + "test_album_length" + "test_artist_from_url" + "test_artist_from_string" + "test_convert" + "test_download_ffmpeg" + "test_download_song" + "test_playlist_from_string" + "test_playlist_from_url" + "test_playlist_length" + "test_preload_song" + "test_song_from_search_term" + "test_song_from_url" + ]; makeWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ]) @@ -47,6 +105,7 @@ python3.pkgs.buildPythonApplication rec { meta = with lib; { description = "Download your Spotify playlists and songs along with album art and metadata"; homepage = "https://github.com/spotDL/spotify-downloader"; + changelog = "https://github.com/spotDL/spotify-downloader/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ dotlambda ]; }; |