summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-03-18 22:31:47 +0100
committermakefu <github@syntax-fehler.de>2021-03-18 22:31:47 +0100
commitf244b35d339c183255f563ba86ef2a22b3cf6f9c (patch)
treec2fd3ca37f0261d657884c857e78cc203dc17d32
parente26f529c1a449e7568b1eab99e525a0c22ca34b0 (diff)
nix: add googletranx.nixHEADmaster
-rw-r--r--default.nix6
-rw-r--r--nix/googletranx.nix39
2 files changed, 41 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index adf3a21..5fcc977 100644
--- a/default.nix
+++ b/default.nix
@@ -7,10 +7,8 @@ python3.pkgs.buildPythonPackage {
matrix-client = (stdenv.lib.overrideDerivation matrix-client (self: {
patches = [ ./nix/badsync.patch ];
}));
- })
- (stdenv.lib.overrideDerivation googletrans (self: {
- patches = [ ./nix/translate.patch ];
- }))
+ })
+ (callPackage ./nix/googletranx.nix {})
];
checkInputs = [ python3.pkgs.black ];
}
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 ];
+ };
+}