From 0bafac1fe58cc339bae017caabb84bc2fdcfe4ba Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 18 Mar 2026 09:38:03 -0700 Subject: [PATCH] python3Packages.argos-translate-files: modernize - Fetch from GitHub - And avoid recursive attribute sets. - Enable checks --- .../argos-translate-files/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/argos-translate-files/default.nix b/pkgs/development/python-modules/argos-translate-files/default.nix index 1e3b2e7661d7..9776dde15d7b 100644 --- a/pkgs/development/python-modules/argos-translate-files/default.nix +++ b/pkgs/development/python-modules/argos-translate-files/default.nix @@ -1,7 +1,8 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + pytestCheckHook, writableTmpDirAsHomeHook, setuptools, lxml, @@ -10,14 +11,16 @@ translatehtml, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "argos-translate-files"; version = "1.4.1"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-9ufNuExfyW3gr8+pIpp6Ie03e0hE4l3l3kk6EiVH0x8="; + src = fetchFromGitHub { + owner = "LibreTranslate"; + repo = "argos-translate-files"; + tag = "v${finalAttrs.version}"; + hash = "sha256-XCrABdyly249dpam0pSwTWHoli/uijoUYKaHQhCqB7Y="; }; build-system = [ setuptools ]; @@ -29,15 +32,14 @@ buildPythonPackage rec { translatehtml ]; + doCheck = true; + nativeCheckInputs = [ + pytestCheckHook # pythonImportsCheck needs a home dir for argostranslatefiles writableTmpDirAsHomeHook ]; - postPatch = '' - ln -s */requires.txt requirements.txt - ''; - pythonImportsCheck = [ "argostranslatefiles" ]; meta = { @@ -46,4 +48,4 @@ buildPythonPackage rec { license = lib.licenses.mit; maintainers = with lib.maintainers; [ misuzu ]; }; -} +})