From cd59f6ab243f5021d4e7f4369de79facdad3161c Mon Sep 17 00:00:00 2001 From: Henri Gasc Date: Fri, 12 Apr 2024 23:42:08 +0200 Subject: [PATCH] dev-python/manhole: update PYTHON_COMPAT for 3.12 Signed-off-by: Henri Gasc --- dev-python/manhole/files/importlib.patch | 11 ++++ dev-python/manhole/manhole-1.8.0-r1.ebuild | 55 ---------------- dev-python/manhole/manhole-1.8.0-r2.ebuild | 73 ++++++++++++++++++++++ dev-python/manhole/metadata.xml | 8 +-- 4 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 dev-python/manhole/files/importlib.patch delete mode 100644 dev-python/manhole/manhole-1.8.0-r1.ebuild create mode 100644 dev-python/manhole/manhole-1.8.0-r2.ebuild diff --git a/dev-python/manhole/files/importlib.patch b/dev-python/manhole/files/importlib.patch new file mode 100644 index 0000000000..e9cb141349 --- /dev/null +++ b/dev-python/manhole/files/importlib.patch @@ -0,0 +1,11 @@ +Use importlib as imp is removed in python3.12 +--- a/tests/test_manhole.py ++++ b/tests/test_manhole.py +@@ -1,6 +1,6 @@ + from __future__ import print_function + +-import imp ++import importlib + import os + import re + import select diff --git a/dev-python/manhole/manhole-1.8.0-r1.ebuild b/dev-python/manhole/manhole-1.8.0-r1.ebuild deleted file mode 100644 index a0d3e53599..0000000000 --- a/dev-python/manhole/manhole-1.8.0-r1.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..11} pypy3 ) -DISTUTILS_USE_PEP517=setuptools -inherit distutils-r1 - -DESCRIPTION="Debugging manhole for python application" -HOMEPAGE=" - https://github.com/ionelmc/python-manhole - https://pypi.org/project/manhole/ -" -SRC_URI="https://github.com/ionelmc/python-${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" -S="${WORKDIR}/python-${P}" - -LICENSE="BSD-2" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~x86" - -BDEPEND=" - test? ( - dev-python/process-tests[${PYTHON_USEDEP}] - dev-python/requests[${PYTHON_USEDEP}] - ) -" - -DOCS=( AUTHORS.rst CHANGELOG.rst README.rst ) - -distutils_enable_tests pytest - -distutils_enable_sphinx docs \ - dev-python/sphinx-py3doc-enhanced-theme - -python_test() { - local -x PYTHONPATH="${S}/src:${PYTHONPATH}" - local EPYTEST_DESELECT=( - tests/test_manhole.py::test_connection_handler_exec - tests/test_manhole.py::test_non_daemon_connection - tests/test_manhole.py::test_daemon_connection - tests/test_manhole.py::test_environ_variable_activation - tests/test_manhole.py::test_fork_exec - tests/test_manhole.py::test_uwsgi - tests/test_manhole_cli.py::test_help - - # usually passes but sometimes fails (bug #792225) - tests/test_manhole.py::test_stderr_doesnt_deadlock - ) - - [[ ${EPYTHON} == pypy3 ]] && \ - EPYTEST_DESELECT+=( tests/test_manhole.py::test_log_fh ) - - distutils-r1_python_test -} diff --git a/dev-python/manhole/manhole-1.8.0-r2.ebuild b/dev-python/manhole/manhole-1.8.0-r2.ebuild new file mode 100644 index 0000000000..51160ca796 --- /dev/null +++ b/dev-python/manhole/manhole-1.8.0-r2.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} pypy3 ) +DISTUTILS_USE_PEP517=setuptools + +DOCS_BUILDER="sphinx" +DOCS_DEPEND="dev-python/sphinx-py3doc-enhanced-theme" +DOCS_DIR="docs" + +inherit distutils-r1 docs + +DESCRIPTION="Debugging manhole for python application" +HOMEPAGE=" + https://github.com/ionelmc/python-manhole + https://pypi.org/project/manhole/ +" +SRC_URI="https://github.com/ionelmc/python-${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" +S="${WORKDIR}/python-${P}" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" + +BDEPEND=" + test? ( + dev-python/process-tests[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + ) +" + +DOCS=( AUTHORS.rst CHANGELOG.rst README.rst ) + +PATCHES=( + "${FILESDIR}/importlib.patch" +) + +distutils_enable_tests pytest + +EPYTEST_DESELECT=( + # Need an internet connection + tests/test_manhole.py::test_simple + tests/test_manhole.py::test_connection_handler_exec + tests/test_manhole.py::test_daemon_connection + tests/test_manhole.py::test_non_daemon_connection + tests/test_manhole.py::test_locals_after_fork + tests/test_manhole.py::test_socket_path + tests/test_manhole.py::test_with_fork + tests/test_manhole.py::test_with_forkpty + tests/test_manhole.py::test_oneshot_on_usr2_error + + # Need the python package signalfd + tests/test_manhole.py::test_sigprocmask + tests/test_manhole.py::test_sigprocmask_negative + tests/test_manhole.py::test_sigmask + + # Usually passes but sometimes fails (bug #792225) + tests/test_manhole.py::test_stderr_doesnt_deadlock + + # Cannot find a file or directory + tests/test_manhole.py::test_uwsgi + + # Broken + tests/test_manhole_cli.py::test_help +) + +python_test() { + [[ ${EPYTHON} == pypy3 ]] && \ + EPYTEST_DESELECT+=( tests/test_manhole.py::test_log_fh ) + distutils-r1_python_test +} diff --git a/dev-python/manhole/metadata.xml b/dev-python/manhole/metadata.xml index be54c622f7..e43aa1c8fa 100644 --- a/dev-python/manhole/metadata.xml +++ b/dev-python/manhole/metadata.xml @@ -3,12 +3,12 @@ -Manhole is in-process service that will accept unix domain socket connections and present the stacktraces for all threads and an interactive prompt. It can either work as a python daemon thread waiting for connections at all times or a signal handler (stopping your application and waiting for a connection). + Manhole is in-process service that will accept unix domain socket connections and present the stacktraces for all threads and an interactive prompt. It can either work as a python daemon thread waiting for connections at all times or a signal handler (stopping your application and waiting for a connection). -Access to the socket is restricted to the application's effective user id or root. + Access to the socket is restricted to the application's effective user id or root. -This is just like Twisted's manhole. It's simpler (no dependencies), it only runs on Unix domain sockets (in contrast to Twisted's manhole which can run on telnet or ssh) and it integrates well with various types of applications. - + This is just like Twisted's manhole. It's simpler (no dependencies), it only runs on Unix domain sockets (in contrast to Twisted's manhole which can run on telnet or ssh) and it integrates well with various types of applications. + ionelmc/python-manhole manhole