python3Packages.argos-translate-files: modernize

- Fetch from GitHub
- And avoid recursive attribute sets.
- Enable checks
This commit is contained in:
Steven Allen
2026-03-18 09:48:14 -07:00
parent 6f5594ca37
commit 0bafac1fe5
@@ -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 ];
};
}
})