about summary refs log tree commit diff
path: root/pkgs/development/python-modules/googletrans
diff options
context:
space:
mode:
authorRenato Alves <alves.rjc@gmail.com>2020-02-18 12:25:59 +0100
committerJon <jonringer@users.noreply.github.com>2020-02-22 10:00:06 -0800
commite30abffb66446ae59e95fb888745269be546ad92 (patch)
treef1d078cd26d122dbeefdd1ecf8f84aca13bbcfd3 /pkgs/development/python-modules/googletrans
parentd7266d00b29492bc286dd788d04c3dc4f07390cb (diff)
pythonPackages.googletrans: init at 2.4.0
Diffstat (limited to 'pkgs/development/python-modules/googletrans')
-rw-r--r--pkgs/development/python-modules/googletrans/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/googletrans/default.nix b/pkgs/development/python-modules/googletrans/default.nix
new file mode 100644
index 0000000000000..06d0082000596
--- /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 ];
+  };
+}