commit:     95b7c715b18099de0d637d082b841b8eea4866b4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 12:25:54 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Mar 28 12:26:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95b7c715

dev-python/requests-mock: Remove last use of pbr

Closes: https://bugs.gentoo.org/928008
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/requests-mock-1.12.0-no-pbr.patch        | 22 ++++++++++++++++++++++
 .../requests-mock/requests-mock-1.12.0.ebuild      |  5 +++++
 2 files changed, 27 insertions(+)

diff --git a/dev-python/requests-mock/files/requests-mock-1.12.0-no-pbr.patch 
b/dev-python/requests-mock/files/requests-mock-1.12.0-no-pbr.patch
new file mode 100644
index 000000000000..fcfc8f9d2eb4
--- /dev/null
+++ b/dev-python/requests-mock/files/requests-mock-1.12.0-no-pbr.patch
@@ -0,0 +1,22 @@
+From 82a6d09fa8db7a0667b365e9c06e99f8c0dfd245 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Thu, 28 Mar 2024 12:54:18 +0100
+Subject: [PATCH] Replace the last use of pbr with modern packaging
+
+diff --git a/doc/source/conf.py b/doc/source/conf.py
+index 395acaa..e0895f5 100755
+--- a/doc/source/conf.py
++++ b/doc/source/conf.py
+@@ -16 +16,2 @@ import sys, os
+-import pbr.version
++import importlib.metadata
++import packaging
+@@ -56 +57 @@ copyright = u'2023, Jamie Lennox'
+-version_info = pbr.version.VersionInfo(project)
++version_info = packaging.version.parse(importlib.metadata.version(project))
+@@ -59 +60 @@ version_info = pbr.version.VersionInfo(project)
+-version = version_info.version_string()
++version = version_info.base_version
+@@ -61 +62 @@ version = version_info.version_string()
+-release = version_info.release_string()
++release = version_info.public

diff --git a/dev-python/requests-mock/requests-mock-1.12.0.ebuild 
b/dev-python/requests-mock/requests-mock-1.12.0.ebuild
index a0e17f881c2f..ff7866ac1da6 100644
--- a/dev-python/requests-mock/requests-mock-1.12.0.ebuild
+++ b/dev-python/requests-mock/requests-mock-1.12.0.ebuild
@@ -36,6 +36,11 @@ distutils_enable_sphinx doc/source
 distutils_enable_tests pytest
 
 python_prepare_all() {
+       local PATCHES=(
+               # https://github.com/jamielennox/requests-mock/pull/255
+               "${FILESDIR}/${P}-no-pbr.patch"
+       )
+
        # Disable reno which only works inside a git repository
        sed -i "s/'reno.sphinxext',//" doc/source/conf.py || die
        # Remove the release notes section which requires reno

Reply via email to