app-shells/thefuck: update py3, use EPYTEST_PLUGINS, fix >=setuptools-82

use EPYTEST_PLUGINS
enable py3.14 / drop py3.10
don't use obsolete pkg_resources
remove sed-op, no longer required since thefuck-3.11

Closes: https://bugs.gentoo.org/971648
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/461
Merges: https://codeberg.org/gentoo/gentoo/pulls/461
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Nicolas PARLANT
2026-03-30 09:44:58 +02:00
committed by Sam James
parent 80171d64a6
commit 07356d87d9
2 changed files with 31 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
don't use obsolete pkg_resources
partially from PR https://github.com/nvbn/thefuck/pull/1558
see https://bugs.gentoo.org/971648
--- a/setup.py
+++ b/setup.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
-import pkg_resources
+from importlib.metadata import version as get_version, PackageNotFoundError
import sys
import os
import fastentrypoints
try:
- if int(pkg_resources.get_distribution("pip").version.split('.')[0]) < 6:
+ if int(get_version("pip").split('.')[0]) < 6:
print('pip older than 6.0 not supported, please upgrade pip with:\n\n'
' pip install -U pip')
sys.exit(-1)
-except pkg_resources.DistributionNotFound:
+except PackageNotFoundError:
pass
if os.environ.get('CONVERT_README'):

View File

@@ -1,10 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1
@@ -21,18 +21,15 @@ RDEPEND="
dev-python/six[${PYTHON_USEDEP}]
dev-python/decorator[${PYTHON_USEDEP}]
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/pyte[${PYTHON_USEDEP}]"
DEPEND="
test? (
dev-python/mock[${PYTHON_USEDEP}]
dev-python/pytest-mock[${PYTHON_USEDEP}]
)
dev-python/pyte[${PYTHON_USEDEP}]
"
PATCHES=(
"${FILESDIR}"/${P}-python-312.patch
"${FILESDIR}"/${PN}-3.32-setuptools_82.patch
)
EPYTEST_PLUGINS=( pytest-mock mock )
distutils_enable_tests pytest
EPYTEST_DESELECT=(
@@ -44,8 +41,3 @@ EPYTEST_DESELECT=(
# These tests fail with py312; #929026
tests/test_utils.py::TestGetValidHistoryWithoutCurrent::test_get_valid_history_without_current
)
python_prepare_all() {
sed -i -e "/import pip/s/^/#/" -e "/pip.__version__/,+3 s/^/#/" setup.py || die
distutils-r1_python_prepare_all
}