linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / swspotify / default.nix
blob020e4fe1472f00774f883292fa7802ca9ba24c1e
1 { lib, buildPythonPackage, fetchFromGitHub, requests, flask-cors, dbus-python, pytestCheckHook, mock, isPy27 }:
3 buildPythonPackage rec {
4   pname = "SwSpotify";
5   version = "1.2.1";
6   disabled = isPy27;
8   src = fetchFromGitHub {
9     owner = "SwagLyrics";
10     repo = "SwSpotify";
11     rev = "v${version}";
12     sha256 = "0jxcvy8lw8kpjbl4q6mi11164pvi0w9m9p76bxj2m7i7s5p4dxd4";
13   };
15   propagatedBuildInputs = [
16     requests flask-cors dbus-python
17   ];
19   preConfigure = ''
20     substituteInPlace setup.py \
21       --replace 'requests>=2.24.0' 'requests~=2.23' \
22       --replace 'flask-cors==3.0.8' 'flask-cors'
23   '';
25   checkPhase = ''
26     pytest tests/test_spotify.py::LinuxTests
27   '';
29   checkInputs = [ pytestCheckHook mock ];
31   pythonImportsCheck = [ "SwSpotify" ];
33   meta = with lib; {
34     homepage = "https://github.com/SwagLyrics/SwSpotify";
35     description = "Library to get the currently playing song and artist from Spotify";
36     license = licenses.mit;
37     maintainers = with maintainers; [ siraben ];
38     platforms = platforms.linux;
39   };