From e30abffb66446ae59e95fb888745269be546ad92 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Tue, 18 Feb 2020 12:25:59 +0100 Subject: [PATCH] pythonPackages.googletrans: init at 2.4.0 --- .../python-modules/googletrans/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/googletrans/default.nix diff --git a/pkgs/development/python-modules/googletrans/default.nix b/pkgs/development/python-modules/googletrans/default.nix new file mode 100644 index 000000000000..06d008200059 --- /dev/null +++ b/pkgs/development/python-modules/googletrans/default.nix @@ -0,0 +1,34 @@ +{ lib, buildPythonPackage, fetchFromGitHub, requests, pytest, coveralls }: + +buildPythonPackage rec { + pname = "googletrans"; + version = "2.4.0"; + + src = fetchFromGitHub { + owner = "ssut"; + repo = "py-googletrans"; + rev = "v${version}"; + sha256 = "0wzzinn0k9rfv9z1gmfk9l4kljyd4n6kizsjw4wjxv91kfhj92hz"; + }; + + propagatedBuildInputs = [ + requests + ]; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c00033b3a720..891dc4165ad6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2739,6 +2739,8 @@ in { google-pasta = callPackage ../development/python-modules/google-pasta { }; + googletrans = callPackage ../development/python-modules/googletrans { }; + gpapi = callPackage ../development/python-modules/gpapi { }; gplaycli = callPackage ../development/python-modules/gplaycli { };