summaryrefslogtreecommitdiff
path: root/dev-python/humanfriendly
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-07-01 08:00:51 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-07-01 08:00:51 +0100
commitd1c14e94a73fba924761cdad7298f3e48c6bc160 (patch)
tree60b97f0d81b3b06b06acc48ff8856d7c4afa2989 /dev-python/humanfriendly
parentd5ee59790ee8298b8599b0aa0fa21a98b972a44d (diff)
gentoo auto-resync : 01:07:2024 - 08:00:50
Diffstat (limited to 'dev-python/humanfriendly')
-rw-r--r--dev-python/humanfriendly/Manifest4
-rw-r--r--dev-python/humanfriendly/files/humanfriendly-10.0-py3.13.patch74
-rw-r--r--dev-python/humanfriendly/humanfriendly-10.0-r1.ebuild2
-rw-r--r--dev-python/humanfriendly/humanfriendly-10.0-r2.ebuild38
4 files changed, 116 insertions, 2 deletions
diff --git a/dev-python/humanfriendly/Manifest b/dev-python/humanfriendly/Manifest
index 314dabb07886..6face326e82f 100644
--- a/dev-python/humanfriendly/Manifest
+++ b/dev-python/humanfriendly/Manifest
@@ -1,3 +1,5 @@
+AUX humanfriendly-10.0-py3.13.patch 2541 BLAKE2B 9b89c9081e26ce992d96ebe495cedb5616acabda13a0bfa15aef13cfdb736391f5ac6f2b1e438511e960af661acc8588b66826c9a85c701e03ae8f96755e5796 SHA512 d21479cbd6cc8a47a334cebaec34f267067a5c046e3c93b2c91ed02a3de4a5d64f4425b754a5b87412e68ad3e1db702254932003950471b9e7aa170e8805d9ba
DIST humanfriendly-10.0.tar.gz 360702 BLAKE2B 6db7f2f11bafcdc087c078eae6123046610594b17899678e445baa18c25b2210cc1d84363d858ab7c57fce6d6b7a189be69dea08c1891d3f5b11ff9900c9bef9 SHA512 496700bcea1dabf003c938558bf807fabb41b71192f69622979dd9e243dda9b4b06c5ac8f65cef217df85ebadf99099dc22b50d63216791a569be11081d267d6
-EBUILD humanfriendly-10.0-r1.ebuild 946 BLAKE2B ded8ecb0704e1495115974e7d0216f0ef7e70643c2ebe9f315d928ce0de5e993772d6102b014c23ca0f7abc6875ef7b398b9155261f7ff31b932d6465a8093f7 SHA512 6a2a1faf9884993d9cdf238418bc6a00e0105aa0b2fc781e8041fb0df72cedc9f7ec0ad561025a5395abb40e5e4ff005ad472f22fbb061d925e24c89bf6932ea
+EBUILD humanfriendly-10.0-r1.ebuild 946 BLAKE2B 1837abbc388385f7984207ec8c5acbf0fc3a3c5225a0fa79d7295c6c421a9d193044908e652930cdafadd7e60e2790d20958c77b777d46ec305096457813baaf SHA512 4969b187a288ab1d7c53a174f23f6d41aea4bee4acbf89350fc58fb277f0e909a4a2aa514a78bdcbe1d79a5cb78f65a5e20e94e4461723798a31e5d0a22e463d
+EBUILD humanfriendly-10.0-r2.ebuild 880 BLAKE2B cd4eb9a13328f4c04fc2f1937c334d7e3e149f337f5ed47734bb130bea9b8c8700a372531b6bd299485106ce9851c77db37499b1280ba712f3e7d9c6dac63c14 SHA512 15bf0bbbe8ebe022bd8512759296c10b4857a22397b771723f6c2a36c115d19c8597652886f973efeb83557acefdabc56b975ade4fbd86683616aad81e4f3eed
MISC metadata.xml 407 BLAKE2B 7d2146a2514b6d9afb68e6ba104acff4a38c650f678e930242659a96028d734dba0c69deaf3cca06225a2b9324f9e4639ec5e6324a2b845468bc5e180f2ba061 SHA512 57e8f1b2de1594bd97fca291b778b92ed09a26b61f97ca7988fda2b1efff181394bbd7ae20a0a94066c7cf58da553ef4881cff2b79207577c710780b9800baaf
diff --git a/dev-python/humanfriendly/files/humanfriendly-10.0-py3.13.patch b/dev-python/humanfriendly/files/humanfriendly-10.0-py3.13.patch
new file mode 100644
index 000000000000..467d3862d331
--- /dev/null
+++ b/dev-python/humanfriendly/files/humanfriendly-10.0-py3.13.patch
@@ -0,0 +1,74 @@
+From 13d05b8057010121acd2a402a337ef4ee5834062 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 30 May 2024 23:05:14 -0400
+Subject: [PATCH] Replace pipes.quote with shlex.quote on Python 3
+
+The shlex.quote() API is available from Python 3.3 on; pipes.quote() was
+never documented, and is removed in Python 3.13.
+
+Fixes #73.
+
+Upstream-PR: https://github.com/xolox/python-humanfriendly/pull/75
+Upstream-Issue: https://github.com/xolox/python-humanfriendly/issues/73
+
+diff --git a/humanfriendly/cli.py b/humanfriendly/cli.py
+index eb81db1..5dfc14a 100644
+--- a/humanfriendly/cli.py
++++ b/humanfriendly/cli.py
+@@ -79,10 +79,14 @@
+ # Standard library modules.
+ import functools
+ import getopt
+-import pipes
+ import subprocess
+ import sys
+
++try:
++ from shlex import quote # Python 3
++except ImportError:
++ from pipes import quote # Python 2 (removed in 3.13)
++
+ # Modules included in our package.
+ from humanfriendly import (
+ Timer,
+@@ -176,7 +180,7 @@ def main():
+ def run_command(command_line):
+ """Run an external command and show a spinner while the command is running."""
+ timer = Timer()
+- spinner_label = "Waiting for command: %s" % " ".join(map(pipes.quote, command_line))
++ spinner_label = "Waiting for command: %s" % " ".join(map(quote, command_line))
+ with Spinner(label=spinner_label, timer=timer) as spinner:
+ process = subprocess.Popen(command_line)
+ while True:
+diff --git a/humanfriendly/testing.py b/humanfriendly/testing.py
+index f6abddf..f9d66e4 100644
+--- a/humanfriendly/testing.py
++++ b/humanfriendly/testing.py
+@@ -25,13 +25,17 @@
+ import functools
+ import logging
+ import os
+-import pipes
+ import shutil
+ import sys
+ import tempfile
+ import time
+ import unittest
+
++try:
++ from shlex import quote # Python 3
++except ImportError:
++ from pipes import quote # Python 2 (removed in 3.13)
++
+ # Modules included in our package.
+ from humanfriendly.compat import StringIO
+ from humanfriendly.text import random_string
+@@ -521,7 +525,7 @@ def __enter__(self):
+ pathname = os.path.join(directory, self.program_name)
+ with open(pathname, 'w') as handle:
+ handle.write('#!/bin/sh\n')
+- handle.write('echo > %s\n' % pipes.quote(self.program_signal_file))
++ handle.write('echo > %s\n' % quote(self.program_signal_file))
+ if self.program_script:
+ handle.write('%s\n' % self.program_script.strip())
+ handle.write('exit %i\n' % self.program_returncode)
diff --git a/dev-python/humanfriendly/humanfriendly-10.0-r1.ebuild b/dev-python/humanfriendly/humanfriendly-10.0-r1.ebuild
index b0c40d48af3b..06e3fae0e80f 100644
--- a/dev-python/humanfriendly/humanfriendly-10.0-r1.ebuild
+++ b/dev-python/humanfriendly/humanfriendly-10.0-r1.ebuild
@@ -13,8 +13,8 @@ HOMEPAGE="https://pypi.org/project/humanfriendly/
https://github.com/xolox/python-humanfriendly/
https://humanfriendly.readthedocs.io/"
-SLOT="0"
LICENSE="MIT"
+SLOT="0"
KEYWORDS="amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
# This is completely broken
diff --git a/dev-python/humanfriendly/humanfriendly-10.0-r2.ebuild b/dev-python/humanfriendly/humanfriendly-10.0-r2.ebuild
new file mode 100644
index 000000000000..98cb6f5b17f1
--- /dev/null
+++ b/dev-python/humanfriendly/humanfriendly-10.0-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
+PYTHON_REQ_USE="threads(+)"
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1 pypi
+
+DESCRIPTION="Human friendly output for text interfaces using Python"
+HOMEPAGE="https://pypi.org/project/humanfriendly/
+ https://github.com/xolox/python-humanfriendly/
+ https://humanfriendly.readthedocs.io/"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+
+BDEPEND="
+ test? (
+ dev-python/capturer[${PYTHON_USEDEP}]
+ >=dev-python/coloredlogs-15.0.1[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-10.0-py3.13.patch"
+)
+
+distutils_enable_tests pytest
+distutils_enable_sphinx docs
+
+python_test() {
+ epytest humanfriendly/tests.py
+}