File: reproducible-tracebacks.patch

package info (click to toggle)
sphinx-gallery 0.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,336 kB
  • sloc: python: 10,346; makefile: 216; lisp: 15; sh: 11; cpp: 9
file content (23 lines) | stat: -rw-r--r-- 812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Dmitry Shachnev <mitya57@debian.org>
Date: Mon, 17 Jun 2024 10:48:51 +0300
Subject: Remove build path from generated reStructuredText files with
 tracebacks

Forwarded: not-needed
---
 sphinx_gallery/gen_rst.py | 3 +++
 1 file changed, 3 insertions(+)

--- sphinx-gallery.orig/sphinx_gallery/gen_rst.py
+++ sphinx-gallery/sphinx_gallery/gen_rst.py
@@ -721,6 +721,10 @@
         traceback.format_list(stack) + traceback.format_exception_only(etype, exc)
     )
 
+    if "SOURCE_DATE_EPOCH" in os.environ:
+        parent = os.path.dirname(os.path.dirname(__file__)) + os.sep
+        formatted_exception = formatted_exception.replace(parent, "")
+
     expected = src_file in _expected_failing_examples(gallery_conf)
     src_file_rel = os.path.relpath(src_file, gallery_conf["src_dir"])
     if expected: