summaryrefslogtreecommitdiff
path: root/exceptiongroup.spec
blob: e15efb3677f1e40bbede2d7a8327f7eea0136ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# topdir: exceptiongroup-1.2.2
# Build backend: flit_scm (flit_core + setuptools_scm); version auto-detected from git tag
%global pypi_name exceptiongroup

Name:           python-%{pypi_name}
Version:        1.2.2
Release:        2%{?dist}
Summary:        Backport of PEP 654 (exception groups)
License:        MIT
URL:            https://github.com/agronholm/exceptiongroup
Source0:        https://github.com/agronholm/exceptiongroup/archive/refs/tags/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-wheel
BuildRequires:  python3-pip
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3-flit-scm

%description
This is a backport of the BaseExceptionGroup and ExceptionGroup classes
from Python 3.11. It contains the exception group classes, a utility
function (exceptiongroup.catch()) for catching exceptions possibly nested
in an exception group, patches to the TracebackException class that
properly format exception groups, and an exception hook that handles
formatting of exception groups through TracebackException.


%package -n python3-%{pypi_name}
Summary:        Backport of PEP 654 (exception groups)
Provides:       python-%{pypi_name}
Provides:       python3dist(%{pypi_name}) = %{version}

%description -n python3-%{pypi_name}
This is a backport of the BaseExceptionGroup and ExceptionGroup classes
from Python 3.11. It contains the exception group classes, a utility
function (exceptiongroup.catch()) for catching exceptions possibly nested
in an exception group, patches to the TracebackException class that
properly format exception groups, and an exception hook that handles
formatting of exception groups through TracebackException.


%package help
Summary:        Development documents and examples for %{pypi_name}
Requires:       python3-%{pypi_name}
Provides:       python3-%{pypi_name}-doc

%description help
This package provides development documents and examples for %{pypi_name}.


%prep
%autosetup -n %{pypi_name}-%{version} -p1


%build
# Source0 is a GitHub archive tarball (no .git, no .git_archival.txt), so
# setuptools_scm cannot detect the version and its git entrypoint raises
# OSError("'git' was not found" / "unable to detect version"). Pretend the
# version from the spec -- setuptools_scm 7.1.0 checks this env var in
# _do_parse BEFORE invoking any SCM entrypoint, so no git BuildRequires is
# needed.
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_build


%install
%pyproject_install


%files -n python3-%{pypi_name}
%license LICENSE
%{python3_sitelib}/exceptiongroup/
%{python3_sitelib}/exceptiongroup-%{version}*.dist-info/


%files help
%license LICENSE
%doc README.rst CHANGES.rst


%changelog
* Fri Oct 23 2026 Python_Bot <Python_Bot@openeuler.org> - 1.2.2-2
- Set SETUPTOOLS_SCM_PRETEND_VERSION so flit_scm/setuptools_scm can detect
  the version when building from the GitHub archive tarball (no git repo)

* Fri Oct 23 2026 Python_Bot <Python_Bot@openeuler.org> - 1.2.2-1
- Initial package