Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / translatehtml / default.nix
blobe97e248edfdd44b82cbe110fcb2b12f5976cb16b
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , fetchpatch
5 , argostranslate
6 , beautifulsoup4
7 }:
9 buildPythonPackage rec {
10   pname = "translatehtml";
11   version = "1.5.2";
13   format = "setuptools";
15   src = fetchPypi {
16     inherit pname version;
17     sha256 = "6b30ceb8b6f174917e2660caf2d2ccbaa71d8d24c815316edf56b061d678820d";
18   };
20   patches = [
21     # https://github.com/argosopentech/translate-html/pull/15
22     (fetchpatch {
23       url = "https://github.com/argosopentech/translate-html/commit/b1c2d210ec1b5fcd0eb79f578bdb5d3ed5c9963a.patch";
24       hash = "sha256-U65vVuRodMS32Aw6PZlLwaCos51P5B88n5hDgJNMZXU=";
25     })
26   ];
28   propagatedBuildInputs = [
29     argostranslate
30     beautifulsoup4
31   ];
33   postPatch = ''
34     ln -s */requires.txt requirements.txt
36     substituteInPlace requirements.txt  \
37       --replace "==" ">="
38   '';
40   # required for import check to work (argostranslate)
41   env.HOME = "/tmp";
43   pythonImportsCheck = [ "translatehtml" ];
45   doCheck = false; # no tests
47   meta = with lib; {
48     description = "Translate HTML using Beautiful Soup and Argos Translate.";
49     homepage = "https://www.argosopentech.com";
50     license = licenses.mit;
51     maintainers = with maintainers; [ misuzu ];
52   };