summary refs log tree commit diff
path: root/pkgs/applications/audio/mopidy
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-10-10 11:46:31 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-10-10 11:46:31 +0200
commitdabafc8ac748ce035d8e8c9e9072fb57f8a51235 (patch)
tree26108fdd50077887c5ecd981ff4992ef077fa453 /pkgs/applications/audio/mopidy
parent807370df9481804598f06c9e17020cdb7f974a18 (diff)
downloadnixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar.gz
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar.bz2
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar.lz
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar.xz
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.tar.zst
nixpkgs-dabafc8ac748ce035d8e8c9e9072fb57f8a51235.zip
mopidy-youtube: enable tests
Diffstat (limited to 'pkgs/applications/audio/mopidy')
-rw-r--r--pkgs/applications/audio/mopidy/youtube.nix51
1 files changed, 39 insertions, 12 deletions
diff --git a/pkgs/applications/audio/mopidy/youtube.nix b/pkgs/applications/audio/mopidy/youtube.nix
index 7ae8e17c78e..ecb8128032e 100644
--- a/pkgs/applications/audio/mopidy/youtube.nix
+++ b/pkgs/applications/audio/mopidy/youtube.nix
@@ -1,29 +1,56 @@
-{ lib, python3Packages, mopidy }:
+{ lib
+, fetchFromGitHub
+, python3
+, mopidy
+}:
 
-python3Packages.buildPythonApplication rec {
+python3.pkgs.buildPythonApplication rec {
   pname = "mopidy-youtube";
   version = "3.4";
 
-  src = python3Packages.fetchPypi {
-    inherit version;
-    pname = "Mopidy-YouTube";
-    sha256 = "sha256-996MNByMcKq1woDGK6jsmAHS9TOoBrwSGgPmcShvTRw=";
-  };
+  disabled = python3.pythonOlder "3.7";
 
-  postPatch = "sed s/bs4/beautifulsoup4/ -i setup.cfg";
+  src = fetchFromGitHub {
+    owner = "natumbri";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0lm6nn926qkrwzvj64yracdixfrnv5zk243msjskrnlzkhgk01rk";
+  };
 
-  propagatedBuildInputs = with python3Packages; [
+  propagatedBuildInputs = with python3.pkgs; [
     beautifulsoup4
     cachetools
+    pykka
+    requests
     youtube-dl
     ytmusicapi
-  ] ++ [ mopidy ];
+  ] ++ [
+    mopidy
+  ];
+
+  checkInputs = with python3.pkgs; [
+    vcrpy
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # Test requires a YouTube API key
+    "test_get_default_config"
+  ];
+
+  disabledTestPaths = [
+    # Fails with an import error
+    "tests/test_backend.py"
+  ];
 
-  doCheck = false;
+  pythonImportsCheck = [
+    "mopidy_youtube"
+  ];
 
   meta = with lib; {
     description = "Mopidy extension for playing music from YouTube";
+    homepage = "https://github.com/natumbri/mopidy-youtube";
     license = licenses.asl20;
-    maintainers = [ maintainers.spwhitt ];
+    maintainers = with maintainers; [ spwhitt ];
   };
 }