Sync from SUSE:SLFO:Main python-stack-data revision c5b6d3aac78c9e384412e9b73ab67f4a

This commit is contained in:
Adrian Schröter 2024-05-03 23:09:49 +02:00
commit a702b9c5ad
5 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

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

@ -0,0 +1,59 @@
-------------------------------------------------------------------
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) 2023 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.2
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-OPENSUSE Support typeguard 4+
Patch0: support-typeguard-4.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module setuptools >= 44}
BuildRequires: %{python_module setuptools_scm >= 3.4.3}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
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 Pygments
%pytest -k 'not (test_pygments_example or test_example)'
%files %{python_files}
%{python_sitelib}/stack_data
%{python_sitelib}/stack_data-%{version}*-info
%changelog

BIN
stack_data-0.6.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

38
support-typeguard-4.patch Normal file
View File

@ -0,0 +1,38 @@
Index: stack_data-0.6.2/tests/__init__.py
===================================================================
--- stack_data-0.6.2.orig/tests/__init__.py
+++ stack_data-0.6.2/tests/__init__.py
@@ -1,7 +1,7 @@
import os
import pyximport
-from typeguard.importhook import install_import_hook
+from typeguard import install_import_hook
pyximport.install(language_level=3)
Index: stack_data-0.6.2/stack_data/utils.py
===================================================================
--- stack_data-0.6.2.orig/stack_data/utils.py
+++ stack_data-0.6.2/stack_data/utils.py
@@ -8,6 +8,11 @@ from typing import (
TypeVar, Mapping,
)
+try:
+ from types import NoneType
+except ImportError:
+ NoneType = type(None)
+
from asttokens import ASTText
T = TypeVar('T')
@@ -91,7 +96,7 @@ def is_frame(frame_or_tb: Union[FrameTyp
return isinstance(frame_or_tb, (types.FrameType,))
-def iter_stack(frame_or_tb: Union[FrameType, TracebackType]) -> Iterator[Union[FrameType, TracebackType]]:
+def iter_stack(frame_or_tb: Union[FrameType, TracebackType, NoneType]) -> Iterator[Union[FrameType, TracebackType]]:
while frame_or_tb:
yield frame_or_tb
if is_frame(frame_or_tb):