summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exceptiongroup.spec15
1 files changed, 14 insertions, 1 deletions
diff --git a/exceptiongroup.spec b/exceptiongroup.spec
index 19d1f1d..e15efb3 100644
--- a/exceptiongroup.spec
+++ b/exceptiongroup.spec
@@ -4,7 +4,7 @@
Name: python-%{pypi_name}
Version: 1.2.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Backport of PEP 654 (exception groups)
License: MIT
URL: https://github.com/agronholm/exceptiongroup
@@ -12,6 +12,8 @@ Source0: https://github.com/agronholm/exceptiongroup/archive/refs/tags/%{
BuildArch: noarch
BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-wheel
BuildRequires: python3-pip
BuildRequires: pyproject-rpm-macros
BuildRequires: python3-flit-scm
@@ -53,6 +55,13 @@ This package provides development documents and examples for %{pypi_name}.
%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
@@ -72,5 +81,9 @@ This package provides development documents and examples for %{pypi_name}.
%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