mopidy-youtube: enable tests

+39 -12
+39 -12
pkgs/applications/audio/mopidy/youtube.nix
··· 1 - { lib, python3Packages, mopidy }: 1 + { lib 2 + , fetchFromGitHub 3 + , python3 4 + , mopidy 5 + }: 2 6 3 - python3Packages.buildPythonApplication rec { 7 + python3.pkgs.buildPythonApplication rec { 4 8 pname = "mopidy-youtube"; 5 9 version = "3.4"; 6 10 7 - src = python3Packages.fetchPypi { 8 - inherit version; 9 - pname = "Mopidy-YouTube"; 10 - sha256 = "sha256-996MNByMcKq1woDGK6jsmAHS9TOoBrwSGgPmcShvTRw="; 11 - }; 11 + disabled = python3.pythonOlder "3.7"; 12 12 13 - postPatch = "sed s/bs4/beautifulsoup4/ -i setup.cfg"; 13 + src = fetchFromGitHub { 14 + owner = "natumbri"; 15 + repo = pname; 16 + rev = "v${version}"; 17 + sha256 = "0lm6nn926qkrwzvj64yracdixfrnv5zk243msjskrnlzkhgk01rk"; 18 + }; 14 19 15 - propagatedBuildInputs = with python3Packages; [ 20 + propagatedBuildInputs = with python3.pkgs; [ 16 21 beautifulsoup4 17 22 cachetools 23 + pykka 24 + requests 18 25 youtube-dl 19 26 ytmusicapi 20 - ] ++ [ mopidy ]; 27 + ] ++ [ 28 + mopidy 29 + ]; 30 + 31 + checkInputs = with python3.pkgs; [ 32 + vcrpy 33 + pytestCheckHook 34 + ]; 35 + 36 + disabledTests = [ 37 + # Test requires a YouTube API key 38 + "test_get_default_config" 39 + ]; 40 + 41 + disabledTestPaths = [ 42 + # Fails with an import error 43 + "tests/test_backend.py" 44 + ]; 21 45 22 - doCheck = false; 46 + pythonImportsCheck = [ 47 + "mopidy_youtube" 48 + ]; 23 49 24 50 meta = with lib; { 25 51 description = "Mopidy extension for playing music from YouTube"; 52 + homepage = "https://github.com/natumbri/mopidy-youtube"; 26 53 license = licenses.asl20; 27 - maintainers = [ maintainers.spwhitt ]; 54 + maintainers = with maintainers; [ spwhitt ]; 28 55 }; 29 56 }