summaryrefslogtreecommitdiff
path: root/dev-python/pbr
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pbr')
-rw-r--r--dev-python/pbr/Manifest3
-rw-r--r--dev-python/pbr/files/pbr-6.1.1-test.patch84
-rw-r--r--dev-python/pbr/pbr-6.1.1.ebuild77
3 files changed, 164 insertions, 0 deletions
diff --git a/dev-python/pbr/Manifest b/dev-python/pbr/Manifest
index ca55f92a4abf..2c388482d884 100644
--- a/dev-python/pbr/Manifest
+++ b/dev-python/pbr/Manifest
@@ -1,3 +1,6 @@
+AUX pbr-6.1.1-test.patch 3379 BLAKE2B 1d704646e6fc7800af4e562d6636bb05ea524dd2bc526184cac9ffb3bffae1b49eae68b61257929821f3904566cc326cb73295cd2332970ced83e30bcb539830 SHA512 a4998b3c24cd9b3385beaebb3b5b08e27c31a3604ae125931c9f3e9dfb92b0e9547618a1c1a95b0b4ee6d8417b79e3879d1e17629495ec44d864feb314f2c46b
DIST pbr-6.1.0.tar.gz 124032 BLAKE2B 640c39d75329e4a1c28623439fd1466de3e491bb043abc1c62c68a9e19c6bc5523fca8ad18c4d6246fe2973af5ee6076c1e74e0967b9adb096ec31970fcf8491 SHA512 30478fa3146abdbc1da35ba950dcc3ead04e26060e0926a7a28390cc33cfae5acbb9a2385535bac43cb40830ef7cfa83be8bf963a6ee135a54d696c27b20a962
+DIST pbr-6.1.1.tar.gz 125702 BLAKE2B ee675c029f1ccf66ffb3b92fec67802f1a3d49735e08ec72658e7b3b528014109ec2a4ee0672b7c320d70a3b56b9a0a7929a7ae85915d941ce0e170e0cdc92a7 SHA512 db898469dad4d0ccfa90ee9a8faee83db0897e7451c30561d7e1f92163c82c81586853b8aaabcf80569d1cbdf5177da927ed79b0c393f6c5b2a910de0354a471
EBUILD pbr-6.1.0.ebuild 2042 BLAKE2B 9e5d2ac67775a02d1bd679b23b33b632831da15003cd325ca5f65b4926a3c38c5c034c35f916d64abca7070bba057057cafeb7ea005ba5f8621369fd7afb3915 SHA512 24e96b386330ff4ca581f6d68c82ece2353afd9dc28224aa8fa8523e0a297198a1d42f099369da71b4d2559bd69cbbb1f7cc97ba1f16ca1c5902b3e40c5bf6e5
+EBUILD pbr-6.1.1.ebuild 2192 BLAKE2B aa4ac2c330dd43b610ffbc8953b8dca37b3238a2f72c5c58cb5d4c76d1d76dcff7141b9e1af84a1092a4505a232adb8156df3ea2855173ffdd7c924a84f62320 SHA512 30ad1c726cd1ecb161b7f64f2a2b934075703af98f6bad656a41430b1f9663d0475b3d62183b90fc5fde7ecc2e629b0bd3dc00440cf74bacb22e697596adda35
MISC metadata.xml 815 BLAKE2B 439ee90d79572a8653f1ae3b8b5bf0883adb34ceac5257458dba7a2505e25ebba1c5080095139f6521d8fbd57c11ea38cf4049710b584069aea0ebaa7760077a SHA512 3d0618ef6656706acd829be80b2e6a0b0763b5f4128dcd360f28818d42cbc8825ecd04f7f47af5929a3a35fd60a3b9f9816cc37ee30af164c2e5b51764c25afe
diff --git a/dev-python/pbr/files/pbr-6.1.1-test.patch b/dev-python/pbr/files/pbr-6.1.1-test.patch
new file mode 100644
index 000000000000..5a3667af25f6
--- /dev/null
+++ b/dev-python/pbr/files/pbr-6.1.1-test.patch
@@ -0,0 +1,84 @@
+From 55015f69726f8916b9c50d70c856345929dc8cd7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 5 Feb 2025 12:36:08 +0100
+Subject: [PATCH 1/2] Use sysconfig for sitedir path in test_wsgi
+
+Use `sysconfig.get_path()` to obtain the correct site-packages directory
+path in `test_wsgi`, instead of attempting to guess it based on Python
+version. This fixes the test on PyPy3.10, and seems to be correct
+down to Python 2.7 (though tox does not seem to let me test on Python 2
+anymore).
+
+Partial-Bug: 2097427
+Change-Id: I5c152a98fd371dfb195643f0f5640cf1ffe0ba31
+---
+ pbr/tests/test_wsgi.py | 14 ++------------
+ 1 file changed, 2 insertions(+), 12 deletions(-)
+
+diff --git a/pbr/tests/test_wsgi.py b/pbr/tests/test_wsgi.py
+index a42fe78..fd11ab4 100644
+--- a/pbr/tests/test_wsgi.py
++++ b/pbr/tests/test_wsgi.py
+@@ -16,6 +16,7 @@ import os
+ import re
+ import subprocess
+ import sys
++import sysconfig
+ try:
+ # python 2
+ from urllib2 import urlopen
+@@ -31,18 +32,7 @@ class TestWsgiScripts(base.BaseTestCase):
+ cmd_names = ('pbr_test_wsgi', 'pbr_test_wsgi_with_class')
+
+ def _get_path(self):
+- if os.path.isdir("%s/lib64" % self.temp_dir):
+- path = "%s/lib64" % self.temp_dir
+- elif os.path.isdir("%s/lib" % self.temp_dir):
+- path = "%s/lib" % self.temp_dir
+- elif os.path.isdir("%s/site-packages" % self.temp_dir):
+- return ".:%s/site-packages" % self.temp_dir
+- else:
+- raise Exception("Could not determine path for test")
+- return ".:%s/python%s.%s/site-packages" % (
+- path,
+- sys.version_info[0],
+- sys.version_info[1])
++ return sysconfig.get_path("purelib", vars={"base": self.temp_dir})
+
+ def test_wsgi_script_install(self):
+ """Test that we install a non-pkg-resources wsgi script."""
+From 4bcc6bcb46644492ec07094411d58817cfe08d7c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 5 Feb 2025 11:26:55 +0100
+Subject: [PATCH 2/2] Modernize tests to use EXT_SUFFIX, fix PyPy
+
+Modernize `test_generates_c_extensions` to use
+`sysconfig.get_config_var("EXT_SUFFIX")` whenever available,
+to obtain the correct extension file suffix, instead of attempting
+to recontruct it from `SOABI`. This fixes test failures on modern
+PyPy3.10 versions, and should also be more future-proof for other Python
+implementations.
+
+Partial-Bug: 2097427
+Change-Id: I5fbeb0ae1193ed68be0beab2857860a525731688
+---
+ pbr/tests/test_packaging.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py
+index 0ababba..f6e2b31 100644
+--- a/pbr/tests/test_packaging.py
++++ b/pbr/tests/test_packaging.py
+@@ -413,9 +413,9 @@ class TestPackagingWheels(base.BaseTestCase):
+ built_package_dir = os.path.join(
+ self.extracted_wheel_dir, 'pbr_testpackage')
+ static_object_filename = 'testext.so'
+- soabi = get_soabi()
+- if soabi:
+- static_object_filename = 'testext.{0}.so'.format(soabi)
++ ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
++ if ext_suffix is not None:
++ static_object_filename = 'testext' + ext_suffix
+ static_object_path = os.path.join(
+ built_package_dir, static_object_filename)
+
diff --git a/dev-python/pbr/pbr-6.1.1.ebuild b/dev-python/pbr/pbr-6.1.1.ebuild
new file mode 100644
index 000000000000..00ac9a27ad7c
--- /dev/null
+++ b/dev-python/pbr/pbr-6.1.1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=standalone
+PYTHON_TESTED=( pypy3 python3_{10..13} )
+PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Inject some useful and sensible default behaviors into setuptools"
+HOMEPAGE="
+ https://opendev.org/openstack/pbr/
+ https://github.com/openstack/pbr/
+ https://pypi.org/project/pbr/
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ >=dev-python/setuptools-64.0.0[${PYTHON_USEDEP}]
+"
+
+# git is needed for tests, see https://bugs.launchpad.net/pbr/+bug/1326682 and
+# https://bugs.gentoo.org/show_bug.cgi?id=561038 docutils is needed for sphinx
+# exceptions... https://bugs.gentoo.org/show_bug.cgi?id=603848 stestr is run as
+# external tool.
+BDEPEND="
+ ${RDEPEND}
+ test? (
+ $(python_gen_cond_dep '
+ >=dev-python/wheel-0.32.0[${PYTHON_USEDEP}]
+ >=dev-python/fixtures-3.0.0[${PYTHON_USEDEP}]
+ >=dev-python/testresources-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/testscenarios-0.4[${PYTHON_USEDEP}]
+ >=dev-python/testtools-2.2.0[${PYTHON_USEDEP}]
+ >=dev-python/virtualenv-20.0.3[${PYTHON_USEDEP}]
+ dev-vcs/git
+ ' "${PYTHON_TESTED[@]}")
+ )
+"
+
+distutils_enable_tests unittest
+
+python_prepare_all() {
+ local PATCHES=(
+ # https://review.opendev.org/c/openstack/pbr/+/940773
+ # https://review.opendev.org/c/openstack/pbr/+/940778
+ "${FILESDIR}/${P}-test.patch"
+ )
+
+ # TODO: investigate
+ sed -e 's:test_console_script_develop:_&:' \
+ -e 's:test_console_script_install:_&:' \
+ -e 's:test_setup_py_keywords:_&:' \
+ -i pbr/tests/test_core.py || die
+ # installs random packages via pip from the Internet
+ sed -e 's:test_requirement_parsing:_&:' \
+ -e 's:test_pep_517_support:_&:' \
+ -i pbr/tests/test_packaging.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
+ einfo "Testing on ${EPYTHON} is not supported at the moment"
+ return
+ fi
+
+ cd "${BUILD_DIR}/install$(python_get_sitedir)" || die
+ eunittest -b
+}