nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8 hatch-vcs,
9
10 # dependencies
11 babelfish,
12 beautifulsoup4,
13 chardet,
14 click,
15 click-option-group,
16 defusedxml,
17 dogpile-cache,
18 enzyme,
19 guessit,
20 knowit,
21 srt,
22 pysubs2,
23 rarfile,
24 requests,
25 platformdirs,
26 stevedore,
27 tomli,
28 tomlkit,
29
30 # nativeCheckInputs
31 colorama,
32 pypandoc,
33 pytestCheckHook,
34 pytest-cov-stub,
35 pytest-xdist,
36 mypy,
37 sympy,
38 vcrpy,
39}:
40
41buildPythonPackage rec {
42 pname = "subliminal";
43 version = "2.5.0";
44 pyproject = true;
45
46 src = fetchFromGitHub {
47 owner = "Diaoul";
48 repo = "subliminal";
49 tag = version;
50 hash = "sha256-dA+UoSzMjncF619yfvRnXJFBrVi9FCkuqeN0X7FGiv8=";
51 };
52
53 build-system = [
54 hatchling
55 hatch-vcs
56 ];
57
58 propagatedBuildInputs = [
59 babelfish
60 beautifulsoup4
61 chardet
62 click
63 click-option-group
64 defusedxml
65 dogpile-cache
66 enzyme
67 guessit
68 knowit
69 srt
70 pysubs2
71 rarfile
72 requests
73 platformdirs
74 stevedore
75 tomli
76 tomlkit
77 ];
78
79 nativeCheckInputs = [
80 colorama
81 pypandoc
82 pytestCheckHook
83 pytest-cov-stub
84 pytest-xdist
85 mypy
86 sympy
87 vcrpy
88 ];
89
90 pythonImportsCheck = [ "subliminal" ];
91
92 disabledTests = [
93 # Tests require network access
94 "integration"
95 "test_cli_cache"
96 "test_cli_download"
97 "test_is_supported_archive"
98 "test_refine"
99 "test_scan"
100 "test_hash"
101 ];
102
103 meta = {
104 description = "Python library to search and download subtitles";
105 mainProgram = "subliminal";
106 homepage = "https://github.com/Diaoul/subliminal";
107 changelog = "https://github.com/Diaoul/subliminal/blob/${src.tag}/HISTORY.rst";
108 license = lib.licenses.mit;
109 maintainers = with lib.maintainers; [ doronbehar ];
110 };
111}