forked from pool/python312
- Add bsc1243155-sphinx-non-determinism.patch (bsc#1243155) to
generate ids for audit_events using docname (reproducible builds). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python312?expand=0&rev=152
This commit is contained in:
45
bsc1243155-sphinx-non-determinism.patch
Normal file
45
bsc1243155-sphinx-non-determinism.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 906a590df191f66f4f0c4a70e3edb6fd82c156ef Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
|
||||
Date: Tue, 1 Jul 2025 12:13:28 +0200
|
||||
Subject: [PATCH] Doc: Generate ids for audit_events using docname
|
||||
|
||||
This patch generates ids for audit_events using the docname so the id is
|
||||
not global but depend on the source file. This make the doc build
|
||||
reproducible with multiple cores because it doesn't which file is parsed
|
||||
first, the id for audit_events will always be consistent independently
|
||||
of what file is parsed first.
|
||||
|
||||
https://github.com/python/cpython/issues/130979
|
||||
---
|
||||
Doc/tools/extensions/audit_events.py | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: Python-3.12.11/Doc/tools/extensions/audit_events.py
|
||||
===================================================================
|
||||
--- Python-3.12.11.orig/Doc/tools/extensions/audit_events.py 2025-07-02 16:10:55.447792590 +0200
|
||||
+++ Python-3.12.11/Doc/tools/extensions/audit_events.py 2025-07-02 16:12:00.124596479 +0200
|
||||
@@ -64,8 +64,13 @@
|
||||
logger.warning(msg)
|
||||
return
|
||||
|
||||
- def id_for(self, name) -> str:
|
||||
- source_count = len(self.sources.get(name, ()))
|
||||
+ def _source_count(self, name, docname) -> int:
|
||||
+ """Count the event name in the same source"""
|
||||
+ sources = self.sources.get(name, set())
|
||||
+ return len([s for s, t in sources if s == docname])
|
||||
+
|
||||
+ def id_for(self, name, docname) -> str:
|
||||
+ source_count = self._source_count(name, docname)
|
||||
name_clean = re.sub(r"\W", "_", name)
|
||||
return f"audit_event_{name_clean}_{source_count}"
|
||||
|
||||
@@ -140,7 +145,7 @@
|
||||
except (IndexError, TypeError):
|
||||
target = None
|
||||
if not target:
|
||||
- target = self.env.audit_events.id_for(name)
|
||||
+ target = self.env.audit_events.id_for(name, self.env.docname)
|
||||
ids.append(target)
|
||||
self.env.audit_events.add_event(name, args, (self.env.docname, target))
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 2 13:14:28 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Add bsc1243155-sphinx-non-determinism.patch (bsc#1243155) to
|
||||
generate ids for audit_events using docname (reproducible
|
||||
builds).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 1 08:19:52 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
|
||||
@@ -184,6 +184,9 @@ Patch41: docs-docutils_014-Sphinx_420.patch
|
||||
# PATCH-FIX-SLE doc-py38-to-py36.patch mcepl@suse.com
|
||||
# Make documentation extensions working with Python 3.6
|
||||
Patch44: doc-py38-to-py36.patch
|
||||
# PATCH-FIX-UPSTREAM bsc1243155-sphinx-non-determinism.patch bsc#1243155 mcepl@suse.com
|
||||
# Doc: Generate ids for audit_events using docname
|
||||
Patch45: bsc1243155-sphinx-non-determinism.patch
|
||||
BuildRequires: autoconf-archive
|
||||
BuildRequires: automake
|
||||
BuildRequires: fdupes
|
||||
|
||||
Reference in New Issue
Block a user