Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / subliminal / default.nix
blobb72d8e0311ccc7b4a66284a5dd7bc09888a92f4e
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
24 buildPythonPackage rec {
25   pname = "subliminal";
26   version = "2.1.0";
27   format = "setuptools";
29   disabled = pythonOlder "3.7";
31   src = fetchFromGitHub {
32     owner = "Diaoul";
33     repo = pname;
34     rev = "refs/tags/${version}";
35     hash = "sha256-P4gVxKKCGKS3MC4F3yTAaOSv36TtdoYfrf61tBHg8VY=";
36   };
38   postPatch = ''
39     substituteInPlace pytest.ini \
40       --replace " --pep8 --flakes" ""
41   '';
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   ];
60   nativeCheckInputs = [
61     sympy
62     vcrpy
63     pytestCheckHook
64   ];
66   pythonImportsCheck = [
67     "subliminal"
68   ];
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   ];
83   disabledTestPaths = [
84     # AttributeError: module 'rarfile' has no attribute 'custom_check'
85     "tests/test_legendastv.py"
86   ];
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; [ doronbehar ];
94     # Too many tests fail ever since a certain python-updates merge, see:
95     # https://github.com/Diaoul/subliminal/issues/1062 . Disabling tests
96     # alltogether may produce a not completly failing executable, but that
97     # executable apparently isn't able to download subtitles at all.
98     broken = true;
99   };