Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-stack-data for
openSUSE:Factory checked in at 2022-05-17 17:23:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-stack-data (Old)
and /work/SRC/openSUSE:Factory/.python-stack-data.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-stack-data"
Tue May 17 17:23:54 2022 rev:2 rq:977523 version:0.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-stack-data/python-stack-data.changes
2022-01-15 20:05:21.657766548 +0100
+++
/work/SRC/openSUSE:Factory/.python-stack-data.new.1538/python-stack-data.changes
2022-05-17 17:24:08.567155178 +0200
@@ -1,0 +2,10 @@
+Mon May 16 12:18:16 UTC 2022 - Matej Cepl <[email protected]>
+
+- Update to 0.2.0:
+ - Fallback to basic Source.pieces when there is no Source.tree.
+ - Handle nodes inside f-strings missing location info from
+ asttokens
+- Add 29-Pygments-2-12.patch (gh#alexmojaki/stack_data#29) making
+ the package compabile with Pygments 2.12.
+
+-------------------------------------------------------------------
Old:
----
stack_data-0.1.3.tar.gz
New:
----
29-Pygments-2-12.patch
stack_data-0.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-stack-data.spec ++++++
--- /var/tmp/diff_new_pack.fz6LP8/_old 2022-05-17 17:24:09.167155722 +0200
+++ /var/tmp/diff_new_pack.fz6LP8/_new 2022-05-17 17:24:09.171155725 +0200
@@ -18,12 +18,16 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-stack-data
-Version: 0.1.3
+Version: 0.2.0
Release: 0
Summary: Extract data from python stack frames and tracebacks
License: MIT
URL: https://github.com/alexmojaki/stack_data
Source:
https://files.pythonhosted.org/packages/source/s/stack_data/stack_data-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM 29-Pygments-2-12.patch gh#alexmojaki/stack_data#29
[email protected]
+# Make the package compatible with Pygments 2.12.
+Patch0: 29-Pygments-2-12.patch
+BuildRequires: %{python_module Cython}
BuildRequires: %{python_module setuptools >= 44}
BuildRequires: %{python_module setuptools_scm >= 3.4.3}
BuildRequires: fdupes
++++++ 29-Pygments-2-12.patch ++++++
>From 38ad6d56d587e4411a2ee77d8118fa668f8edcfb Mon Sep 17 00:00:00 2001
From: Lumir Balhar <[email protected]>
Date: Thu, 5 May 2022 11:58:18 +0200
Subject: [PATCH 1/2] Make test_executing_style_defs parametrized and expect
different colors
---
tests/test_core.py | 70 +++++++++++++++++++++++++++--------------------------
1 file changed, 36 insertions(+), 34 deletions(-)
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -18,6 +18,7 @@ from stack_data import Source, FrameInfo
from stack_data.utils import line_range
samples_dir = Path(__file__).parent / "samples"
+pygments_version = tuple(map(int, pygments.__version__.split(".")[:2]))
def test_lines_with_gaps():
@@ -552,20 +553,20 @@ def test_absolute_filename():
assert frame_info.filename == full_filename
-def test_executing_style_defs():
[email protected]("expected",
+ [
+ r".c { color: #(999999|ababab); font-style: italic }",
+ r".err { color: #a61717; background-color: #e3d2d2 }",
+ r".c-ExecutingNode { color: #(999999|ababab); font-style: italic;
background-color: #ffff00 }",
+ r".err-ExecutingNode { color: #a61717; background-color: #ffff00 }",
+ ]
+)
+def test_executing_style_defs(expected):
style = style_with_executing_node("native", "bg:#ffff00")
formatter = HtmlFormatter(style=style)
style_defs = formatter.get_style_defs()
- expected = """
- .c { color: #999999; font-style: italic }
- .err { color: #a61717; background-color: #e3d2d2 }
- .c-ExecutingNode { color: #999999; font-style: italic; background-color:
#ffff00 }
- .err-ExecutingNode { color: #a61717; background-color: #ffff00 }
- """.strip().splitlines()
-
- for line in expected:
- assert line.strip() in style_defs
+ assert re.search(expected, style_defs)
def test_example():
@@ -613,6 +614,7 @@ x = 1
"""
[email protected](pygments_version < (2, 12), reason="Different output in
older Pygments")
def test_pygments_example():
from .samples.pygments_example import bar
result = bar()
@@ -620,14 +622,14 @@ def test_pygments_example():
assert result == """\
Terminal256Formatter native:
- 13 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;68mbar\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
- 14 | \x1b[38;5;252m \x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m \x1b[39m\x1b[38;5;67m1\x1b[39m
- 15 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;31mstr\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m)\x1b[39m
+ 13 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;75mbar\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
+ 14 | \x1b[38;5;252m \x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m \x1b[39m\x1b[38;5;75m1\x1b[39m
+ 15 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;38mstr\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m)\x1b[39m
17 | \x1b[38;5;252m \x1b[39m\x1b[38;5;214m@deco\x1b[39m
- 18 | \x1b[38;5;252m \x1b[39m\x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;68mfoo\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
+ 18 | \x1b[38;5;252m \x1b[39m\x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;75mfoo\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
19 | \x1b[38;5;252m \x1b[39m\x1b[38;5;70;01mpass\x1b[39;00m
-----
- 25 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;68mdeco\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
+ 25 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;75mdeco\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
26 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m.\x1b[39m\x1b[38;5;252mresult\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252mprint_stack\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m
27 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;70;01mreturn\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252mf\x1b[39m
-----
@@ -636,14 +638,14 @@ Terminal256Formatter native:
Terminal256Formatter <class
\'stack_data.core.style_with_executing_node.<locals>.NewStyle\'>:
- 13 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;68mbar\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
- 14 | \x1b[38;5;252m \x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m \x1b[39m\x1b[38;5;67m1\x1b[39m
- 15 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;31mstr\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m)\x1b[39m
+ 13 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;75mbar\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
+ 14 | \x1b[38;5;252m \x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m \x1b[39m\x1b[38;5;75m1\x1b[39m
+ 15 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;38mstr\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mx\x1b[39m\x1b[38;5;252m)\x1b[39m
17 | \x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;214;48;5;58m@deco\x1b[39;49m
- 18 | \x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;70;48;5;58;01mdef\x1b[39;49;00m\x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;68;48;5;58mfoo\x1b[39;49m\x1b[38;5;252;48;5;58m(\x1b[39;49m\x1b[38;5;252;48;5;58m)\x1b[39;49m\x1b[38;5;252;48;5;58m:\x1b[39;49m
+ 18 | \x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;70;48;5;58;01mdef\x1b[39;49;00m\x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;75;48;5;58mfoo\x1b[39;49m\x1b[38;5;252;48;5;58m(\x1b[39;49m\x1b[38;5;252;48;5;58m)\x1b[39;49m\x1b[38;5;252;48;5;58m:\x1b[39;49m
19 | \x1b[38;5;252;48;5;58m
\x1b[39;49m\x1b[38;5;70;48;5;58;01mpass\x1b[39;49;00m
-----
- 25 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;68mdeco\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
+ 25 | \x1b[38;5;70;01mdef\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;75mdeco\x1b[39m\x1b[38;5;252m(\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m)\x1b[39m\x1b[38;5;252m:\x1b[39m
26 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;252mf\x1b[39m\x1b[38;5;252m.\x1b[39m\x1b[38;5;252mresult\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252m=\x1b[39m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252;48;5;58mprint_stack\x1b[39;49m\x1b[38;5;252;48;5;58m(\x1b[39;49m\x1b[38;5;252;48;5;58m)\x1b[39;49m
27 | \x1b[38;5;252m
\x1b[39m\x1b[38;5;70;01mreturn\x1b[39;00m\x1b[38;5;252m
\x1b[39m\x1b[38;5;252mf\x1b[39m
-----
@@ -684,32 +686,32 @@ TerminalFormatter <class \'stack_data.co
TerminalTrueColorFormatter native:
- 13 | \x1b[38;2;106;184;37;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;68;127;207mbar\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
- 14 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;54;119;169m1\x1b[39m
- 15 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;36;144;157mstr\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m
+ 13 | \x1b[38;2;110;191;38;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;113;173;255mbar\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
+ 14 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;81;178;253m1\x1b[39m
+ 15 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;47;188;205mstr\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m
17 | \x1b[38;2;208;208;208m \x1b[39m\x1b[38;2;255;165;0m@deco\x1b[39m
- 18 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;106;184;37;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;68;127;207mfoo\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
- 19 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;106;184;37;01mpass\x1b[39;00m
+ 18 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;110;191;38;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;113;173;255mfoo\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
+ 19 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;110;191;38;01mpass\x1b[39;00m
-----
- 25 | \x1b[38;2;106;184;37;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;68;127;207mdeco\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
+ 25 | \x1b[38;2;110;191;38;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;113;173;255mdeco\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
26 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m.\x1b[39m\x1b[38;2;208;208;208mresult\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mprint_stack\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m
- 27 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;106;184;37;01mreturn\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m
+ 27 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;110;191;38;01mreturn\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m
-----
====================
TerminalTrueColorFormatter <class
\'stack_data.core.style_with_executing_node.<locals>.NewStyle\'>:
- 13 | \x1b[38;2;106;184;37;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;68;127;207mbar\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
- 14 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;54;119;169m1\x1b[39m
- 15 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;36;144;157mstr\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m
+ 13 | \x1b[38;2;110;191;38;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;113;173;255mbar\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
+ 14 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;81;178;253m1\x1b[39m
+ 15 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;47;188;205mstr\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mx\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m
17 | \x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;255;165;0;48;2;68;68;0m@deco\x1b[39;49m
- 18 | \x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;106;184;37;48;2;68;68;0;01mdef\x1b[39;49;00m\x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;68;127;207;48;2;68;68;0mfoo\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m(\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m)\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m:\x1b[39;49m
- 19 | \x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;106;184;37;48;2;68;68;0;01mpass\x1b[39;49;00m
+ 18 | \x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;110;191;38;48;2;68;68;0;01mdef\x1b[39;49;00m\x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;113;173;255;48;2;68;68;0mfoo\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m(\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m)\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m:\x1b[39;49m
+ 19 | \x1b[38;2;208;208;208;48;2;68;68;0m
\x1b[39;49m\x1b[38;2;110;191;38;48;2;68;68;0;01mpass\x1b[39;49;00m
-----
- 25 | \x1b[38;2;106;184;37;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;68;127;207mdeco\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
+ 25 | \x1b[38;2;110;191;38;01mdef\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;113;173;255mdeco\x1b[39m\x1b[38;2;208;208;208m(\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m)\x1b[39m\x1b[38;2;208;208;208m:\x1b[39m
26 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m\x1b[38;2;208;208;208m.\x1b[39m\x1b[38;2;208;208;208mresult\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208m=\x1b[39m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208;48;2;68;68;0mprint_stack\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m(\x1b[39;49m\x1b[38;2;208;208;208;48;2;68;68;0m)\x1b[39;49m
- 27 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;106;184;37;01mreturn\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m
+ 27 | \x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;110;191;38;01mreturn\x1b[39;00m\x1b[38;2;208;208;208m
\x1b[39m\x1b[38;2;208;208;208mf\x1b[39m
-----
====================
++++++ stack_data-0.1.3.tar.gz -> stack_data-0.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/.github/workflows/pytest.yml
new/stack_data-0.2.0/.github/workflows/pytest.yml
--- old/stack_data-0.1.3/.github/workflows/pytest.yml 2021-11-12
23:11:00.000000000 +0100
+++ new/stack_data-0.2.0/.github/workflows/pytest.yml 2022-01-15
11:36:16.000000000 +0100
@@ -5,7 +5,7 @@
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10-dev]
+ python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/PKG-INFO
new/stack_data-0.2.0/PKG-INFO
--- old/stack_data-0.1.3/PKG-INFO 2021-11-12 23:13:49.405105000 +0100
+++ new/stack_data-0.2.0/PKG-INFO 2022-02-14 19:52:06.848233500 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: stack_data
-Version: 0.1.3
+Version: 0.2.0
Summary: Extract data from python stack frames and tracebacks for informative
displays
Home-page: http://github.com/alexmojaki/stack_data
Author: Alex Hall
@@ -23,7 +23,7 @@
# stack_data
-[](https://travis-ci.org/alexmojaki/stack_data)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
+[](https://github.com/alexmojaki/stack_data/actions/workflows/pytest.yml)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
This is a library that extracts data from stack frames and tracebacks,
particularly to display more useful tracebacks than the default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/README.md
new/stack_data-0.2.0/README.md
--- old/stack_data-0.1.3/README.md 2020-02-13 17:17:36.000000000 +0100
+++ new/stack_data-0.2.0/README.md 2021-11-12 23:17:02.000000000 +0100
@@ -1,6 +1,6 @@
# stack_data
-[](https://travis-ci.org/alexmojaki/stack_data)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
+[](https://github.com/alexmojaki/stack_data/actions/workflows/pytest.yml)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
This is a library that extracts data from stack frames and tracebacks,
particularly to display more useful tracebacks than the default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/setup.cfg
new/stack_data-0.2.0/setup.cfg
--- old/stack_data-0.1.3/setup.cfg 2021-11-12 23:13:49.405105000 +0100
+++ new/stack_data-0.2.0/setup.cfg 2022-02-14 19:52:06.848233500 +0100
@@ -27,7 +27,7 @@
tests_require = pytest; typeguard; pygments; littleutils
[options.extras_require]
-tests = pytest; typeguard; pygments; littleutils
+tests = pytest; typeguard; pygments; littleutils; cython
[coverage:run]
relative_files = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data/core.py
new/stack_data-0.2.0/stack_data/core.py
--- old/stack_data-0.1.3/stack_data/core.py 2021-11-12 23:11:00.000000000
+0100
+++ new/stack_data-0.2.0/stack_data/core.py 2022-02-14 19:51:33.000000000
+0100
@@ -83,7 +83,10 @@
@cached_property
def pieces(self) -> List[range]:
if not self.tree:
- raise AttributeError("This file doesn't contain valid Python, so
.pieces doesn't exist")
+ return [
+ range(i, i + 1)
+ for i in range(1, len(self.lines) + 1)
+ ]
return list(self._clean_pieces())
@cached_property
@@ -290,15 +293,22 @@
A list of one or zero RangeInLines for the executing node of this
frame.
The list will have one element if the node can be found and it
overlaps this line.
"""
+ return self._raw_executing_node_ranges(
+ self.frame_info._executing_node_common_indent
+ )
+
+ def _raw_executing_node_ranges(self, common_indent=0) -> List[RangeInLine]:
ex = self.frame_info.executing
node = ex.node
if node:
- rang = self.range_from_node(node, ex)
+ rang = self.range_from_node(node, ex, common_indent)
if rang:
return [rang]
return []
- def range_from_node(self, node: ast.AST, data: Any) ->
Optional[RangeInLine]:
+ def range_from_node(
+ self, node: ast.AST, data: Any, common_indent: int = 0
+ ) -> Optional[RangeInLine]:
"""
If the given node overlaps with this line, return a RangeInLine
with the correct start and end and the given data.
@@ -309,12 +319,23 @@
if not (start <= self.lineno <= end):
return None
if start == self.lineno:
- range_start = node.first_token.start[1]
+ try:
+ range_start = node.first_token.start[1]
+ except AttributeError:
+ range_start = node.col_offset
else:
range_start = 0
+ range_start = max(range_start, common_indent)
+
if end == self.lineno:
- range_end = node.last_token.end[1]
+ try:
+ range_end = node.last_token.end[1]
+ except AttributeError:
+ try:
+ range_end = node.end_col_offset
+ except AttributeError:
+ return None
else:
range_end = len(self.text)
@@ -334,7 +355,7 @@
If strip_leading_indent is true (the default) then leading spaces
common to all lines in this frame will be excluded.
"""
- if pygmented:
+ if pygmented and self.frame_info.scope:
assert_(not markers, ValueError("Cannot use pygmented with
markers"))
start_line, lines = self.frame_info._pygmented_scope_lines
result = lines[self.lineno - start_line]
@@ -551,10 +572,12 @@
@cached_property
def scope_pieces(self) -> List[range]:
"""
- All the pieces (ranges of lines) contained in this object's .scope.
+ All the pieces (ranges of lines) contained in this object's .scope,
+ unless there is no .scope (because the source isn't valid Python
syntax)
+ in which case it returns all the pieces in the source file, each
containing one line.
"""
if not self.scope:
- return []
+ return self.source.pieces
scope_start, scope_end = line_range(self.scope)
return [
@@ -601,9 +624,6 @@
"""
The piece (range of lines) containing the line currently being executed
by the interpreter in this frame.
-
- Raises an exception if .scope is None, which usually means the source
code
- for this frame is unavailable.
"""
return only(
piece
@@ -642,6 +662,25 @@
return pieces
@cached_property
+ def _executing_node_common_indent(self) -> int:
+ """
+ The common minimal indentation shared by the markers intended
+ for an exception node that spans multiple lines.
+
+ Intended to be used only internally.
+ """
+ indents = []
+ lines = [line for line in self.lines if isinstance(line, Line)]
+
+ for line in lines:
+ for rang in line._raw_executing_node_ranges():
+ begin_text = len(line.text) - len(line.text.lstrip())
+ indent = max(rang.start, begin_text)
+ indents.append(indent)
+
+ return min(indents) if indents else 0
+
+ @cached_property
def lines(self) -> List[Union[Line, LineGap]]:
"""
A list of lines to display, determined by options.
@@ -664,15 +703,13 @@
for i, piece in enumerate(pieces):
if (
i == 1
+ and self.scope
and pieces[0] == self.scope_pieces[0]
and pieces[1] != self.scope_pieces[1]
):
result.append(LINE_GAP)
- lines = [
- Line(self, i)
- for i in piece
- ] # type: List[Line]
+ lines = [Line(self, i) for i in piece] # type: List[Line]
if piece != self.executing_piece:
lines = truncate(
lines,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data/utils.py
new/stack_data-0.2.0/stack_data/utils.py
--- old/stack_data-0.1.3/stack_data/utils.py 2021-04-18 12:36:26.000000000
+0200
+++ new/stack_data-0.2.0/stack_data/utils.py 2022-01-15 11:36:16.000000000
+0100
@@ -27,15 +27,19 @@
def line_range(node: ast.AST) -> Tuple[int, int]:
"""
Returns a pair of numbers representing a half open range
- (i.e. suitable as arguments to the range builtin)
+ (i.e. suitable as arguments to the `range()` builtin)
of line numbers of the given AST nodes.
- This function relies on the first_token and last_token
- attributes set by asttokens.
"""
- return (
- node.first_token.start[0],
- node.last_token.end[0] + 1,
- )
+ try:
+ return (
+ node.first_token.start[0],
+ node.last_token.end[0] + 1,
+ )
+ except AttributeError:
+ return (
+ node.lineno,
+ getattr(node, "end_lineno", node.lineno) + 1,
+ )
def highlight_unique(lst: List[T]) -> Iterator[Tuple[T, bool]]:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data/version.py
new/stack_data-0.2.0/stack_data/version.py
--- old/stack_data-0.1.3/stack_data/version.py 2021-11-12 23:13:49.000000000
+0100
+++ new/stack_data-0.2.0/stack_data/version.py 2022-02-14 19:52:06.000000000
+0100
@@ -1 +1 @@
-__version__ = '0.1.3'
+__version__ = '0.2.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data.egg-info/PKG-INFO
new/stack_data-0.2.0/stack_data.egg-info/PKG-INFO
--- old/stack_data-0.1.3/stack_data.egg-info/PKG-INFO 2021-11-12
23:13:49.000000000 +0100
+++ new/stack_data-0.2.0/stack_data.egg-info/PKG-INFO 2022-02-14
19:52:06.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: stack-data
-Version: 0.1.3
+Version: 0.2.0
Summary: Extract data from python stack frames and tracebacks for informative
displays
Home-page: http://github.com/alexmojaki/stack_data
Author: Alex Hall
@@ -23,7 +23,7 @@
# stack_data
-[](https://travis-ci.org/alexmojaki/stack_data)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
+[](https://github.com/alexmojaki/stack_data/actions/workflows/pytest.yml)
[](https://coveralls.io/github/alexmojaki/stack_data?branch=master)
[](https://pypi.python.org/pypi/stack_data)
This is a library that extracts data from stack frames and tracebacks,
particularly to display more useful tracebacks than the default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data.egg-info/SOURCES.txt
new/stack_data-0.2.0/stack_data.egg-info/SOURCES.txt
--- old/stack_data-0.1.3/stack_data.egg-info/SOURCES.txt 2021-11-12
23:13:49.000000000 +0100
+++ new/stack_data-0.2.0/stack_data.egg-info/SOURCES.txt 2022-02-14
19:52:06.000000000 +0100
@@ -23,6 +23,9 @@
tests/test_formatter.py
tests/test_utils.py
tests/utils.py
+tests/golden_files/cython_example.txt
+tests/golden_files/f_string_new.txt
+tests/golden_files/f_string_old.txt
tests/golden_files/format_frame.txt
tests/golden_files/format_stack.txt
tests/golden_files/plain.txt
@@ -30,6 +33,7 @@
tests/golden_files/pygmented.txt
tests/golden_files/variables.txt
tests/samples/__init__.py
+tests/samples/cython_example.pyx
tests/samples/example.py
tests/samples/formatter_example.py
tests/samples/not_code.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/stack_data.egg-info/requires.txt
new/stack_data-0.2.0/stack_data.egg-info/requires.txt
--- old/stack_data-0.1.3/stack_data.egg-info/requires.txt 2021-11-12
23:13:49.000000000 +0100
+++ new/stack_data-0.2.0/stack_data.egg-info/requires.txt 2022-02-14
19:52:06.000000000 +0100
@@ -7,3 +7,4 @@
typeguard
pygments
littleutils
+cython
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/__init__.py
new/stack_data-0.2.0/tests/__init__.py
--- old/stack_data-0.1.3/tests/__init__.py 2020-02-13 17:17:36.000000000
+0100
+++ new/stack_data-0.2.0/tests/__init__.py 2022-02-14 19:51:33.000000000
+0100
@@ -1,5 +1,9 @@
import os
+
+import pyximport
from typeguard.importhook import install_import_hook
+pyximport.install()
+
if not os.environ.get("STACK_DATA_SLOW_TESTS"):
install_import_hook(["stack_data"])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/stack_data-0.1.3/tests/golden_files/cython_example.txt
new/stack_data-0.2.0/tests/golden_files/cython_example.txt
--- old/stack_data-0.1.3/tests/golden_files/cython_example.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/stack_data-0.2.0/tests/golden_files/cython_example.txt 2022-02-14
19:51:33.000000000 +0100
@@ -0,0 +1,11 @@
+Traceback (most recent call last):
+ File "cython_example.pyx", line 2, in tests.samples.cython_example.foo
+ 1 | def foo():
+--> 2 | bar()
+ 3 |
+ File "cython_example.pyx", line 5, in tests.samples.cython_example.bar
+ 2 | bar()
+ 3 |
+ 4 | cdef bar():
+--> 5 | raise ValueError("bar!")
+ValueError: bar!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/golden_files/f_string_new.txt
new/stack_data-0.2.0/tests/golden_files/f_string_new.txt
--- old/stack_data-0.1.3/tests/golden_files/f_string_new.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/stack_data-0.2.0/tests/golden_files/f_string_new.txt 2022-02-14
19:43:02.000000000 +0100
@@ -0,0 +1,13 @@
+Traceback (most recent call last):
+ File "formatter_example.py", line 57, in f_string
+ 54 | def f_string():
+ 55 | f"""{str
+ 56 | (
+--> 57 | 1 /
+ ^^^
+ 58 | 0 + 4
+ ^^^
+ 59 | + 5
+ 60 | )
+ 61 | }"""
+ZeroDivisionError: division by zero
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/golden_files/f_string_old.txt
new/stack_data-0.2.0/tests/golden_files/f_string_old.txt
--- old/stack_data-0.1.3/tests/golden_files/f_string_old.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/stack_data-0.2.0/tests/golden_files/f_string_old.txt 2022-01-15
11:36:16.000000000 +0100
@@ -0,0 +1,11 @@
+Traceback (most recent call last):
+ File "formatter_example.py", line 61, in f_string
+ 54 | def f_string():
+ 55 | f"""{str
+ 56 | (
+ 57 | 1 /
+ 58 | 0 + 4
+ 59 | + 5
+ 60 | )
+--> 61 | }"""
+ZeroDivisionError: division by zero
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/samples/cython_example.pyx
new/stack_data-0.2.0/tests/samples/cython_example.pyx
--- old/stack_data-0.1.3/tests/samples/cython_example.pyx 1970-01-01
01:00:00.000000000 +0100
+++ new/stack_data-0.2.0/tests/samples/cython_example.pyx 2022-02-14
19:51:33.000000000 +0100
@@ -0,0 +1,5 @@
+def foo():
+ bar()
+
+cdef bar():
+ raise ValueError("bar!")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/samples/example.py
new/stack_data-0.2.0/tests/samples/example.py
--- old/stack_data-0.1.3/tests/samples/example.py 2020-02-13
17:17:36.000000000 +0100
+++ new/stack_data-0.2.0/tests/samples/example.py 2022-02-14
17:47:11.000000000 +0100
@@ -17,7 +17,8 @@
5,
6
][0])
- result = print_stack()
+ result = print_stack(
+ )
return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/samples/formatter_example.py
new/stack_data-0.2.0/tests/samples/formatter_example.py
--- old/stack_data-0.1.3/tests/samples/formatter_example.py 2021-09-19
22:17:49.000000000 +0200
+++ new/stack_data-0.2.0/tests/samples/formatter_example.py 2022-01-15
11:36:16.000000000 +0100
@@ -51,6 +51,16 @@
return list(formatter.format_frame(frame))
+def f_string():
+ f"""{str
+ (
+ 1 /
+ 0 + 4
+ + 5
+ )
+ }"""
+
+
if __name__ == '__main__':
try:
bar()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/samples/pieces.py
new/stack_data-0.2.0/tests/samples/pieces.py
--- old/stack_data-0.1.3/tests/samples/pieces.py 2021-04-18
12:36:26.000000000 +0200
+++ new/stack_data-0.2.0/tests/samples/pieces.py 2022-01-15
11:36:16.000000000 +0100
@@ -33,6 +33,26 @@
str("""
foo
""")
+ str(f"""
+ {str(str)}
+ """)
+ str(f"""
+ foo
+ {
+ str(
+ str
+ )
+ }
+ bar
+ {str(str)}
+ baz
+ {
+ str(
+ str
+ )
+ }
+ spam
+ """)
def foo2(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/test_core.py
new/stack_data-0.2.0/tests/test_core.py
--- old/stack_data-0.1.3/tests/test_core.py 2021-09-19 22:31:49.000000000
+0200
+++ new/stack_data-0.2.0/tests/test_core.py 2022-02-14 19:51:33.000000000
+0100
@@ -356,6 +356,26 @@
[' str("""',
' foo',
' """)'],
+ [' str(f"""',
+ ' {str(str)}',
+ ' """)'],
+ [' str(f"""',
+ ' foo',
+ ' {',
+ ' str(',
+ ' str',
+ ' )',
+ ' }',
+ ' bar',
+ ' {str(str)}',
+ ' baz',
+ ' {',
+ ' str(',
+ ' str',
+ ' )',
+ ' }',
+ ' spam',
+ ' """)'],
['def foo2(',
' x=1,',
' y=2,', '):'],
@@ -514,7 +534,6 @@
filename = str(samples_dir / "not_code.txt")
source = Source.for_filename(filename)
assert not source.tree
- assert not hasattr(source, "pieces")
assert not hasattr(source, "tokens_by_lineno")
@@ -554,12 +573,12 @@
result = bar()
print(result)
assert result == """\
-bar at line 26
+bar at line 27
--------------
- 24 | def bar():
- 25 | <var>names</var> = {}
- 26 > <exec>exec("result = foo()", globals(), <var>names</var>)</exec>
- 27 | return <var>names</var>["result"]
+ 25 | def bar():
+ 26 | <var>names</var> = {}
+ 27 > <exec>exec("result = foo()", globals(), <var>names</var>)</exec>
+ 28 | return <var>names</var>["result"]
names = {}
<module> at line 1
@@ -577,8 +596,9 @@
(...)
18 | <var> 6</var>
19 | <var> ][0]</var>)
- 20 > result = <exec>print_stack()</exec>
- 21 | return result
+ 20 > result = <exec>print_stack(</exec>
+ 21 | <exec>)</exec>
+ 22 | return result
[
1,
2,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tests/test_formatter.py
new/stack_data-0.2.0/tests/test_formatter.py
--- old/stack_data-0.1.3/tests/test_formatter.py 2021-04-18
12:36:26.000000000 +0200
+++ new/stack_data-0.2.0/tests/test_formatter.py 2022-02-14
19:51:33.000000000 +0100
@@ -21,13 +21,13 @@
class MyFormatter(BaseFormatter):
def format_frame(self, frame):
- if not frame.filename.endswith(("formatter_example.py", "<string>")):
+ if not frame.filename.endswith(("formatter_example.py", "<string>",
"cython_example.pyx")):
return
yield from super().format_frame(frame)
def test_example(capsys):
- from .samples.formatter_example import bar, print_stack1, format_stack1,
format_frame
+ from .samples.formatter_example import bar, print_stack1, format_stack1,
format_frame, f_string
@contextmanager
def check_example(name):
@@ -66,3 +66,17 @@
formatter = BaseFormatter()
formatted = format_frame(formatter)
formatter.print_lines(formatted)
+
+ with check_example(f"f_string_{'old' if sys.version_info[:2] < (3, 8) else
'new'}"):
+ try:
+ f_string()
+ except Exception:
+ MyFormatter().print_exception()
+
+ from .samples import cython_example
+
+ with check_example("cython_example"):
+ try:
+ cython_example.foo()
+ except Exception:
+ MyFormatter().print_exception()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/stack_data-0.1.3/tox.ini new/stack_data-0.2.0/tox.ini
--- old/stack_data-0.1.3/tox.ini 2021-11-12 23:11:00.000000000 +0100
+++ new/stack_data-0.2.0/tox.ini 2022-01-15 11:36:16.000000000 +0100
@@ -1,9 +1,8 @@
[tox]
-envlist = py{35,36,37,38,39,310}
+envlist = py{36,37,38,39,310}
[testenv]
commands = pytest
-deps =
- .[tests]
+extras = tests
passenv =
STACK_DATA_SLOW_TESTS