Unverified Commit 6024b4aa authored by misuzu's avatar misuzu Committed by GitHub
Browse files

python3Packages.argos-translate-files: modernize, fix missing deps (#436952)

parents df4208cd fbfcacf4
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -2,37 +2,44 @@
  lib,
  buildPythonPackage,
  fetchPypi,
  writableTmpDirAsHomeHook,
  setuptools,
  lxml,
  pymupdf,
  pysrt,
  translatehtml,
}:

buildPythonPackage rec {
  pname = "argos-translate-files";
  version = "1.4.0";

  format = "setuptools";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-vKnPL0xgyJ1vYtB2AgnKv4BqigSiFYmIm5HBq4hQ7nI=";
  };

  propagatedBuildInputs = [
  build-system = [ setuptools ];

  dependencies = [
    lxml
    pymupdf
    pysrt
    translatehtml
  ];

  nativeCheckInputs = [
    # pythonImportsCheck needs a home dir for argostranslatefiles
    writableTmpDirAsHomeHook
  ];

  postPatch = ''
    ln -s */requires.txt requirements.txt
  '';

  # required for import check to work (argostranslate)
  env.HOME = "/tmp";

  pythonImportsCheck = [ "argostranslatefiles" ];

  doCheck = false; # no tests

  meta = with lib; {
    description = "Translate files using Argos Translate";
    homepage = "https://www.argosopentech.com";