diff --git a/.gitignore b/.gitignore index d8b8705..48e90a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/zope.exceptions-4.0.8.tar.gz +SOURCES/zope.exceptions-5.1.tar.gz diff --git a/.python-zope-exceptions.metadata b/.python-zope-exceptions.metadata index 2ed4df2..9701f55 100644 --- a/.python-zope-exceptions.metadata +++ b/.python-zope-exceptions.metadata @@ -1 +1 @@ -f1e369c93f1aac2c7a866e5178c53bd5bc06813c SOURCES/zope.exceptions-4.0.8.tar.gz +3700384c7a7d9f63790ce5fb06923e0062eac8aa SOURCES/zope.exceptions-5.1.tar.gz diff --git a/SOURCES/0001-Fix-test_format_exception_as_html-on-python-3.13.patch b/SOURCES/0001-Fix-test_format_exception_as_html-on-python-3.13.patch new file mode 100644 index 0000000..341bd6b --- /dev/null +++ b/SOURCES/0001-Fix-test_format_exception_as_html-on-python-3.13.patch @@ -0,0 +1,34 @@ +From 92b73e0f3db76c4f7251f9703a306846e7dc4462 Mon Sep 17 00:00:00 2001 +From: Jerry James +Date: Tue, 23 Jul 2024 09:44:34 -0600 +Subject: [PATCH] Fix test_format_exception_as_html on python 3.13 + +--- + src/zope/exceptions/tests/test_exceptionformatter.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/zope/exceptions/tests/test_exceptionformatter.py b/src/zope/exceptions/tests/test_exceptionformatter.py +index 92ea79a..1a37538 100644 +--- a/src/zope/exceptions/tests/test_exceptionformatter.py ++++ b/src/zope/exceptions/tests/test_exceptionformatter.py +@@ -24,6 +24,7 @@ from urllib.error import HTTPError + + + IS_PY39_OR_GREATER = sys.version_info >= (3, 9) ++IS_PY313_OR_GREATER = sys.version_info >= (3, 13) + + + class TextExceptionFormatterTests(unittest.TestCase): +@@ -772,6 +773,9 @@ class Test_format_exception(unittest.TestCase): + # Python 3.9 moves the pointer after the statement instead to the + # last character of it: + expected = expected.replace('^
', ' ^
') ++ if IS_PY313_OR_GREATER: # pragma: no cover ++ # Python 3.13 changed the text of the SyntaxError ++ expected = expected.replace("invalid syntax", "Expected one or more names after 'import'") + # HTML formatter uses Windows line endings for some reason. + result = result.replace('\r\n', '\n') + result = re.sub(r'line \d\d\d,', 'line ABC,', result) +-- +2.45.2 + diff --git a/SPECS/python-zope-exceptions.spec b/SPECS/python-zope-exceptions.spec index 36782f5..6168b05 100644 --- a/SPECS/python-zope-exceptions.spec +++ b/SPECS/python-zope-exceptions.spec @@ -1,110 +1,134 @@ %global modname zope.exceptions +%global giturl https://github.com/zopefoundation/zope.exceptions -%if 0%{?fedora} || 0%{?rhel} >= 8 -%global with_python3 1 -%endif +# There is a test dependency loop, so we need a way to build this without tests +# zope.exceptions -> zope.testrunner-> zope.exceptions +%bcond tests 1 Summary: Zope Exceptions Name: python-zope-exceptions -Version: 4.0.8 -Release: 12%{?dist}.1 -Source0: http://pypi.python.org/packages/source/z/%{modname}/%{modname}-%{version}.tar.gz -License: ZPLv2.1 +Version: 5.1 +Release: 1%{?dist} +VCS: git:%{giturl}.git +Source0: %{giturl}/archive/%{version}/%{modname}-%{version}.tar.gz +License: ZPL-2.1 BuildArch: noarch -URL: http://pypi.python.org/pypi/zope.exceptions - -%description -This package contains exception interfaces and implementations which are so -general purpose that they don't belong in Zope application-specific packages. - -%package -n python2-zope-exceptions -Summary: Zope Exceptions -%{?python_provide:%python_provide python2-zope-exceptions} - -BuildRequires: python2-devel -BuildRequires: python2-setuptools - -%if 0%{?rhel} && 0%{?rhel} <= 6 -BuildRequires: python-zope-interface4 -Requires: python-zope-interface4 -%else -BuildRequires: python2-zope-interface -Requires: python2-zope-interface -%endif +URL: https://zopeexceptions.readthedocs.io/ +# Fix FTBFS with python3.13 +# https://github.com/zopefoundation/zope.exceptions/pull/35 +Patch: 0001-Fix-test_format_exception_as_html-on-python-3.13.patch -%description -n python2-zope-exceptions +%description This package contains exception interfaces and implementations which are so general purpose that they don't belong in Zope application-specific packages. -%if 0%{?with_python3} %package -n python3-zope-exceptions Summary: Zope Exceptions -%{?python_provide:%python_provide python3-zope-exceptions} - BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-zope-interface - -Requires: python3-zope-interface %description -n python3-zope-exceptions This package contains exception interfaces and implementations which are so general purpose that they don't belong in Zope application-specific packages. -%endif %prep -%setup -q -n %{modname}-%{version} +%autosetup -n %{modname}-%{version} -p1 -rm -rf %{modname}.egg-info +%generate_buildrequires +%pyproject_buildrequires %{?with_tests:-t} %build -%{py2_build} -%if 0%{?with_python3} -%{py3_build} -%endif +%pyproject_wheel %install -%{py2_install} -%if 0%{?with_python3} -%{py3_install} +%pyproject_install +%pyproject_save_files zope + +%check +%pyproject_check_import +%if %{with tests} +%tox %endif -# As of python-zope-exceptions-4.0.6, the tests require -# python-zope-testrunner which has not yet been packaged. -#%%check -#%%{__python2} setup.py test -# -#%%if 0%%{?with_python3} -#%%{__python3} setup.py test -#%%endif - -%files -n python2-zope-exceptions -%doc LICENSE.txt CHANGES.rst README.rst COPYRIGHT.txt -%{python2_sitelib}/zope/exceptions/ -# Co-own %%{python2_sitelib}/zope/ -%dir %{python2_sitelib}/zope/ -%exclude %{python2_sitelib}/zope/exceptions/tests/ -%{python2_sitelib}/%{modname}-*.egg-info -%{python2_sitelib}/%{modname}-*-nspkg.pth - -%if 0%{?with_python3} -%files -n python3-zope-exceptions -%doc LICENSE.txt CHANGES.rst README.rst COPYRIGHT.txt -%{python3_sitelib}/zope/exceptions/ -# Co-own %%{python3_sitelib}/zope/ -%dir %{python3_sitelib}/zope/ -%exclude %{python3_sitelib}/zope/exceptions/tests/ -%{python3_sitelib}/%{modname}-*.egg-info +%files -n python3-zope-exceptions -f %{pyproject_files} +%doc CHANGES.rst README.rst +%license COPYRIGHT.txt LICENSE.txt %{python3_sitelib}/%{modname}-*-nspkg.pth -%endif %changelog -* Wed Jan 24 2024 Sergey Cherevko - 4.0.8-12.1 -- Rebuilt for MSVSphere 8.9 +* Sat Jan 04 2025 Arkady L. Shane - 5.1-1 +- Rebuilt for MSVSphere 10 + +* Tue Jul 23 2024 Jerry James - 5.1-1 +- Version 5.1 (rhbz#2290844) +- Add patch for python 3.13 compatibility (rhbz#2280553) +- Minor spec file cleanups + +* Fri Jul 19 2024 Fedora Release Engineering - 5.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sun Jun 09 2024 Python Maint - 5.0.1-3 +- Rebuilt for Python 3.13 + +* Fri Jun 07 2024 Python Maint - 5.0.1-2 +- Bootstrap for Python 3.13 + +* Mon Jan 29 2024 Jerry James - 5.0.1-1 +- Version 5.0.1 +- Convert License tag to SPDX +- Modernize the spec file + +* Fri Jan 26 2024 Fedora Release Engineering - 4.0.8-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 4.0.8-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 4.0.8-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 4.0.8-26 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 4.0.8-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 4.0.8-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 4.0.8-23 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 4.0.8-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 4.0.8-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 4.0.8-20 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 4.0.8-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 4.0.8-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat May 23 2020 Miro Hrončok - 4.0.8-17 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 4.0.8-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Sep 20 2019 Miro Hrončok - 4.0.8-15 +- Subpackage python2-zope-exceptions has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Fri Aug 16 2019 Miro Hrončok - 4.0.8-14 +- Rebuilt for Python 3.8 -* Thu Jun 20 2019 Troy Dawson - 4.0.8-12.1 -- Build python3 on RHEL8 +* Fri Jul 26 2019 Fedora Release Engineering - 4.0.8-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 4.0.8-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild