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

Closes: https://bugs.gentoo.org/928008
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny 2024-03-28 13:25:54 +01:00
parent 9d50af73c8
commit 95b7c715b1
No known key found for this signature in database
GPG Key ID: 639ADAE2329E240E
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,22 @@
From 82a6d09fa8db7a0667b365e9c06e99f8c0dfd245 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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

View File

@ -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