about summary refs log tree commit diff
path: root/pkgs/tools/misc/swaglyrics/default.nix
blob: 8c5a3b7e9474b63fbbc76dd0f08770903b95ef7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ lib
, python3
, fetchFromGitHub
, ncurses
}:

python3.pkgs.buildPythonApplication rec {
  pname = "swaglyrics";
  version = "unstable-2021-06-17";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "SwagLyrics";
    repo = "SwagLyrics-For-Spotify";
    rev = "99fe764a9e45cac6cb9fcdf724c7d2f8cb4524fb";
    hash = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "==" ">="
  '';

  propagatedBuildInputs = with python3.pkgs; [
    beautifulsoup4
    colorama
    flask
    requests
    swspotify
    unidecode
  ];

  checkInputs = with python3.pkgs; [
    blinker
    flask
    flask-testing
    mock
    pytestCheckHook
  ] ++ [
    ncurses
  ];

  preBuild = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
     # Disable tests which touch network
     "test_database_for_unsupported_song"
     "test_that_lyrics_works_for_unsupported_songs"
     "test_that_get_lyrics_works"
     "test_lyrics_are_shown_in_tab"
     "test_songchanged_can_raise_songplaying"
  ];

  pythonImportsCheck = [
    "swaglyrics"
  ];

  meta = with lib; {
    description = "Lyrics fetcher for currently playing Spotify song";
    homepage = "https://github.com/SwagLyrics/SwagLyrics-For-Spotify";
    license = licenses.mit;
    maintainers = with maintainers; [ siraben ];
  };
}