14
0

- Update to 1.3.0

* Added **kwargs to function and method signatures as appropriate
    to match the signatures in the standard library
  * In line with the stdlib typings in typeshed, updated
    (Base)ExceptionGroup generic types to define defaults for their
    generic arguments (defaulting to BaseExceptionGroup[BaseException]
    and ExceptionGroup[Exception])
  * Changed BaseExceptionGroup.__init__() to directly call
    BaseException.__init__() instead of the superclass __init__()
    in order to emulate the CPython behavior (broken or not) 
  * Changed the exceptions attribute to always return the same tuple
    of exceptions, created from the original exceptions sequence
    passed to BaseExceptionGroup to match CPython behavior
- Add py314.patch to fix tests on Python 3.14

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-exceptiongroup?expand=0&rev=25
This commit is contained in:
2025-09-10 09:15:34 +00:00
committed by Git OBS Bridge
commit b1d38e674d
7 changed files with 292 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

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7af03131ce1ad5177a6e449b7dc36aa9148bb9103654542a7217f5842a4df551
size 29197

23
py314.patch Normal file
View File

@@ -0,0 +1,23 @@
From a0da94dadfb39c0b52c0cd5c87ace166b00f74c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
Date: Sat, 31 May 2025 12:36:46 +0300
Subject: [PATCH] Fixed test failures on Python 3.14
Fixes #148.
---
tests/test_exceptions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index 2edcfcd..e2bc81a 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -374,7 +374,7 @@ def test_basics_split_by_predicate__match(self):
class DeepRecursionInSplitAndSubgroup(unittest.TestCase):
def make_deep_eg(self):
e = TypeError(1)
- for _ in range(10000):
+ for _ in range(150_000):
e = ExceptionGroup("eg", [e])
return e

View File

@@ -0,0 +1,134 @@
-------------------------------------------------------------------
Mon Sep 8 14:14:36 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 1.3.0
* Added **kwargs to function and method signatures as appropriate
to match the signatures in the standard library
* In line with the stdlib typings in typeshed, updated
(Base)ExceptionGroup generic types to define defaults for their
generic arguments (defaulting to BaseExceptionGroup[BaseException]
and ExceptionGroup[Exception])
* Changed BaseExceptionGroup.__init__() to directly call
BaseException.__init__() instead of the superclass __init__()
in order to emulate the CPython behavior (broken or not)
* Changed the exceptions attribute to always return the same tuple
of exceptions, created from the original exceptions sequence
passed to BaseExceptionGroup to match CPython behavior
- Add py314.patch to fix tests on Python 3.14
-------------------------------------------------------------------
Fri Jul 26 11:42:55 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 1.2.2
* Removed an ``assert`` in ``exceptiongroup._formatting``
that caused compatibility issues with Sentry (#123)
-------------------------------------------------------------------
Sat Apr 20 14:08:38 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 1.2.1:
* Updated the copying of __notes__ to match CPython behavior
* Corrected the type annotation of the exception handler
callback to accept a BaseExceptionGroup instead of
BaseException
* Fixed type errors on Python < 3.10 and the type annotation of
suppress()
-------------------------------------------------------------------
Mon Nov 27 15:43:56 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.2.0:
* Added special monkeypatching if `Apport
<https://github.com/canonical/apport>`_ has
overridden ``sys.excepthook`` so it will format exception
groups correctly
* Added a backport of ``contextlib.suppress()`` from Python
3.12.1 which also handles suppressing exceptions inside
exception groups
* Fixed bare ``raise`` in a handler reraising the original
naked exception rather than an exception group which is what
is raised when you do a ``raise`` in an ``except*`` handler
* ``catch()`` now raises a ``TypeError`` if passed an async
exception handler instead of just giving a ``RuntimeWarning``
about the coroutine never being awaited.
* Fixed plain ``raise`` statement in an exception handler
callback to work like a ``raise`` in an ``except*`` block
* Fixed new exception group not being chained to the original
exception when raising an exception group from exceptions
raised in handler callbacks
* Fixed type annotations of the ``derive()``, ``subgroup()``
and ``split()`` methods to match the ones in typeshed
- drop skip-test_catch_handler_raises-for-older-311.patch
(upstream)
-------------------------------------------------------------------
Tue Jul 4 22:32:27 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.1.2:
- Changed handling of exceptions in exception group handler
callbacks to not wrap a single exception in an exception
group, as per CPython issue gh#python/cpython#103590.
- Add skip-test_catch_handler_raises-for-older-311.patch
(gh#agronholm/exceptiongroup#64).
-------------------------------------------------------------------
Fri Apr 21 12:24:46 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:41:07 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Tue Mar 14 22:18:18 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.1.1:
* Worked around `CPython issue #98778
``urllib.error.HTTPError(..., fp=None)`` raises
``KeyError`` on unknown attribute access, on affected
Python versions.
-------------------------------------------------------------------
Fri Dec 23 15:24:56 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update to 1.1.0
* Backported upstream fix for gh-99553 (custom subclasses of
BaseExceptionGroup that also inherit from Exception should not
be able to wrap base exceptions)
* Moved all initialization code to __new__() (thus matching
Python 3.11 behavior)
- Fix multibuild
-------------------------------------------------------------------
Mon Dec 19 10:08:40 UTC 2022 - Dirk Müller <dmueller@suse.com>
- split tests into multibuild to solve cycle with pytest
-------------------------------------------------------------------
Thu Dec 1 09:42:08 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.0.4:
* Fixed regression introduced in v1.0.3 where the code computing the suggestions would assume that both the obj attribute of AttributeError is always available, even though this is only true from Python 3.10 onwards (#43; PR by Carl Friedrich Bolz-Tereick)
- update to 1.0.3:
* Fixed monkey patching breaking suggestions (on a NameError or AttributeError) on Python 3.10 (#41; PR by Carl Friedrich Bolz-Tereick)
- update to 1.0.2:
* Updated type annotations to match the ones in typeshed
- update to 1.0.1:
* Fixed formatted traceback missing exceptions beyond 2 nesting levels of __context__ or __cause__
- update to 1.0.0:
* Fixed AttributeError: 'PatchedTracebackException' object has no attribute '__cause__' on Python 3.10 (only) when a traceback is printed from an exception where an exception group is set as the cause (#33)
* Fixed a loop in exception groups being rendered incorrectly (#35)
* Fixed the patched formatting functions (format_exception()``etc.) not passing the ``compact=True flag on Python 3.10 like the original functions do
-------------------------------------------------------------------
Wed Oct 26 19:53:01 UTC 2022 - Matej Cepl <mcepl@suse.com>
- The package actually builds with Python 3.11.
-------------------------------------------------------------------
Sun Oct 9 19:54:31 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Initial specfile for v 1.0.0rc9
- Pre-release version required by hypothesis

105
python-exceptiongroup.spec Normal file
View File

@@ -0,0 +1,105 @@
#
# spec file for package python-exceptiongroup
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#
# This is not only because of dependency of testsuite, but mostly
# because of cyclical dependencies between exceptiongroup and pytest.
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%define psuffix -test
%else
%bcond_with test
%define psuffix %{nil}
%endif
%{?sle15_python_module_pythons}
Name: python-exceptiongroup%{psuffix}
Version: 1.3.0
Release: 0
Summary: Backport of PEP 654 (exception groups)
License: MIT AND Python-2.0
URL: https://github.com/agronholm/exceptiongroup
Source: https://github.com/agronholm/exceptiongroup/archive/refs/tags/%{version}.tar.gz#/exceptiongroup-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/agronholm/exceptiongroup/commit/a0da94dadfb39c0b52c0cd5c87ace166b00f74c1 Fixed test failures on Python 3.14
Patch0: py314.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module flit-scm}
BuildRequires: %{python_module pip}
%if %{with test}
BuildRequires: %{python_module exceptiongroup = %{version}}
BuildRequires: %{python_module pytest}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
%python_subpackages
%description
This is a backport of the ``BaseExceptionGroup`` and ``ExceptionGroup`` classes from
Python 3.11.
It contains the following:
* The ``exceptiongroup.BaseExceptionGroup`` and ``exceptiongroup.ExceptionGroup``
classes
* A utility function (``exceptiongroup.catch()``) for catching exceptions possibly
nested in an exception group
* Patches to the ``TracebackException`` class that properly formats exception groups
(installed on import)
* An exception hook that handles formatting of exception groups through
``TracebackException`` (installed on import)
* Special versions of some of the functions from the ``traceback`` module, modified to
correctly handle exception groups even when monkey patching is disabled, or blocked by
another custom exception hook:
* ``traceback.format_exception()``
* ``traceback.format_exception_only()``
* ``traceback.print_exception()``
* ``traceback.print_exc()``
If this package is imported on Python 3.11 or later, the built-in implementations of the
exception group classes are used instead, ``TracebackException`` is not monkey patched
and the exception hook won't be installed.
%prep
%autosetup -p1 -n exceptiongroup-%{version}
%if !%{with test}
%build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
%pytest
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/exceptiongroup
%{python_sitelib}/exceptiongroup-%{version}.dist-info
%endif
%changelog