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 -}