diff --git a/PyICU-2.10.2.tar.gz b/PyICU-2.10.2.tar.gz deleted file mode 100644 index fed18ce..0000000 --- a/PyICU-2.10.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c3309eea7fab6857507ace62403515b60fe096cbfb4f90d14f55ff75c5441c1 -size 255558 diff --git a/PyICU-2.11.tar.gz b/PyICU-2.11.tar.gz new file mode 100644 index 0000000..ad27aa9 --- /dev/null +++ b/PyICU-2.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ab531264cfe9132b3d2ac5d708da9a4649d25f6e6813730ac88cf040a08a844 +size 257899 diff --git a/python-PyICU.changes b/python-PyICU.changes index 48a42ef..facd7f6 100644 --- a/python-PyICU.changes +++ b/python-PyICU.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Sun Jun 25 19:30:35 UTC 2023 - Matej Cepl + +- Clean up SPEC file. +- Add remove_six.patch which removes the need to use six. + +------------------------------------------------------------------- +Sun Jun 25 07:21:50 UTC 2023 - Andreas Schneider + +- Update to version 2.11 + * fixed bug PluralFormat.format accepting python strings, which are immutable + * fixed bug with UWordBreak wrapping wrong enum (UBreakIteratorType) + * added wrappers for UBreakIteratorType, ULine|SentenceBreakTag + * added wrappers for DateTimePatternGenerator::set|getDateTimeFormat() + * added wrappers for Precision::incrementExact() + * Locale objects can now be sorted (Fredrik Roubert) + * added wrapper for Calendar::inTemporalLeapYear() + * added wrappers for Calendar::get|getTemporalMonthCode() + * changed all Calendar setters to return self instead of None, setter chaining +- Use sle15_python_module_pythons + ------------------------------------------------------------------- Thu Oct 27 10:57:22 UTC 2022 - Markéta Machová diff --git a/python-PyICU.spec b/python-PyICU.spec index eb4f5f6..fa85cba 100644 --- a/python-PyICU.spec +++ b/python-PyICU.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# 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 @@ -16,20 +16,22 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %global modname PyICU Name: python-%{modname} -Version: 2.10.2 +Version: 2.11 Release: 0 Summary: Python Extension Wrapping the ICU C++ API License: MIT Group: Development/Libraries/Python URL: https://gitlab.pyicu.org -Source0: https://files.pythonhosted.org/packages/source/P/PyICU/%{modname}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/P/PyICU/PyICU-2.11.tar.gz +# PATCH-FEATURE-UPSTREAM remove_six.patch mcepl@suse.com +# Remove dependency on six +Patch0: remove_six.patch BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -39,6 +41,7 @@ BuildRequires: pkgconfig(icu-uc) Provides: %{modname} = %{version} Provides: python-ICU = %{version} Obsoletes: python-ICU < 1.2 +%{?sle15_python_module_pythons} %python_subpackages %description @@ -46,15 +49,15 @@ Python extension wrapping IBM's International Components for Unicode C++ library (ICU). %prep -%setup -q -n %{modname}-%{version} +%autosetup -p1 -n %{modname}-%{version} %build export CXXFLAGS="%{optflags} -fno-strict-aliasing" export CFLAGS="%{optflags} -fno-strict-aliasing" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check @@ -63,6 +66,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" %files %{python_files} %license LICENSE %doc CHANGES CREDITS README.md -%{python_sitearch}/* +%{python_sitearch}/icu +%{python_sitearch}/PyICU-%{version}*-info %changelog diff --git a/remove_six.patch b/remove_six.patch new file mode 100644 index 0000000..f902591 --- /dev/null +++ b/remove_six.patch @@ -0,0 +1,254 @@ +--- + setup.py | 7 +++---- + test/test_BytesTrie.py | 2 +- + test/test_Charset.py | 4 ++-- + test/test_Collator.py | 4 ++-- + test/test_LayoutEngine.py | 2 +- + test/test_Locale.py | 2 +- + test/test_LocaleData.py | 14 +++++++------- + test/test_LocaleMatcher.py | 2 +- + test/test_PythonReplaceable.py | 2 +- + test/test_Script.py | 8 ++++---- + test/test_TimeZone.py | 2 +- + test/test_Transliterator.py | 4 ++-- + test/test_UCharsTrie.py | 2 +- + 13 files changed, 27 insertions(+), 28 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -1,4 +1,3 @@ +- + import os, sys + + try: +@@ -195,7 +194,7 @@ else: + except: + if not _cflags: + raise RuntimeError(''' +-Please install pkg-config on your system or set the PYICU_CFLAGS environment ++Please install pkg-config on your system or set the PYICU_CFLAGS environment + variable to the flags required by the C++ compiler to find the header files + for ICU, and possibly -std=c++11 if using ICU version >= 60 + ''') +@@ -234,7 +233,7 @@ else: + Please install pkg-config on your system or set the PYICU_LFLAGS environment + variable to the flags required by the linker to find the libraries for ICU + ''') +- ++ + + if 'PYICU_LIBRARIES' in os.environ: + _libraries = os.environ['PYICU_LIBRARIES'].split(os.pathsep) +@@ -283,4 +282,4 @@ setup(name="PyICU", + libraries=_libraries)], + package_dir={"": "py"}, + packages=['icu'], +- tests_require=['pytest', 'six']) ++ tests_require=['pytest']) +--- a/test/test_BytesTrie.py ++++ b/test/test_BytesTrie.py +@@ -21,7 +21,7 @@ + # DEALINGS IN THE SOFTWARE. + # ==================================================================== + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +--- a/test/test_Charset.py ++++ b/test/test_Charset.py +@@ -21,7 +21,7 @@ + # ==================================================================== + # + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +@@ -59,7 +59,7 @@ class TestCharset(TestCase): + def testUnicode(self): + + bytes = u'beaut\xe9 probable'.encode('iso-8859-1') +- ustring = six.text_type(CharsetDetector(bytes).detect()) ++ ustring = str(CharsetDetector(bytes).detect()) + + self.assertTrue(ustring.encode('iso-8859-1') == bytes) + +--- a/test/test_Collator.py ++++ b/test/test_Collator.py +@@ -21,7 +21,7 @@ + # ==================================================================== + # + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +@@ -44,7 +44,7 @@ class TestCollator(TestCase): + + collator = Collator.createInstance(Locale.getFrance()) + input = open(self.filePath('noms.txt'), 'rb') +- names = [six.text_type(n.strip(), 'utf-8') for n in input.readlines()] ++ names = [str(n.strip(), 'utf-8') for n in input.readlines()] + input.close() + ecole = names[0] + +--- a/test/test_LayoutEngine.py ++++ b/test/test_LayoutEngine.py +@@ -22,7 +22,7 @@ + # ==================================================================== + # + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +--- a/test/test_Locale.py ++++ b/test/test_Locale.py +@@ -21,7 +21,7 @@ + # DEALINGS IN THE SOFTWARE. + # ==================================================================== + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +--- a/test/test_LocaleData.py ++++ b/test/test_LocaleData.py +@@ -22,7 +22,7 @@ + # + # This is a python translation of ICU's LocaleDataTest.java + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +@@ -110,8 +110,8 @@ class TestLocaleData(TestCase): + break + if existsInScript == False: + print_output("ExemplarSet containment failed for locale : "+ locale) +- print_output(locale + " exemplar " + repr(six.text_type(exemplarSets[0]))) +- print_output(locale + " exemplar(case-folded) " + repr(six.text_type(exemplarSets[1]))) ++ print_output(locale + " exemplar " + repr(str(exemplarSets[0]))) ++ print_output(locale + " exemplar(case-folded) " + repr(str(exemplarSets[1]))) + self.assertTrue(locale + " case-folded is a superset", exemplarSets[1].containsAll(exemplarSets[0])) + if (exemplarSets[1] == exemplarSets[0]): + ++equalCount +@@ -156,10 +156,10 @@ class TestLocaleData(TestCase): + if existsInScript == False and h == 0: + print_output("ExemplarSet containment failed for locale,option,type : " \ + + locale + "," + str(option) + "," + str(esType)) +- print_output(locale + " exemplar(ES_STANDARD)" + repr(six.text_type(exemplarSets[0]))) +- print_output(locale + " exemplar(ES_AUXILIARY)" + repr(six.text_type(exemplarSets[1]))) +- print_output(locale + " exemplar(case-folded,ES_STANDARD)" + repr(six.text_type(exemplarSets[2]))) +- print_output(locale + " exemplar(case-folded,ES_AUXILIARY)" + repr(six.text_type(exemplarSets[3]))) ++ print_output(locale + " exemplar(ES_STANDARD)" + repr(str(exemplarSets[0]))) ++ print_output(locale + " exemplar(ES_AUXILIARY)" + repr(str(exemplarSets[1]))) ++ print_output(locale + " exemplar(case-folded,ES_STANDARD)" + repr(str(exemplarSets[2]))) ++ print_output(locale + " exemplar(case-folded,ES_AUXILIARY)" + repr(str(exemplarSets[3]))) + self.assertTrue(locale + " case-folded is a superset", exemplarSets[2].containsAll(exemplarSets[0])) + self.assertTrue(locale + " case-folder is a superset", exemplarSets[3].containsAll(exemplarSets[1])) + if (exemplarSets[2] == exemplarSets[0]): +--- a/test/test_LocaleMatcher.py ++++ b/test/test_LocaleMatcher.py +@@ -21,7 +21,7 @@ + # DEALINGS IN THE SOFTWARE. + # ==================================================================== + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main, SkipTest + from icu import * +--- a/test/test_PythonReplaceable.py ++++ b/test/test_PythonReplaceable.py +@@ -21,7 +21,7 @@ + # DEALINGS IN THE SOFTWARE. + # ==================================================================== + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +--- a/test/test_Script.py ++++ b/test/test_Script.py +@@ -21,7 +21,7 @@ + # ==================================================================== + # + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +@@ -53,7 +53,7 @@ class TestScript(TestCase): + + # iterating codepoints not UChar + names = [Script.getScript(cp).getShortName() +- for cp in six.text_type(pairs)] ++ for cp in str(pairs)] + if unicode_32bit: + self.assertEqual(['Latn', 'Deva', 'Hani', 'Hani'], names) + else: +@@ -83,10 +83,10 @@ class TestScript(TestCase): + self.assertEqual(str(u), char) + elif is_unicode_32bit(): + self.assertEqual(len(char), 1) +- self.assertEqual(six.text_type(u), char) ++ self.assertEqual(str(u), char) + else: + self.assertEqual(len(char), 2) +- self.assertEqual(six.text_type(u), char) ++ self.assertEqual(str(u), char) + + if __name__ == "__main__": + main() +--- a/test/test_TimeZone.py ++++ b/test/test_TimeZone.py +@@ -21,7 +21,7 @@ + # ==================================================================== + # + +-import sys, os, six, datetime ++import sys, os, datetime + + from unittest import TestCase, main + from icu import * +--- a/test/test_Transliterator.py ++++ b/test/test_Transliterator.py +@@ -22,7 +22,7 @@ + # ==================================================================== + # + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import * +@@ -50,7 +50,7 @@ class TestTransliterator(TestCase): + string = UnicodeString("Shang4hai3 zi4lai2shui3 lai2 zi4 hai3 shang4") + result = u'Sh\xe0ngh\u01cei z\xecl\xe1ishu\u01d0 l\xe1i z\xec h\u01cei sh\xe0ng' + +- self.assertTrue(trans.transliterate(six.text_type(string)) == result) ++ self.assertTrue(trans.transliterate(str(string)) == result) + self.assertTrue(trans.transliterate(string) == result) + self.assertTrue(string == result) + +--- a/test/test_UCharsTrie.py ++++ b/test/test_UCharsTrie.py +@@ -21,7 +21,7 @@ + # DEALINGS IN THE SOFTWARE. + # ==================================================================== + +-import sys, os, six ++import sys, os + + from unittest import TestCase, main + from icu import *