nixpkgs/pkgs/by-name/sp/spotdl/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

92 lines
1.9 KiB
Nix

{ lib
, python3
, fetchFromGitHub
, ffmpeg
}:
python3.pkgs.buildPythonApplication rec {
pname = "spotdl";
version = "4.2.8";
pyproject = true;
src = fetchFromGitHub {
owner = "spotDL";
repo = "spotify-downloader";
rev = "refs/tags/v${version}";
hash = "sha256-1NPYMyiYWWpiGlr80IcILcC1nI8zkmf7+aA+mqwSAU0=";
};
build-system = with python3.pkgs; [ poetry-core ];
pythonRelaxDeps = true;
dependencies = with python3.pkgs; [
beautifulsoup4
fastapi
mutagen
platformdirs
pydantic
pykakasi
python-slugify
pytube
rapidfuzz
requests
rich
soundcloud-v2
spotipy
syncedlyrics
uvicorn
yt-dlp
ytmusicapi
] ++ python-slugify.optional-dependencies.unidecode;
nativeCheckInputs = with python3.pkgs; [
pyfakefs
pytest-mock
pytest-subprocess
pytest-vcr
pytestCheckHook
];
preCheck = ''
export HOME=$TMPDIR
'';
disabledTestPaths = [
# Tests require networking
"tests/test_init.py"
"tests/test_matching.py"
"tests/providers/lyrics"
"tests/types"
"tests/utils/test_github.py"
"tests/utils/test_m3u.py"
"tests/utils/test_metadata.py"
"tests/utils/test_search.py"
];
disabledTests = [
# Test require networking
"test_convert"
"test_download_ffmpeg"
"test_download_song"
"test_preload_song"
"test_yt_get_results"
"test_yt_search"
"test_ytm_search"
"test_ytm_get_results"
];
makeWrapperArgs = [
"--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ])
];
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 ];
mainProgram = "spotdl";
};
}