From c97a3ace23de27a80012cb95db5a55d29ae55fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 9 Jul 2024 06:44:32 -0700 Subject: [PATCH 1/3] Revert "python312Packages.jaconv: disable tests for python 3.12" This reverts commit 79a5e9bfc58334fa558e94d8010d356bb0af7113. --- pkgs/development/python-modules/jaconv/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/jaconv/default.nix b/pkgs/development/python-modules/jaconv/default.nix index e1813ef320ab7..474b168c6042b 100644 --- a/pkgs/development/python-modules/jaconv/default.nix +++ b/pkgs/development/python-modules/jaconv/default.nix @@ -21,8 +21,6 @@ buildPythonPackage rec { hash = "sha256-9ruhOLaYNESeKOwJs3IN6ct66fSq7My9DOyA7/cH3d0="; }; - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose pytestCheckHook From 195215f7e048f44b79e8b7dad33cf790dc019af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 9 Jul 2024 06:45:22 -0700 Subject: [PATCH 2/3] python312Packages.jaconv: don't use nose --- .../python-modules/jaconv/default.nix | 4 +-- .../python-modules/jaconv/use-pytest.patch | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/jaconv/use-pytest.patch diff --git a/pkgs/development/python-modules/jaconv/default.nix b/pkgs/development/python-modules/jaconv/default.nix index 474b168c6042b..e78b14e2abdcb 100644 --- a/pkgs/development/python-modules/jaconv/default.nix +++ b/pkgs/development/python-modules/jaconv/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - nose, pythonOlder, pytestCheckHook, }: @@ -21,8 +20,9 @@ buildPythonPackage rec { hash = "sha256-9ruhOLaYNESeKOwJs3IN6ct66fSq7My9DOyA7/cH3d0="; }; + patches = [ ./use-pytest.patch ]; + nativeCheckInputs = [ - nose pytestCheckHook ]; diff --git a/pkgs/development/python-modules/jaconv/use-pytest.patch b/pkgs/development/python-modules/jaconv/use-pytest.patch new file mode 100644 index 0000000000000..b91704ee4f32d --- /dev/null +++ b/pkgs/development/python-modules/jaconv/use-pytest.patch @@ -0,0 +1,34 @@ +diff --git a/test_jaconv.py b/test_jaconv.py +index 7e0a169..aaf180d 100644 +--- a/test_jaconv.py ++++ b/test_jaconv.py +@@ -1,11 +1,8 @@ + # -*- coding: utf-8 -*- + from __future__ import unicode_literals +-from nose.tools import assert_equal, nottest + import jaconv + from functools import partial + +-assert_equal.__self__.maxDiff = None +- + HIRAGANA = ('ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞた', + 'だちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽま', + 'みむめもゃやゅゆょよらりるれろわをんーゎゐゑゕゖゔゝゞ・「」。、') +@@ -25,13 +22,15 @@ FULL_ASCII = ('!"#$%&'()*+,-./:;<=>? + FULL_DIGIT = '0123456789' + + +-@nottest ++def assert_equal(x, y): ++ assert x == y ++ ++ + def _compare(mathod, lhs, rhs): + for i in range(len(lhs)): + assert_equal(mathod(lhs[i]), rhs[i]) + + +-@nottest + def _concat(*iterables): + result = '' + for iterable in iterables: From 75bc8aa03a38155457c72c6d80f8fcb9c25c9b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 9 Jul 2024 06:47:04 -0700 Subject: [PATCH 3/3] python312Packages.jaconv: modernize --- pkgs/development/python-modules/jaconv/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/jaconv/default.nix b/pkgs/development/python-modules/jaconv/default.nix index e78b14e2abdcb..d56e02f9d6748 100644 --- a/pkgs/development/python-modules/jaconv/default.nix +++ b/pkgs/development/python-modules/jaconv/default.nix @@ -3,28 +3,29 @@ buildPythonPackage, fetchFromGitHub, pythonOlder, + setuptools, pytestCheckHook, }: buildPythonPackage rec { pname = "jaconv"; version = "0.3.4"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "ikegami-yukino"; - repo = pname; + repo = "jaconv"; rev = "refs/tags/v${version}"; hash = "sha256-9ruhOLaYNESeKOwJs3IN6ct66fSq7My9DOyA7/cH3d0="; }; patches = [ ./use-pytest.patch ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "jaconv" ];