1{
2 lib,
3 appdirs,
4 babelfish,
5 beautifulsoup4,
6 buildPythonPackage,
7 chardet,
8 click,
9 dogpile-cache,
10 enzyme,
11 fetchFromGitHub,
12 guessit,
13 pysrt,
14 pytestCheckHook,
15 pythonOlder,
16 pytz,
17 rarfile,
18 requests,
19 six,
20 stevedore,
21 sympy,
22 vcrpy,
23}:
24
25buildPythonPackage rec {
26 pname = "subliminal";
27 version = "2.1.0";
28 format = "setuptools";
29
30 disabled = pythonOlder "3.7";
31
32 src = fetchFromGitHub {
33 owner = "Diaoul";
34 repo = pname;
35 rev = "refs/tags/${version}";
36 hash = "sha256-P4gVxKKCGKS3MC4F3yTAaOSv36TtdoYfrf61tBHg8VY=";
37 };
38
39 postPatch = ''
40 substituteInPlace pytest.ini \
41 --replace " --pep8 --flakes" ""
42 '';
43
44 propagatedBuildInputs = [
45 appdirs
46 babelfish
47 beautifulsoup4
48 chardet
49 click
50 dogpile-cache
51 enzyme
52 guessit
53 pysrt
54 pytz
55 rarfile
56 requests
57 six
58 stevedore
59 ];
60
61 nativeCheckInputs = [
62 sympy
63 vcrpy
64 pytestCheckHook
65 ];
66
67 pythonImportsCheck = [ "subliminal" ];
68
69 disabledTests = [
70 # Tests rewuire network access
71 "test_refine_video_metadata"
72 "test_scan"
73 "test_hash"
74 "test_provider_pool_list_subtitles"
75 "test_async_provider_pool_list_subtitles"
76 "test_list_subtitles"
77 "test_download_bad_subtitle"
78 # Not implemented
79 "test_save_subtitles"
80 ];
81
82 disabledTestPaths = [
83 # AttributeError: module 'rarfile' has no attribute 'custom_check'
84 "tests/test_legendastv.py"
85 ];
86
87 meta = with lib; {
88 description = "Python library to search and download subtitles";
89 homepage = "https://github.com/Diaoul/subliminal";
90 changelog = "https://github.com/Diaoul/subliminal/blob/${version}/HISTORY.rst";
91 license = licenses.mit;
92 maintainers = with maintainers; [ doronbehar ];
93 # Too many tests fail ever since a certain python-updates merge, see:
94 # https://github.com/Diaoul/subliminal/issues/1062 . Disabling tests
95 # alltogether may produce a not completly failing executable, but that
96 # executable apparently isn't able to download subtitles at all.
97 broken = true;
98 };
99}