From e60e61c600300b9e9a806cb973ad2cb32afaf846 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 17 Feb 2026 18:13:25 +0000 Subject: [PATCH] python313Packages.sacremoses: modernize package Co-authored-by: Sarah Clark --- .../python-modules/sacremoses/default.nix | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/sacremoses/default.nix b/pkgs/development/python-modules/sacremoses/default.nix index 82e0d80ba537..98b49fa4cac0 100644 --- a/pkgs/development/python-modules/sacremoses/default.nix +++ b/pkgs/development/python-modules/sacremoses/default.nix @@ -1,38 +1,44 @@ { - buildPythonPackage, lib, + buildPythonPackage, fetchFromGitHub, + # build-system + setuptools, + # dependencies click, joblib, - tqdm, regex, - pytest, + tqdm, + # tests + pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "sacremoses"; version = "0.1.1"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "hplt-project"; repo = "sacremoses"; - rev = version; + tag = finalAttrs.version; sha256 = "sha256-ked6/8oaGJwVW1jvpjrWtJYfr0GKUHdJyaEuzid/S3M="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ click joblib - tqdm regex + tqdm ]; - nativeCheckInputs = [ pytest ]; + nativeCheckInputs = [ pytestCheckHook ]; # ignore tests which call to remote host - checkPhase = '' - pytest -k 'not truecase' - ''; + disabledTestPaths = [ + "sacremoses/test/test_truecaser.py::TestTruecaser" + ]; meta = { homepage = "https://github.com/alvations/sacremoses"; @@ -42,4 +48,4 @@ buildPythonPackage rec { platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ pashashocky ]; }; -} +})