summaryrefslogtreecommitdiffstats
path: root/nix/googletranx.nix
blob: 8326d17ac3c4e52fc9fbb334b629d95d11fe1c0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, buildPythonPackage, httpx, fetchFromGitHub, requests, pytest, coveralls }:

buildPythonPackage rec {
  pname = "googletrans";
  version = "2020-08-02";

  src = fetchFromGitHub {
    owner = "ssut";
    repo = "py-googletrans";
    rev = "4f7c079";
    sha256 = "0jj3a1bhq88x4lg32xch0kna8i88wkrywywmm3ic81zvlb6yyipk";
  };

  propagatedBuildInputs = [
    requests
    httpx
  ];

  prePatch = ''
    sed -i 's/==/>=/' setup.py
  '';

  checkInputs = [ pytest coveralls ];

  # majority of tests just try to ping Google's Translate API endpoint
  doCheck = false;
  checkPhase = ''
    pytest
  '';

  pythonImportsCheck = [ "googletrans" ];

  meta = with lib; {
    description = "Googletrans is python library to interact with Google Translate API";
    homepage = "https://py-googletrans.readthedocs.io";
    license = licenses.mit;
    maintainers = with maintainers; [ unode ];
  };
}