diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-11-30 02:06:22 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-11-30 02:06:22 +0000 |
commit | 080d89feff80cae2fc974ff2f24d463141c20635 (patch) | |
tree | 53d0a66fabd88f847940192be8163c5f3291d434 /dev-python/pykakasi | |
parent | 2a3c08f4647671d17f534a5dbd8bd45e11c90ea2 (diff) |
gentoo auto-resync : 30:11:2024 - 02:06:22
Diffstat (limited to 'dev-python/pykakasi')
-rw-r--r-- | dev-python/pykakasi/Manifest | 5 | ||||
-rw-r--r-- | dev-python/pykakasi/files/0001-fix-update-test-expectation.patch | 24 | ||||
-rw-r--r-- | dev-python/pykakasi/files/0001-tests-make-benchmarking-optional.patch | 50 | ||||
-rw-r--r-- | dev-python/pykakasi/metadata.xml | 16 | ||||
-rw-r--r-- | dev-python/pykakasi/pykakasi-2.3.0.ebuild | 41 |
5 files changed, 136 insertions, 0 deletions
diff --git a/dev-python/pykakasi/Manifest b/dev-python/pykakasi/Manifest new file mode 100644 index 000000000000..285022c958a5 --- /dev/null +++ b/dev-python/pykakasi/Manifest @@ -0,0 +1,5 @@ +AUX 0001-fix-update-test-expectation.patch 818 BLAKE2B 8110378b928ddec309a61bbb93b0a79a353a713332208e4768a85dbee6293ac4fd10e9c691bafaff85b8423fc8b5f230003a68c5e21e459ca37d0824b0b9dbc9 SHA512 79ce631602cd5d66e21832aac9f6213b43f865d704ff57dcafe8adb55b95058b90f1b8dffcb8336daf052fb6f062789f8daf66eb09d809e7cc2e003b1740dca2 +AUX 0001-tests-make-benchmarking-optional.patch 1519 BLAKE2B bf74a440e7009e9ddffc5e7de608c9deabb3d192c3ca9d7378fd764946c831e3e97604be4ff560d4280115810e209795cc7c72d27c739b07038d1ab1b3da2c24 SHA512 07d3ef50a59db4ac73372a0e67cd743e8dd70e172c52e2dfb1e045f6dba59825814e35065ad39bdfc2692876d32187176b0a1c5eb0df2b91c26c7b3da08fde51 +DIST pykakasi-2.3.0.tar.gz 21752447 BLAKE2B 84bf946beebd6bbd156970b8f6610aacab2305dc3ace6798464a64f22a007bbe8a4fb76b43788638095ef5babbf9ac48ac9d1887e8e0a5859fc9dcb579e00281 SHA512 f1160a99b9d20d2e67aae265ca039c67d1ca3878703b10ff6cc559924094944ef01ca107ff7ad0e0c051080d337660eedbe52ac786eb12b01dfd80e06aa473b8 +EBUILD pykakasi-2.3.0.ebuild 902 BLAKE2B 7f8d74e126440206feae46d88dca6765a9094815db204ee1157b79455c0f20c740468872ea954b095a0dfdc4b1d99c419e672f15929093e8b32d463a52bc026f SHA512 df4f830a64c1657c24dc149954910662ac73decb78b6d268f60ffb036edcccc95b79a3a263735e2c55ce2e67a739a8f59dada52e9fabb1031bdc911322c0a55b +MISC metadata.xml 479 BLAKE2B 1b8f1bc64e728e2cdb713bc7e3b15cbf3d0de5a48951a1541b1b1d877b9d88c1a2e018b0416f6c7a2b512ede1a9abeb4fc906a1a6218d815774c3767ee9b392d SHA512 d025ba4db3b1ae2c5e8e4c8cbba5754b6cd5c2c40ab446a71a38a5879774afd5d609c2560e553d7ff2c800129a98523689ca228fd4a21d61ce53e32b6ef747f1 diff --git a/dev-python/pykakasi/files/0001-fix-update-test-expectation.patch b/dev-python/pykakasi/files/0001-fix-update-test-expectation.patch new file mode 100644 index 000000000000..8d073039a5b1 --- /dev/null +++ b/dev-python/pykakasi/files/0001-fix-update-test-expectation.patch @@ -0,0 +1,24 @@ +From c27fa6eb714af6e34e302e479456f1cc68529f46 Mon Sep 17 00:00:00 2001 +From: Hiroshi Miura <miurahr@linux.com> +Date: Mon, 24 Jun 2024 19:02:45 +0900 +Subject: [PATCH] fix: update test expectation + +- fix punctuation +--- + tests/test_pykakasi_structured.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/test_pykakasi_structured.py b/tests/test_pykakasi_structured.py +index 83b3be0..c7ba3bb 100644 +--- a/tests/test_pykakasi_structured.py ++++ b/tests/test_pykakasi_structured.py +@@ -666,4 +666,5 @@ def test_aozora(): + assert result[7]['kana'] == 'カラ' + assert result[8]['kana'] == 'タイグウ' + assert result[9]['kana'] == 'サレテ' +- assert result[10]['kana'] == 'イル。' ++ assert result[10]['kana'] == 'イル' ++ assert result[11]['kana'] == '。' +-- +2.45.2 + diff --git a/dev-python/pykakasi/files/0001-tests-make-benchmarking-optional.patch b/dev-python/pykakasi/files/0001-tests-make-benchmarking-optional.patch new file mode 100644 index 000000000000..3b2095ccc8a0 --- /dev/null +++ b/dev-python/pykakasi/files/0001-tests-make-benchmarking-optional.patch @@ -0,0 +1,50 @@ +From e51d045f6bc2d70538c24a9997ca90500019d567 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz@gentoo.org> +Date: Fri, 29 Nov 2024 00:42:32 -0500 +Subject: [PATCH] tests: make benchmarking optional + +It can be disabled by running `pytest -m 'not benchmark'`. In this case, +we don't need pytest-benchmark or py-cpuinfo installed. + +To make this work, we need to tell pytest that the benchmarking hooks in +conftest.py are optional, and only needed when a particular plugin is +installed. + +Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> +--- + tests/conftest.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 524b813..374899d 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -1,7 +1,6 @@ + import os + import sys + +-import cpuinfo + import pytest + + import kakasidict +@@ -18,6 +17,7 @@ def dictionary_setup_fixture(): + Configurations.data_path = dpath + + ++@pytest.hookimpl(optionalhook=True) + def pytest_benchmark_update_json(config, benchmarks, output_json): + """Calculate speed and add as extra_info""" + for benchmark in output_json["benchmarks"]: +@@ -26,7 +26,9 @@ def pytest_benchmark_update_json(config, benchmarks, output_json): + benchmark["extra_info"]["rate"] = rate + + ++@pytest.hookimpl(optionalhook=True) + def pytest_benchmark_update_machine_info(config, machine_info): ++ import cpuinfo + cpu_info = cpuinfo.get_cpu_info() + brand = cpu_info.get("brand_raw", None) + if brand is None: +-- +2.45.2 + diff --git a/dev-python/pykakasi/metadata.xml b/dev-python/pykakasi/metadata.xml new file mode 100644 index 000000000000..4fd6f2f1d995 --- /dev/null +++ b/dev-python/pykakasi/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>eschwartz@gentoo.org</email> + <name>Eli Schwartz</name> + </maintainer> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <upstream> + <remote-id type="pypi">pykakasi</remote-id> + <remote-id type="codeberg">miurahr/pykakasi</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/pykakasi/pykakasi-2.3.0.ebuild b/dev-python/pykakasi/pykakasi-2.3.0.ebuild new file mode 100644 index 000000000000..dc3958635fc6 --- /dev/null +++ b/dev-python/pykakasi/pykakasi-2.3.0.ebuild @@ -0,0 +1,41 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Kana kanji simple inversion library" +HOMEPAGE=" + https://pypi.org/project/pykakasi/ + https://codeberg.org/miurahr/pykakasi +" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + dev-python/deprecated[${PYTHON_USEDEP}] + dev-python/jaconv[${PYTHON_USEDEP}] +" +BDEPEND=" + dev-python/setuptools-scm[${PYTHON_USEDEP}] +" + +distutils_enable_tests pytest + +PATCHES=( + # https://codeberg.org/miurahr/pykakasi/pulls/175 + # Avoids several pointless, unpackaged test deps + "${FILESDIR}"/0001-tests-make-benchmarking-optional.patch + # released with a failing test and immediately fixed after... + "${FILESDIR}"/0001-fix-update-test-expectation.patch +) + +python_test() { + epytest -m 'not benchmark' +} |