1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 beautifulsoup4,
7 click,
8 gtts-token,
9 mock,
10 pytest,
11 requests,
12 six,
13 testfixtures,
14 twine,
15 urllib3,
16}:
17
18buildPythonPackage rec {
19 pname = "gtts";
20 version = "2.5.4";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "pndurette";
25 repo = "gTTS";
26 tag = "v${version}";
27 hash = "sha256-ryTR7cESDO9pH5r2FBz+6JuNMEQr39hil/FSklgaIGg=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 beautifulsoup4
34 click
35 gtts-token
36 requests
37 six
38 urllib3
39 twine
40 ];
41
42 nativeCheckInputs = [
43 pytest
44 mock
45 testfixtures
46 ];
47
48 # majority of tests just try to call out to Google's Translate API endpoint
49 doCheck = false;
50 checkPhase = ''
51 pytest
52 '';
53
54 pythonImportsCheck = [ "gtts" ];
55
56 meta = with lib; {
57 description = "Python library and CLI tool to interface with Google Translate text-to-speech API";
58 mainProgram = "gtts-cli";
59 homepage = "https://gtts.readthedocs.io";
60 changelog = "https://gtts.readthedocs.io/en/latest/changelog.html";
61 license = licenses.mit;
62 maintainers = with maintainers; [ unode ];
63 };
64}