From 16658bf663d2d7fad281427b5f9d32c32da6857f9de7acbc081fc946c6029506 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 21 Feb 2023 07:24:22 +0000 Subject: [PATCH 1/4] Accepting request 1066827 from home:ecsos - To fix build error correct capitalization of python modul Cython. OBS-URL: https://build.opensuse.org/request/show/1066827 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cchardet?expand=0&rev=12 --- python-cchardet.changes | 5 +++++ python-cchardet.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-cchardet.changes b/python-cchardet.changes index 0bff8a6..512344b 100644 --- a/python-cchardet.changes +++ b/python-cchardet.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 20 13:12:19 UTC 2023 - ecsos + +- To fix build error correct capitalization of python modul Cython. + ------------------------------------------------------------------- Sun Feb 19 12:37:25 UTC 2023 - Dirk Müller diff --git a/python-cchardet.spec b/python-cchardet.spec index 91a2522..4416f82 100644 --- a/python-cchardet.spec +++ b/python-cchardet.spec @@ -25,7 +25,7 @@ Summary: CChardet is high speed universal character encoding detector License: GPL-2.0-or-later OR LGPL-2.1-or-later OR MPL-1.1 URL: https://github.com/PyYoshi/cChardet Source: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz -BuildRequires: %{python_module cython} +BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes From f08c6266f0a68a87b33362d2c60a0c3cd1f70bb2a7dbf05f02b6b012fb5111c3 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 21 Feb 2023 07:48:20 +0000 Subject: [PATCH 2/4] - Add denose.patch () and enable tests. - Clean up SPEC file OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cchardet?expand=0&rev=13 --- denose.patch | 125 ++++++++++++++++++++++++++++++++++++++++ python-cchardet.changes | 10 ++++ python-cchardet.spec | 21 +++++-- 3 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 denose.patch diff --git a/denose.patch b/denose.patch new file mode 100644 index 0000000..918da1c --- /dev/null +++ b/denose.patch @@ -0,0 +1,125 @@ +--- + requirements-dev.txt | 1 - + setup.cfg | 4 ---- + src/tests/test.py | 32 +++++++------------------------- + 3 files changed, 7 insertions(+), 30 deletions(-) + +--- a/requirements-dev.txt ++++ b/requirements-dev.txt +@@ -1,5 +1,4 @@ + chardet==3.0.4 +-nose==1.3.7 + tox==3.20.1 + Cython==0.29.21 + # pylint==2.6.0 +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,7 +1,3 @@ +-[nosetests] +-verbose = 1 +-nocapture = 1 +- + [egg_info] + tag_build = + tag_date = 0 +--- a/src/tests/test.py ++++ b/src/tests/test.py +@@ -3,7 +3,6 @@ import glob + import os + import string + +-from nose.tools import eq_ + import cchardet + + SKIP_LIST = [ +@@ -26,14 +25,11 @@ SKIP_LIST_02.extend(SKIP_LIST) + class TestCChardet(): + def test_ascii(self): + detected_encoding = cchardet.detect(b'abcdefghijklmnopqrstuvwxyz') +- eq_( +- 'ascii', +- detected_encoding['encoding'].lower(), ++ assert 'ascii' == detected_encoding['encoding'].lower(), \ + 'Expected %s, but got %s' % ( + 'ascii', + detected_encoding['encoding'].lower() + ) +- ) + + def test_detect(self): + testfiles = glob.glob('tests/testdata/*/*.txt') +@@ -46,15 +42,13 @@ class TestCChardet(): + with open(testfile, 'rb') as f: + msg = f.read() + detected_encoding = cchardet.detect(msg) +- eq_( +- expected_charset.lower(), +- detected_encoding['encoding'].lower(), ++ assert expected_charset.lower() == \ ++ detected_encoding['encoding'].lower(), \ + 'Expected %s, but got %s for "%s"' % ( + expected_charset.lower(), + detected_encoding['encoding'].lower(), + testfile + ) +- ) + + def test_detector(self): + detector = cchardet.UniversalDetector() +@@ -67,14 +61,11 @@ class TestCChardet(): + line = f.readline() + detector.close() + detected_encoding = detector.result +- eq_( +- "shift_jis", +- detected_encoding['encoding'].lower(), ++ assert "shift_jis" == detected_encoding['encoding'].lower(), \ + 'Expected %s, but got %s' % ( + "shift_jis", + detected_encoding['encoding'].lower() + ) +- ) + + def test_github_issue_20(self): + """ +@@ -109,37 +100,28 @@ class TestCChardet(): + def test_utf8_with_bom(self): + sample = b'\xEF\xBB\xBF' + detected_encoding = cchardet.detect(sample) +- eq_( +- "utf-8-sig", +- detected_encoding['encoding'].lower(), ++ assert "utf-8-sig" == detected_encoding['encoding'].lower(), \ + 'Expected %s, but got %s' % ( + "utf-8-sig", + detected_encoding['encoding'].lower() + ) +- ) + + def test_null_bytes(self): + sample = b'ABC\x00\x80\x81' + detected_encoding = cchardet.detect(sample) + +- eq_( +- None, +- detected_encoding['encoding'], ++ assert detected_encoding['encoding'] is None, \ + 'Expected None, but got %s' % ( + detected_encoding['encoding'] + ) +- ) + + # def test_iso8859_2_csv(self): + # testfile = 'tests/samples/iso8859-2.csv' + # with open(testfile, 'rb') as f: + # msg = f.read() + # detected_encoding = cchardet.detect(msg) +- # eq_( +- # "iso8859-2", +- # detected_encoding['encoding'].lower(), ++ # assert "iso8859-2" == detected_encoding['encoding'].lower(), \ + # 'Expected %s, but got %s' % ( + # "iso8859-2", + # detected_encoding['encoding'].lower() + # ) +- # ) diff --git a/python-cchardet.changes b/python-cchardet.changes index 512344b..6b9fb50 100644 --- a/python-cchardet.changes +++ b/python-cchardet.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Feb 21 07:47:56 UTC 2023 - Matej Cepl + +- Add denose.patch () and enable tests. + +------------------------------------------------------------------- +Tue Feb 21 07:27:48 UTC 2023 - Matej Cepl + +- Clean up SPEC file + ------------------------------------------------------------------- Mon Feb 20 13:12:19 UTC 2023 - ecsos diff --git a/python-cchardet.spec b/python-cchardet.spec index 4416f82..9c1e705 100644 --- a/python-cchardet.spec +++ b/python-cchardet.spec @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-cchardet Version: 2.1.7 @@ -25,9 +24,14 @@ Summary: CChardet is high speed universal character encoding detector License: GPL-2.0-or-later OR LGPL-2.1-or-later OR MPL-1.1 URL: https://github.com/PyYoshi/cChardet Source: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz +# PATCH-FIX-UPSTREAM denose.patch bsc#[0-9]+ mcepl@suse.com +# Remove dependency on nose +Patch0: denose.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -41,16 +45,20 @@ Requires(postun):update-alternatives cChardet is high speed universal character encoding detector. - binding to `uchardet`_. %prep -%setup -q -n cchardet-%{version} +%autosetup -p1 -n cchardet-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/cchardetect %python_expand %fdupes %{buildroot}%{$python_sitearch} +%check +cd src +%pytest_arch tests/test.py + %post %python_install_alternative cchardetect @@ -61,6 +69,7 @@ cChardet is high speed universal character encoding detector. - binding to `ucha %license COPYING %doc README.rst %python_alternative %{_bindir}/cchardetect -%{python_sitearch}/* +%{python_sitearch}/cchardet +%{python_sitearch}/cchardet-%{version}*-info %changelog From f041c1406e113280b7b25a2723ee539c27fb2b231dcd4b26765e03692aa8a58f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 21 Feb 2023 08:31:12 +0000 Subject: [PATCH 3/4] - Add denose.patch (gh#PyYoshi/cChardet!87) and enable tests. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cchardet?expand=0&rev=14 --- python-cchardet.changes | 2 +- python-cchardet.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python-cchardet.changes b/python-cchardet.changes index 6b9fb50..8430aae 100644 --- a/python-cchardet.changes +++ b/python-cchardet.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Feb 21 07:47:56 UTC 2023 - Matej Cepl -- Add denose.patch () and enable tests. +- Add denose.patch (gh#PyYoshi/cChardet!87) and enable tests. ------------------------------------------------------------------- Tue Feb 21 07:27:48 UTC 2023 - Matej Cepl diff --git a/python-cchardet.spec b/python-cchardet.spec index 9c1e705..a29a897 100644 --- a/python-cchardet.spec +++ b/python-cchardet.spec @@ -24,7 +24,7 @@ Summary: CChardet is high speed universal character encoding detector License: GPL-2.0-or-later OR LGPL-2.1-or-later OR MPL-1.1 URL: https://github.com/PyYoshi/cChardet Source: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz -# PATCH-FIX-UPSTREAM denose.patch bsc#[0-9]+ mcepl@suse.com +# PATCH-FIX-UPSTREAM denose.patch gh#PyYoshi/cChardet!87 mcepl@suse.com # Remove dependency on nose Patch0: denose.patch BuildRequires: %{python_module Cython} From 72c5f0ef3a81397bbec097a812bfe9d2821008fd1141717b2700e192f0d4d368 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 26 Feb 2023 19:58:29 +0000 Subject: [PATCH 4/4] Accepting request 1067842 from home:mcepl:branches:devel:languages:python - Upstream became stale, switching to the fork https://github.com/faust-streaming/cChardet - Update to 2.1.18: - Fix building source distribution - Fix pep517 builds - Time to continue off where the original project left off! - Support Python 3.10 + 3.11 - Add linux aarch64 wheel support - Removed upstreamed denose.patch OBS-URL: https://build.opensuse.org/request/show/1067842 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cchardet?expand=0&rev=15 --- cchardet-2.1.7.tar.gz | 3 - denose.patch | 125 ----------------------------------- faust-cchardet-2.1.18.tar.gz | 3 + python-cchardet.changes | 13 ++++ python-cchardet.spec | 17 ++--- 5 files changed, 23 insertions(+), 138 deletions(-) delete mode 100644 cchardet-2.1.7.tar.gz delete mode 100644 denose.patch create mode 100644 faust-cchardet-2.1.18.tar.gz diff --git a/cchardet-2.1.7.tar.gz b/cchardet-2.1.7.tar.gz deleted file mode 100644 index 6093477..0000000 --- a/cchardet-2.1.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c428b6336545053c2589f6caf24ea32276c6664cb86db817e03a94c60afa0eaf -size 653617 diff --git a/denose.patch b/denose.patch deleted file mode 100644 index 918da1c..0000000 --- a/denose.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- - requirements-dev.txt | 1 - - setup.cfg | 4 ---- - src/tests/test.py | 32 +++++++------------------------- - 3 files changed, 7 insertions(+), 30 deletions(-) - ---- a/requirements-dev.txt -+++ b/requirements-dev.txt -@@ -1,5 +1,4 @@ - chardet==3.0.4 --nose==1.3.7 - tox==3.20.1 - Cython==0.29.21 - # pylint==2.6.0 ---- a/setup.cfg -+++ b/setup.cfg -@@ -1,7 +1,3 @@ --[nosetests] --verbose = 1 --nocapture = 1 -- - [egg_info] - tag_build = - tag_date = 0 ---- a/src/tests/test.py -+++ b/src/tests/test.py -@@ -3,7 +3,6 @@ import glob - import os - import string - --from nose.tools import eq_ - import cchardet - - SKIP_LIST = [ -@@ -26,14 +25,11 @@ SKIP_LIST_02.extend(SKIP_LIST) - class TestCChardet(): - def test_ascii(self): - detected_encoding = cchardet.detect(b'abcdefghijklmnopqrstuvwxyz') -- eq_( -- 'ascii', -- detected_encoding['encoding'].lower(), -+ assert 'ascii' == detected_encoding['encoding'].lower(), \ - 'Expected %s, but got %s' % ( - 'ascii', - detected_encoding['encoding'].lower() - ) -- ) - - def test_detect(self): - testfiles = glob.glob('tests/testdata/*/*.txt') -@@ -46,15 +42,13 @@ class TestCChardet(): - with open(testfile, 'rb') as f: - msg = f.read() - detected_encoding = cchardet.detect(msg) -- eq_( -- expected_charset.lower(), -- detected_encoding['encoding'].lower(), -+ assert expected_charset.lower() == \ -+ detected_encoding['encoding'].lower(), \ - 'Expected %s, but got %s for "%s"' % ( - expected_charset.lower(), - detected_encoding['encoding'].lower(), - testfile - ) -- ) - - def test_detector(self): - detector = cchardet.UniversalDetector() -@@ -67,14 +61,11 @@ class TestCChardet(): - line = f.readline() - detector.close() - detected_encoding = detector.result -- eq_( -- "shift_jis", -- detected_encoding['encoding'].lower(), -+ assert "shift_jis" == detected_encoding['encoding'].lower(), \ - 'Expected %s, but got %s' % ( - "shift_jis", - detected_encoding['encoding'].lower() - ) -- ) - - def test_github_issue_20(self): - """ -@@ -109,37 +100,28 @@ class TestCChardet(): - def test_utf8_with_bom(self): - sample = b'\xEF\xBB\xBF' - detected_encoding = cchardet.detect(sample) -- eq_( -- "utf-8-sig", -- detected_encoding['encoding'].lower(), -+ assert "utf-8-sig" == detected_encoding['encoding'].lower(), \ - 'Expected %s, but got %s' % ( - "utf-8-sig", - detected_encoding['encoding'].lower() - ) -- ) - - def test_null_bytes(self): - sample = b'ABC\x00\x80\x81' - detected_encoding = cchardet.detect(sample) - -- eq_( -- None, -- detected_encoding['encoding'], -+ assert detected_encoding['encoding'] is None, \ - 'Expected None, but got %s' % ( - detected_encoding['encoding'] - ) -- ) - - # def test_iso8859_2_csv(self): - # testfile = 'tests/samples/iso8859-2.csv' - # with open(testfile, 'rb') as f: - # msg = f.read() - # detected_encoding = cchardet.detect(msg) -- # eq_( -- # "iso8859-2", -- # detected_encoding['encoding'].lower(), -+ # assert "iso8859-2" == detected_encoding['encoding'].lower(), \ - # 'Expected %s, but got %s' % ( - # "iso8859-2", - # detected_encoding['encoding'].lower() - # ) -- # ) diff --git a/faust-cchardet-2.1.18.tar.gz b/faust-cchardet-2.1.18.tar.gz new file mode 100644 index 0000000..44362b9 --- /dev/null +++ b/faust-cchardet-2.1.18.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d374eecad23c68383e549c83e90b16788bde6b0354fd5ece4020b046df5a7c7e +size 655620 diff --git a/python-cchardet.changes b/python-cchardet.changes index 8430aae..d822ba5 100644 --- a/python-cchardet.changes +++ b/python-cchardet.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Feb 26 19:06:23 UTC 2023 - Matej Cepl + +- Upstream became stale, switching to the fork + https://github.com/faust-streaming/cChardet +- Update to 2.1.18: + - Fix building source distribution + - Fix pep517 builds + - Time to continue off where the original project left off! + - Support Python 3.10 + 3.11 + - Add linux aarch64 wheel support +- Removed upstreamed denose.patch + ------------------------------------------------------------------- Tue Feb 21 07:47:56 UTC 2023 - Matej Cepl diff --git a/python-cchardet.spec b/python-cchardet.spec index a29a897..74bbee6 100644 --- a/python-cchardet.spec +++ b/python-cchardet.spec @@ -17,16 +17,14 @@ %define skip_python2 1 +%define modname faust-cchardet Name: python-cchardet -Version: 2.1.7 +Version: 2.1.18 Release: 0 Summary: CChardet is high speed universal character encoding detector License: GPL-2.0-or-later OR LGPL-2.1-or-later OR MPL-1.1 -URL: https://github.com/PyYoshi/cChardet -Source: https://files.pythonhosted.org/packages/source/c/cchardet/cchardet-%{version}.tar.gz -# PATCH-FIX-UPSTREAM denose.patch gh#PyYoshi/cChardet!87 mcepl@suse.com -# Remove dependency on nose -Patch0: denose.patch +URL: https://github.com/faust-streaming/cChardet +Source: https://files.pythonhosted.org/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} @@ -45,7 +43,7 @@ Requires(postun):update-alternatives cChardet is high speed universal character encoding detector. - binding to `uchardet`_. %prep -%autosetup -p1 -n cchardet-%{version} +%autosetup -p1 -n %{modname}-%{version} %build %pyproject_wheel @@ -56,8 +54,7 @@ cChardet is high speed universal character encoding detector. - binding to `ucha %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -cd src -%pytest_arch tests/test.py +%pytest_arch src/tests %post %python_install_alternative cchardetect @@ -70,6 +67,6 @@ cd src %doc README.rst %python_alternative %{_bindir}/cchardetect %{python_sitearch}/cchardet -%{python_sitearch}/cchardet-%{version}*-info +%{python_sitearch}/%(echo %{modname}|tr '-' '_')-%{version}*-info %changelog