From f244b35d339c183255f563ba86ef2a22b3cf6f9c Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 18 Mar 2021 22:31:47 +0100 Subject: nix: add googletranx.nix --- nix/googletranx.nix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 nix/googletranx.nix (limited to 'nix') diff --git a/nix/googletranx.nix b/nix/googletranx.nix new file mode 100644 index 0000000..8326d17 --- /dev/null +++ b/nix/googletranx.nix @@ -0,0 +1,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 ]; + }; +} -- cgit v1.2.3