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