Skip to content

Commit

Permalink
Merge pull request #325847 from dotlambda/python3Packages.jaconv
Browse files Browse the repository at this point in the history
python312Packages.jaconv: don't use nose
  • Loading branch information
mweinelt authored Jul 9, 2024
2 parents 0f6ed02 + 75bc8aa commit 0d7271a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pkgs/development/python-modules/jaconv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nose,
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=";
};

doCheck = pythonOlder "3.12";
patches = [ ./use-pytest.patch ];

nativeCheckInputs = [
nose
pytestCheckHook
];
build-system = [ setuptools ];

nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "jaconv" ];

Expand Down
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/jaconv/use-pytest.patch
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 0d7271a

Please sign in to comment.