diff options
Diffstat (limited to 'dev-python')
14 files changed, 260 insertions, 58 deletions
diff --git a/dev-python/hatchling/hatchling-1.26.3.ebuild b/dev-python/hatchling/hatchling-1.26.3-r1.ebuild index e5f6cb572bc7..d6cb34a09c15 100644 --- a/dev-python/hatchling/hatchling-1.26.3.ebuild +++ b/dev-python/hatchling/hatchling-1.26.3-r1.ebuild @@ -36,12 +36,7 @@ RDEPEND=" $(python_gen_cond_dep ' >=dev-python/tomli-1.2.2[${PYTHON_USEDEP}] ' 3.10) -" -# always depend on the newest version available, at least until upstream -# stops treating unknown classifiers as a fatal error -# https://github.com/pypa/hatch/issues/1368 -RDEPEND+=" - >=dev-python/trove-classifiers-2024.10.16[${PYTHON_USEDEP}] + dev-python/trove-classifiers[${PYTHON_USEDEP}] " BDEPEND=" ${RDEPEND} diff --git a/dev-python/jaconv/Manifest b/dev-python/jaconv/Manifest new file mode 100644 index 000000000000..de23b01af26f --- /dev/null +++ b/dev-python/jaconv/Manifest @@ -0,0 +1,2 @@ +DIST jaconv-0.4.0-nose-to-pytest.patch 9718 BLAKE2B 3c8386357c2a1359cd7885f9070138aaa743cda747869c0a4af60888def9804f0a2c57d7dc808096f3acb79bfc5ce7c7c45c3da9e9e683e597c3168c1650b1ef SHA512 4d0abc1e26f8d0652114cdd0a7bf6bd30acea5be2e8f21a956a0305ae8363d4e7734d6c082a801b5ef3d83892d53ff709737e587c5e983be76c8dfab068868ca +DIST jaconv-0.4.0.gh.tar.gz 22876 BLAKE2B b37723afdf8516398608919ee5058dae9a99c4f0b258eb0a570b2f4f472637b6cd2e97c6f076b2d42cf74c0f1c1dce852f24a7effde79e8808b6f4e8b55020d8 SHA512 f435f1f61fef2ed36ee387138c767f88bf40dfb9d607b2b8bf9f88b1bbfd969d71c03464ce5b2adba2a65b5441eff6a0b88629cdff415366c2f1b8e6ea510bdf diff --git a/dev-python/jaconv/jaconv-0.4.0.ebuild b/dev-python/jaconv/jaconv-0.4.0.ebuild new file mode 100644 index 000000000000..8a9bfed0bcf4 --- /dev/null +++ b/dev-python/jaconv/jaconv-0.4.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} ) + +# no tags on github, no tests on PyPI +MY_PV=1d8aca73a72a4615b165602af9890517444e45d9 + +inherit distutils-r1 pypi + +DESCRIPTION="Pure-Python Japanese character interconverter" +HOMEPAGE=" + https://pypi.org/project/jaconv/ + https://github.com/ikegami-yukino/jaconv +" +SRC_URI=" + https://github.com/ikegami-yukino/jaconv/archive/${MY_PV}.tar.gz -> ${P}.gh.tar.gz + https://github.com/eli-schwartz/jaconv/commit/4f4160d33267ee7b6ff7386cdcdc6064a315b82a.patch?full_index=1 + -> ${P}-nose-to-pytest.patch +" +S="${WORKDIR}/${PN}-${MY_PV}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/ikegami-yukino/jaconv/pull/36 + "${DISTDIR}"/${P}-nose-to-pytest.patch +) + +src_prepare() { + default + # tries to add README as data to install to sys.prefix + sed -i '/data_files/d' setup.py +} diff --git a/dev-python/jaconv/metadata.xml b/dev-python/jaconv/metadata.xml new file mode 100644 index 000000000000..f8fee96e79ae --- /dev/null +++ b/dev-python/jaconv/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">jaconv</remote-id> + <remote-id type="github">ikegami-yukino/jaconv</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/pykakasi/Manifest b/dev-python/pykakasi/Manifest new file mode 100644 index 000000000000..0156094af199 --- /dev/null +++ b/dev-python/pykakasi/Manifest @@ -0,0 +1 @@ +DIST pykakasi-2.3.0.tar.gz 21752447 BLAKE2B 84bf946beebd6bbd156970b8f6610aacab2305dc3ace6798464a64f22a007bbe8a4fb76b43788638095ef5babbf9ac48ac9d1887e8e0a5859fc9dcb579e00281 SHA512 f1160a99b9d20d2e67aae265ca039c67d1ca3878703b10ff6cc559924094944ef01ca107ff7ad0e0c051080d337660eedbe52ac786eb12b01dfd80e06aa473b8 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' +} diff --git a/dev-python/setuptools/files/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch b/dev-python/setuptools/files/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch new file mode 100644 index 000000000000..4ab6bbae7af4 --- /dev/null +++ b/dev-python/setuptools/files/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch @@ -0,0 +1,65 @@ +From f694e474ab3c45af6241a3f2bf575f8188e9cbea Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz@gentoo.org> +Date: Mon, 11 Nov 2024 19:51:54 -0500 +Subject: [PATCH] Allow knowledgeable users to disable validating + trove-classifiers + +Classifiers are based on a "blessed list" of search terms that are +allowed on https://pypi.org and need to be regularly kept up to date in +order to validate them. + +Many people don't care about this. Arguably, *no one* cares about this, +since wheels that have search terms that PyPI doesn't consider popular +enough will simply fail uploading to PyPI. But also, not everyone wants +to download new lists of "allowed words" from the internet every time +they check to see if e.g. pyproject.toml contains a valid format that +won't traceback when someone tries to read the "name" field and gets an +integer instead of a string. Or their entrypoints are malformed because +they aren't a valid python object reference. + +This is also an issue because one might have an old version of the +classifiers cached, and then a new classifier is added to +https://pypi.org and you want to use it immediately, and the local +validator in the form of validate_pyproject fails but actually uploading +a wheel to https://pypi.org would work fine. + +Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> +Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> +--- + .../config/_validate_pyproject/formats.py | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/setuptools/config/_validate_pyproject/formats.py b/setuptools/config/_validate_pyproject/formats.py +index 153b1f0b2..50b8520e9 100644 +--- a/setuptools/config/_validate_pyproject/formats.py ++++ b/setuptools/config/_validate_pyproject/formats.py +@@ -205,15 +205,19 @@ class _TroveClassifier: + return value in self.downloaded or value.lower().startswith("private ::") + + +-try: +- from trove_classifiers import classifiers as _trove_classifiers +- ++if os.getenv("GENTOO_VALIDATE_PYPROJECT_NO_TROVE_CLASSIFIERS"): + def trove_classifier(value: str) -> bool: +- """See https://pypi.org/classifiers/""" +- return value in _trove_classifiers or value.lower().startswith("private ::") ++ return True ++else: ++ try: ++ from trove_classifiers import classifiers as _trove_classifiers + +-except ImportError: # pragma: no cover +- trove_classifier = _TroveClassifier() ++ def trove_classifier(value: str) -> bool: ++ """See https://pypi.org/classifiers/""" ++ return value in _trove_classifiers or value.lower().startswith("private ::") ++ ++ except ImportError: # pragma: no cover ++ trove_classifier = _TroveClassifier() + + + # ------------------------------------------------------------------------------------- +-- +2.45.2 + diff --git a/dev-python/setuptools/files/setuptools-75.6.0-disable-trove-classifiers.patch b/dev-python/setuptools/files/setuptools-75.6.0-disable-trove-classifiers.patch deleted file mode 100644 index c5111e985f61..000000000000 --- a/dev-python/setuptools/files/setuptools-75.6.0-disable-trove-classifiers.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0d9e8bc7d6df86381ac56770dc95fc75276f49ef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Thu, 21 Nov 2024 20:40:14 +0100 -Subject: [PATCH] Add an option to disable using trove-classifiers package - -As requested in https://github.com/pypa/setuptools/issues/4459, add -a VALIDATE_PYPROJECT_NO_TROVE_CLASSIFIERS environment variable that can -be used to disable using trove_classifiers package even if it is -available. This can be used when the system features an outdated -trove_classifiers, and therefore incorrectly triggers validation error. -The change is designed to be absolutely minimal and non-intrusive. ---- - setuptools/config/_validate_pyproject/formats.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/setuptools/config/_validate_pyproject/formats.py b/setuptools/config/_validate_pyproject/formats.py -index aacf4092b..0b05ab17b 100644 ---- a/setuptools/config/_validate_pyproject/formats.py -+++ b/setuptools/config/_validate_pyproject/formats.py -@@ -210,6 +210,9 @@ try: - """See https://pypi.org/classifiers/""" - return value in _trove_classifiers or value.lower().startswith("private ::") - -+ if os.getenv("VALIDATE_PYPROJECT_NO_TROVE_CLASSIFIERS"): # pragma: no cover -+ raise ImportError() -+ - except ImportError: # pragma: no cover - trove_classifier = _TroveClassifier() - --- -2.47.0 - diff --git a/dev-python/setuptools/setuptools-74.1.3-r1.ebuild b/dev-python/setuptools/setuptools-74.1.3-r2.ebuild index 9cc97e5921d2..62bcc9708b4a 100644 --- a/dev-python/setuptools/setuptools-74.1.3-r1.ebuild +++ b/dev-python/setuptools/setuptools-74.1.3-r2.ebuild @@ -64,20 +64,15 @@ BDEPEND=" " # setuptools-scm is here because installing plugins apparently breaks stuff at # runtime, so let's pull it early. See bug #663324. -# -# trove-classifiers are optionally used in validation, if they are -# installed. Since we really oughtn't block them, let's always enforce -# the newest version for the time being to avoid errors. -# https://github.com/pypa/setuptools/issues/4459 PDEPEND=" dev-python/setuptools-scm[${PYTHON_USEDEP}] - >=dev-python/trove-classifiers-2024.10.16[${PYTHON_USEDEP}] " src_prepare() { local PATCHES=( # TODO: remove this when we're 100% PEP517 mode "${FILESDIR}/setuptools-62.4.0-py-compile.patch" + "${FILESDIR}"/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch ) distutils-r1_src_prepare diff --git a/dev-python/setuptools/setuptools-75.5.0.ebuild b/dev-python/setuptools/setuptools-75.5.0-r1.ebuild index 8bd616a1e315..9e5a6fe7eb3f 100644 --- a/dev-python/setuptools/setuptools-75.5.0.ebuild +++ b/dev-python/setuptools/setuptools-75.5.0-r1.ebuild @@ -66,20 +66,15 @@ BDEPEND=" " # setuptools-scm is here because installing plugins apparently breaks stuff at # runtime, so let's pull it early. See bug #663324. -# -# trove-classifiers are optionally used in validation, if they are -# installed. Since we really oughtn't block them, let's always enforce -# the newest version for the time being to avoid errors. -# https://github.com/pypa/setuptools/issues/4459 PDEPEND=" dev-python/setuptools-scm[${PYTHON_USEDEP}] - >=dev-python/trove-classifiers-2024.10.16[${PYTHON_USEDEP}] " src_prepare() { local PATCHES=( # TODO: remove this when we're 100% PEP517 mode "${FILESDIR}/setuptools-62.4.0-py-compile.patch" + "${FILESDIR}"/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch ) distutils-r1_src_prepare diff --git a/dev-python/setuptools/setuptools-75.6.0-r1.ebuild b/dev-python/setuptools/setuptools-75.6.0-r2.ebuild index a9961b9303cc..9e5a6fe7eb3f 100644 --- a/dev-python/setuptools/setuptools-75.6.0-r1.ebuild +++ b/dev-python/setuptools/setuptools-75.6.0-r2.ebuild @@ -66,22 +66,15 @@ BDEPEND=" " # setuptools-scm is here because installing plugins apparently breaks stuff at # runtime, so let's pull it early. See bug #663324. -# -# trove-classifiers are optionally used in validation, if they are -# installed. Since we really oughtn't block them, let's always enforce -# the newest version for the time being to avoid errors. -# https://github.com/pypa/setuptools/issues/4459 PDEPEND=" dev-python/setuptools-scm[${PYTHON_USEDEP}] - >=dev-python/trove-classifiers-2024.10.16[${PYTHON_USEDEP}] " src_prepare() { local PATCHES=( # TODO: remove this when we're 100% PEP517 mode "${FILESDIR}/setuptools-62.4.0-py-compile.patch" - # https://github.com/abravalheri/validate-pyproject/pull/221 - "${FILESDIR}/setuptools-75.6.0-disable-trove-classifiers.patch" + "${FILESDIR}"/0001-Allow-knowledgeable-users-to-disable-validating-trov.patch ) distutils-r1_src_prepare |