From 58e85c8af610dbe301662e461155d9156def69e1 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 24 Mar 2026 10:23:39 -0700 Subject: [PATCH 1/4] python3Packages.translatehtml: 1.5.2 -> 1.5.3; modernize In addition to the package update, this commit: 1. Switches to fetching from GitHub. This is the first version released on GitHub, otherwise I'd switch to GitHub in a separate commit. 2. Uses the modern pyproject python builder. 3. Removes the recursive attribute set. --- .../python-modules/translatehtml/default.nix | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/pkgs/development/python-modules/translatehtml/default.nix b/pkgs/development/python-modules/translatehtml/default.nix index 3ae69fd354e1..efb5d2fb93b1 100644 --- a/pkgs/development/python-modules/translatehtml/default.nix +++ b/pkgs/development/python-modules/translatehtml/default.nix @@ -1,49 +1,36 @@ { lib, buildPythonPackage, - fetchPypi, - fetchpatch, + fetchFromGitHub, + writableTmpDirAsHomeHook, + setuptools, argostranslate, beautifulsoup4, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "translatehtml"; - version = "1.5.2"; + version = "1.5.3"; + pyproject = true; - format = "setuptools"; - - src = fetchPypi { - inherit pname version; - sha256 = "6b30ceb8b6f174917e2660caf2d2ccbaa71d8d24c815316edf56b061d678820d"; + src = fetchFromGitHub { + owner = "argosopentech"; + repo = "translate-html"; + tag = "v${finalAttrs.version}"; + hash = "sha256-A94N/nfYSVwi0M3SpNFqlXrRNOCpIi9agOCAlH66QcI="; }; - patches = [ - # https://github.com/argosopentech/translate-html/pull/15 - (fetchpatch { - url = "https://github.com/argosopentech/translate-html/commit/b1c2d210ec1b5fcd0eb79f578bdb5d3ed5c9963a.patch"; - hash = "sha256-U65vVuRodMS32Aw6PZlLwaCos51P5B88n5hDgJNMZXU="; - }) - ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + pythonRelaxDeps = [ "beautifulsoup4" ]; + + dependencies = [ argostranslate beautifulsoup4 ]; - postPatch = '' - ln -s */requires.txt requirements.txt - - substituteInPlace requirements.txt \ - --replace "==" ">=" - ''; - - # required for import check to work (argostranslate) - env.HOME = "/tmp"; - pythonImportsCheck = [ "translatehtml" ]; - - doCheck = false; # no tests + nativeCheckInputs = [ writableTmpDirAsHomeHook ]; meta = { description = "Translate HTML using Beautiful Soup and Argos Translate"; @@ -51,4 +38,4 @@ buildPythonPackage rec { license = lib.licenses.mit; maintainers = with lib.maintainers; [ misuzu ]; }; -} +}) From 38fd937d7569a832b3eae7e4a2f8d48c673d4d86 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 24 Mar 2026 10:30:02 -0700 Subject: [PATCH 2/4] python3Packages.translatehtml: skip pythonImportsCheck on aarch64 --- .../python-modules/translatehtml/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/translatehtml/default.nix b/pkgs/development/python-modules/translatehtml/default.nix index efb5d2fb93b1..87acf0ff9d99 100644 --- a/pkgs/development/python-modules/translatehtml/default.nix +++ b/pkgs/development/python-modules/translatehtml/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, writableTmpDirAsHomeHook, @@ -8,6 +9,10 @@ beautifulsoup4, }: +let + inherit (stdenv.hostPlatform) isLinux isAarch64; + isAarch64Linux = isLinux && isAarch64; +in buildPythonPackage (finalAttrs: { pname = "translatehtml"; version = "1.5.3"; @@ -29,8 +34,11 @@ buildPythonPackage (finalAttrs: { beautifulsoup4 ]; - pythonImportsCheck = [ "translatehtml" ]; + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optional (!isAarch64Linux) "translatehtml"; nativeCheckInputs = [ writableTmpDirAsHomeHook ]; + doCheck = !isAarch64Linux; meta = { description = "Translate HTML using Beautiful Soup and Argos Translate"; From 96b9f4f77c283ee4c2fb3b5fe90cbb8ac6904f29 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 24 Mar 2026 10:32:14 -0700 Subject: [PATCH 3/4] python3Packages.argos-translate-files: skip pythonImportsCheck on aarch64 --- .../python-modules/argos-translate-files/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/argos-translate-files/default.nix b/pkgs/development/python-modules/argos-translate-files/default.nix index dc86edc06605..6003dd24a067 100644 --- a/pkgs/development/python-modules/argos-translate-files/default.nix +++ b/pkgs/development/python-modules/argos-translate-files/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, pytestCheckHook, @@ -11,6 +12,10 @@ translatehtml, }: +let + inherit (stdenv.hostPlatform) isLinux isAarch64; + isAarch64Linux = isLinux && isAarch64; +in buildPythonPackage (finalAttrs: { pname = "argos-translate-files"; version = "1.4.4"; @@ -43,15 +48,16 @@ buildPythonPackage (finalAttrs: { translatehtml ]; - doCheck = true; - nativeCheckInputs = [ pytestCheckHook # pythonImportsCheck needs a home dir for argostranslatefiles writableTmpDirAsHomeHook ]; - pythonImportsCheck = [ "argostranslatefiles" ]; + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optional (!isAarch64Linux) "argostranslatefiles"; + doCheck = !isAarch64Linux; meta = { description = "Translate files using Argos Translate"; From 4891d4e7f41c16aef42f0a384989804f0f6f0e15 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 24 Mar 2026 10:36:02 -0700 Subject: [PATCH 4/4] libretranslate: skip pythonImportsCheck on aarch64 --- .../python-modules/libretranslate/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/libretranslate/default.nix b/pkgs/development/python-modules/libretranslate/default.nix index 1b3cc31e3cf4..7a5561effa66 100644 --- a/pkgs/development/python-modules/libretranslate/default.nix +++ b/pkgs/development/python-modules/libretranslate/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, pkgs, buildPythonPackage, fetchFromGitHub, @@ -32,6 +33,10 @@ lndir, }: +let + inherit (stdenv.hostPlatform) isLinux isAarch64; + isAarch64Linux = isLinux && isAarch64; +in buildPythonPackage (finalAttrs: { pname = "libretranslate"; version = "1.9.5"; @@ -90,7 +95,11 @@ buildPythonPackage (finalAttrs: { # needed to import the argostranslate module nativeCheckInputs = [ writableTmpDirAsHomeHook ]; - pythonImportsCheck = [ "libretranslate" ]; + + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optional (!isAarch64Linux) "libretranslate"; + doCheck = !isAarch64Linux; passthru = { static-compressed =