From 07356d87d9e8ceb8dc73c3d188ccb4907fb8a7e1 Mon Sep 17 00:00:00 2001 From: Nicolas PARLANT Date: Mon, 30 Mar 2026 09:44:58 +0200 Subject: [PATCH] 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 Part-of: https://codeberg.org/gentoo/gentoo/pulls/461 Merges: https://codeberg.org/gentoo/gentoo/pulls/461 Signed-off-by: Sam James --- .../files/thefuck-3.32-setuptools_82.patch | 26 +++++++++++++++++++ app-shells/thefuck/thefuck-3.32-r2.ebuild | 18 ++++--------- 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 app-shells/thefuck/files/thefuck-3.32-setuptools_82.patch diff --git a/app-shells/thefuck/files/thefuck-3.32-setuptools_82.patch b/app-shells/thefuck/files/thefuck-3.32-setuptools_82.patch new file mode 100644 index 0000000000000..a9736bc11169a --- /dev/null +++ b/app-shells/thefuck/files/thefuck-3.32-setuptools_82.patch @@ -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'): diff --git a/app-shells/thefuck/thefuck-3.32-r2.ebuild b/app-shells/thefuck/thefuck-3.32-r2.ebuild index c5992a773800c..b5ede23f30e36 100644 --- a/app-shells/thefuck/thefuck-3.32-r2.ebuild +++ b/app-shells/thefuck/thefuck-3.32-r2.ebuild @@ -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 -}