summaryrefslogtreecommitdiff
path: root/dev-python/humanfriendly
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-06-30 20:34:53 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-06-30 20:34:53 +0000
commit18f52fea684ac9ef56acdc2063c179401eaf7a40 (patch)
treec627f50dfe66fbf3453b2bf4dd36f624e31fdb47 /dev-python/humanfriendly
parent0958420ce00af4f18ffa7eede862d5deddbd2122 (diff)
downloadbaldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.tar.gz
baldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.tar.xz
baldeagleos-repo-18f52fea684ac9ef56acdc2063c179401eaf7a40.zip
Adding metadata
Diffstat (limited to 'dev-python/humanfriendly')
-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
3 files changed, 113 insertions, 1 deletions
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 755c7fad81fa..78769e47fa81 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..077fe72c41bc
--- /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=( python3_{8,9,10,11,12} pypy3 )
+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
+}