- Add pygments.patch to fix non-skipped tests with Pygments 2.19

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stack-data?expand=0&rev=21
This commit is contained in:
Nico Krapp 2025-01-20 13:46:56 +00:00 committed by Git OBS Bridge
commit 962361a243
6 changed files with 197 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

24
pygments.patch Normal file
View File

@ -0,0 +1,24 @@
Index: stack_data-0.6.3/tests/test_core.py
===================================================================
--- stack_data-0.6.3.orig/tests/test_core.py
+++ stack_data-0.6.3/tests/test_core.py
@@ -573,8 +573,8 @@ def test_absolute_filename():
[
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 }",
+ r".c-ExecutingNode { color: #(999999|ababab); font-style: italic; background-color: #(ffff00|FF0) }",
+ r".err-ExecutingNode { color: #A61717; background-color: #(ffff00|FF0) }",
]
)
def test_executing_style_defs(expected):
@@ -582,7 +582,7 @@ def test_executing_style_defs(expected):
formatter = HtmlFormatter(style=style)
style_defs = formatter.get_style_defs()
- assert re.search(expected, style_defs)
+ assert re.search(expected, style_defs, re.IGNORECASE)
def test_example():

72
python-stack-data.changes Normal file
View File

@ -0,0 +1,72 @@
-------------------------------------------------------------------
Mon Jan 20 13:14:44 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add pygments.patch to fix non-skipped tests with Pygments 2.19
-------------------------------------------------------------------
Mon Nov 27 16:11:39 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.6.3:
* Python 3.12 support
* handle weird six import error
- drop support-typeguard-4.patch (upstream)
-------------------------------------------------------------------
Wed Aug 23 07:28:06 UTC 2023 - ecsos <ecsos@opensuse.org>
- Revert restrict to older Cython. Can not find any specification.
-------------------------------------------------------------------
Mon Aug 14 12:52:59 UTC 2023 - Dirk Müller <dmueller@suse.com>
- skip more tests for newer pygments version
-------------------------------------------------------------------
Sun Aug 13 19:27:59 UTC 2023 - Dirk Müller <dmueller@suse.com>
- restrict to older Cython
-------------------------------------------------------------------
Mon May 15 09:53:06 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-typeguard-4.patch:
* Support typeguard 4+.
-------------------------------------------------------------------
Thu May 4 21:23:25 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.6.2:
* python 3.11 support
* add tests
- drop 29-Pygments-2-12.patch (upstream)
-------------------------------------------------------------------
Fri Apr 21 12:37:06 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:45:15 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Wed Jan 4 01:04:23 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Skip test_pygments_example test, because it is just too
unstable given the ever changing output from Pygments.
-------------------------------------------------------------------
Mon May 16 12:18:16 UTC 2022 - Matej Cepl <mcepl@suse.com>
- 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.
-------------------------------------------------------------------
Fri Jan 14 21:54:31 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Initial effort to package stack-data 0.1.3.

74
python-stack-data.spec Normal file
View File

@ -0,0 +1,74 @@
#
# spec file for package python-stack-data
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-stack-data
Version: 0.6.3
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
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module setuptools >= 44}
BuildRequires: %{python_module setuptools_scm >= 3.4.3}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# PATCH-FIX-UPSTREAM https://github.com/alexmojaki/stack_data/pull/58 Modify test_executing_style_defs to work with Pygments 2.19
Patch0: pygments.patch
Requires: python-asttokens
Requires: python-executing
Requires: python-pure-eval
Suggests: python-littleutils
Suggests: python-pygments
Suggests: python-pytest
Suggests: python-typeguard
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module asttokens}
BuildRequires: %{python_module executing}
BuildRequires: %{python_module littleutils}
BuildRequires: %{python_module pure-eval}
BuildRequires: %{python_module pygments}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module typeguard}
# /SECTION
%python_subpackages
%description
Extract data from python stack frames and tracebacks for informative displays
%prep
%autosetup -p1 -n stack_data-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# incompatibility with even older Pygments
%pytest -k 'not ((test_core and test_pygments_example) or (test_serializer and test_example))'
%files %{python_files}
%{python_sitelib}/stack_data
%{python_sitelib}/stack_data-%{version}*-info
%changelog

3
stack_data-0.6.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9
size 44707