2010-05-28 15:53:25 +00:00
|
|
|
#
|
2021-12-17 23:47:46 +00:00
|
|
|
# spec file
|
2010-05-28 15:53:25 +00:00
|
|
|
#
|
- update to 5.1.0:
* Add should_rename_legacy argument to most functions, which will rename
older encodings to their more modern equivalents (e.g., GB2312 becomes
GB18030) (#264, @dan-blanchard)
* Add capital letter sharp S and ISO-8859-15 support
* Add a prober for MacRoman encoding
* Add --minimal flag to chardetect command
* Add type annotations to the project and run mypy on CI
* Add support for Python 3.11
* Clarify LGPL version in License trove classifier (#255, @musicinmybrain)
* Remove support for EOL Python 3.6 (#260, @jdufresne)
* Remove unnecessary guards for non-falsey values (#259, @jdufresne)
* Switch to Python 3.10 release in GitHub actions (#257, @jdufresne)
* Remove setup.py in favor of build package (#262, @jdufresne)
* Run tests on macos, Windows, and 3.11-dev (#267, @dan-blanchard)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=53
2023-01-02 18:46:05 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2010-05-28 15:53:25 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2011-03-31 13:52:52 +00:00
|
|
|
|
2018-12-04 13:33:45 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-05-28 15:53:25 +00:00
|
|
|
#
|
2012-07-27 15:15:35 +00:00
|
|
|
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2021-11-05 14:06:48 +00:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2019-02-26 08:19:35 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
Accepting request 987203 from home:bnavigator:branches:devel:languages:python
- Update to 5.0.0
* This release is the first release of chardet that no longer
supports Python < 3.6
* Added a prober for Johab Korean (#207, @grizlupo)
* Added a prober for UTF-16/32 BE/LE (#109, #206, @jpz)
* Added test data for Croatian, Czech, Hungarian, Polish, Slovak,
Slovene, Greek, and Turkish, which should help prevent future
errors with those languages
* Improved XML tag filtering, which should improve accuracy for
XML files (#208)
* Tweaked SingleByteCharSetProber confidence to match latest
uchardet (#209)
* Made detect_all return child prober confidences (#210)
* Updated examples in docs (#223, @domdfcoding)
* Documentation fixes (#212, #224, #225, #226, #220, #221, #244
from too many to mention)
* Minor performance improvements (#252, @deedy5)
* Add support for Python 3.10 when testing (#232, @jdufresne)
* Lots of little development cycle improvements, mostly thanks to
@jdufresne
- Canonicalize alternatives creation
OBS-URL: https://build.opensuse.org/request/show/987203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=51
2022-07-11 09:41:02 +00:00
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
|
|
|
%define skip_python2 1
|
2023-01-16 21:14:34 +00:00
|
|
|
%define skip_python36 1
|
2023-04-21 15:12:10 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2019-02-26 08:19:35 +00:00
|
|
|
Name: python-chardet%{psuffix}
|
2023-09-04 16:05:19 +00:00
|
|
|
Version: 5.2.0
|
2011-12-08 11:57:36 +00:00
|
|
|
Release: 0
|
2011-03-31 13:52:43 +00:00
|
|
|
Summary: Universal encoding detector
|
2018-12-04 13:33:45 +00:00
|
|
|
License: LGPL-2.1-or-later
|
2018-12-04 17:15:06 +00:00
|
|
|
URL: https://github.com/chardet/chardet
|
2017-09-20 21:59:11 +00:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/c/chardet/chardet-%{version}.tar.gz
|
2023-01-16 21:14:34 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
- update to 5.1.0:
* Add should_rename_legacy argument to most functions, which will rename
older encodings to their more modern equivalents (e.g., GB2312 becomes
GB18030) (#264, @dan-blanchard)
* Add capital letter sharp S and ISO-8859-15 support
* Add a prober for MacRoman encoding
* Add --minimal flag to chardetect command
* Add type annotations to the project and run mypy on CI
* Add support for Python 3.11
* Clarify LGPL version in License trove classifier (#255, @musicinmybrain)
* Remove support for EOL Python 3.6 (#260, @jdufresne)
* Remove unnecessary guards for non-falsey values (#259, @jdufresne)
* Switch to Python 3.10 release in GitHub actions (#257, @jdufresne)
* Remove setup.py in favor of build package (#262, @jdufresne)
* Run tests on macos, Windows, and 3.11-dev (#267, @dan-blanchard)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=53
2023-01-02 18:46:05 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2017-03-20 14:35:26 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
- update to 5.1.0:
* Add should_rename_legacy argument to most functions, which will rename
older encodings to their more modern equivalents (e.g., GB2312 becomes
GB18030) (#264, @dan-blanchard)
* Add capital letter sharp S and ISO-8859-15 support
* Add a prober for MacRoman encoding
* Add --minimal flag to chardetect command
* Add type annotations to the project and run mypy on CI
* Add support for Python 3.11
* Clarify LGPL version in License trove classifier (#255, @musicinmybrain)
* Remove support for EOL Python 3.6 (#260, @jdufresne)
* Remove unnecessary guards for non-falsey values (#259, @jdufresne)
* Switch to Python 3.10 release in GitHub actions (#257, @jdufresne)
* Remove setup.py in favor of build package (#262, @jdufresne)
* Run tests on macos, Windows, and 3.11-dev (#267, @dan-blanchard)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=53
2023-01-02 18:46:05 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2017-03-20 14:35:26 +00:00
|
|
|
BuildRequires: fdupes
|
2021-11-05 14:06:48 +00:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: alts
|
|
|
|
Requires: alts
|
|
|
|
%else
|
2017-09-20 21:58:26 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-12-17 23:47:46 +00:00
|
|
|
Requires(postun):update-alternatives
|
2021-11-05 14:06:48 +00:00
|
|
|
%endif
|
2018-12-04 17:15:06 +00:00
|
|
|
BuildArch: noarch
|
2019-02-26 08:19:35 +00:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module hypothesis}
|
2021-12-17 23:47:46 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2019-02-26 08:19:35 +00:00
|
|
|
%endif
|
2017-03-20 14:35:26 +00:00
|
|
|
%python_subpackages
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
%description
|
2011-03-31 13:52:43 +00:00
|
|
|
Universal character encoding detector
|
|
|
|
-------------------------------------
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2011-03-31 13:52:43 +00:00
|
|
|
Detects
|
|
|
|
- ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
|
|
|
|
- Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
|
|
|
|
- EUC-JP, SHIFT_JIS, ISO-2022-JP (Japanese)
|
|
|
|
- EUC-KR, ISO-2022-KR (Korean)
|
|
|
|
- KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
|
|
|
|
- ISO-8859-2, windows-1250 (Hungarian)
|
|
|
|
- ISO-8859-5, windows-1251 (Bulgarian)
|
|
|
|
- windows-1252 (English)
|
|
|
|
- ISO-8859-7, windows-1253 (Greek)
|
|
|
|
- ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
|
|
|
|
- TIS-620 (Thai)
|
2010-05-28 15:53:25 +00:00
|
|
|
|
2012-07-27 15:15:35 +00:00
|
|
|
Requires Python 2.1 or later
|
|
|
|
|
|
|
|
Command-line Tool
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
chardet comes with a command-line script which reports on the encodings of one
|
|
|
|
or more files::
|
|
|
|
|
|
|
|
% chardetect.py somefile someotherfile
|
|
|
|
somefile: windows-1252 with confidence 0.5
|
|
|
|
someotherfile: ascii with confidence 1.0
|
|
|
|
|
2010-05-28 15:53:25 +00:00
|
|
|
%prep
|
2012-07-27 15:15:35 +00:00
|
|
|
%setup -q -n chardet-%{version}
|
2020-12-20 13:49:39 +00:00
|
|
|
sed -i '1{/^#!/d}' chardet/lang*model.py chardet/metadata/languages.py
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
%build
|
- update to 5.1.0:
* Add should_rename_legacy argument to most functions, which will rename
older encodings to their more modern equivalents (e.g., GB2312 becomes
GB18030) (#264, @dan-blanchard)
* Add capital letter sharp S and ISO-8859-15 support
* Add a prober for MacRoman encoding
* Add --minimal flag to chardetect command
* Add type annotations to the project and run mypy on CI
* Add support for Python 3.11
* Clarify LGPL version in License trove classifier (#255, @musicinmybrain)
* Remove support for EOL Python 3.6 (#260, @jdufresne)
* Remove unnecessary guards for non-falsey values (#259, @jdufresne)
* Switch to Python 3.10 release in GitHub actions (#257, @jdufresne)
* Remove setup.py in favor of build package (#262, @jdufresne)
* Run tests on macos, Windows, and 3.11-dev (#267, @dan-blanchard)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=53
2023-01-02 18:46:05 +00:00
|
|
|
%pyproject_wheel
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
%install
|
2019-02-26 08:19:35 +00:00
|
|
|
%if !%{with test}
|
- update to 5.1.0:
* Add should_rename_legacy argument to most functions, which will rename
older encodings to their more modern equivalents (e.g., GB2312 becomes
GB18030) (#264, @dan-blanchard)
* Add capital letter sharp S and ISO-8859-15 support
* Add a prober for MacRoman encoding
* Add --minimal flag to chardetect command
* Add type annotations to the project and run mypy on CI
* Add support for Python 3.11
* Clarify LGPL version in License trove classifier (#255, @musicinmybrain)
* Remove support for EOL Python 3.6 (#260, @jdufresne)
* Remove unnecessary guards for non-falsey values (#259, @jdufresne)
* Switch to Python 3.10 release in GitHub actions (#257, @jdufresne)
* Remove setup.py in favor of build package (#262, @jdufresne)
* Run tests on macos, Windows, and 3.11-dev (#267, @dan-blanchard)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=53
2023-01-02 18:46:05 +00:00
|
|
|
%pyproject_install
|
Accepting request 987203 from home:bnavigator:branches:devel:languages:python
- Update to 5.0.0
* This release is the first release of chardet that no longer
supports Python < 3.6
* Added a prober for Johab Korean (#207, @grizlupo)
* Added a prober for UTF-16/32 BE/LE (#109, #206, @jpz)
* Added test data for Croatian, Czech, Hungarian, Polish, Slovak,
Slovene, Greek, and Turkish, which should help prevent future
errors with those languages
* Improved XML tag filtering, which should improve accuracy for
XML files (#208)
* Tweaked SingleByteCharSetProber confidence to match latest
uchardet (#209)
* Made detect_all return child prober confidences (#210)
* Updated examples in docs (#223, @domdfcoding)
* Documentation fixes (#212, #224, #225, #226, #220, #221, #244
from too many to mention)
* Minor performance improvements (#252, @deedy5)
* Add support for Python 3.10 when testing (#232, @jdufresne)
* Lots of little development cycle improvements, mostly thanks to
@jdufresne
- Canonicalize alternatives creation
OBS-URL: https://build.opensuse.org/request/show/987203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=51
2022-07-11 09:41:02 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/chardetect
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-02-26 08:19:35 +00:00
|
|
|
%endif
|
2015-05-18 13:33:30 +00:00
|
|
|
|
|
|
|
%check
|
2019-02-26 08:19:35 +00:00
|
|
|
%if %{with test}
|
Accepting request 987203 from home:bnavigator:branches:devel:languages:python
- Update to 5.0.0
* This release is the first release of chardet that no longer
supports Python < 3.6
* Added a prober for Johab Korean (#207, @grizlupo)
* Added a prober for UTF-16/32 BE/LE (#109, #206, @jpz)
* Added test data for Croatian, Czech, Hungarian, Polish, Slovak,
Slovene, Greek, and Turkish, which should help prevent future
errors with those languages
* Improved XML tag filtering, which should improve accuracy for
XML files (#208)
* Tweaked SingleByteCharSetProber confidence to match latest
uchardet (#209)
* Made detect_all return child prober confidences (#210)
* Updated examples in docs (#223, @domdfcoding)
* Documentation fixes (#212, #224, #225, #226, #220, #221, #244
from too many to mention)
* Minor performance improvements (#252, @deedy5)
* Add support for Python 3.10 when testing (#232, @jdufresne)
* Lots of little development cycle improvements, mostly thanks to
@jdufresne
- Canonicalize alternatives creation
OBS-URL: https://build.opensuse.org/request/show/987203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=51
2022-07-11 09:41:02 +00:00
|
|
|
# https://github.com/chardet/chardet/issues/256
|
|
|
|
donttest="test_detect_all_and_detect_one_should_agree"
|
|
|
|
%pytest -k "not $donttest"
|
2019-02-26 08:19:35 +00:00
|
|
|
%endif
|
2015-05-18 13:33:30 +00:00
|
|
|
|
2019-02-26 08:19:35 +00:00
|
|
|
%if !%{with test}
|
2021-11-05 14:06:48 +00:00
|
|
|
%pre
|
|
|
|
# If libalternatives is used: Removing old update-alternatives entries.
|
|
|
|
%python_libalternatives_reset_alternative chardetect
|
|
|
|
|
2017-08-15 09:57:44 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative chardetect
|
|
|
|
|
|
|
|
%postun
|
2018-05-15 20:43:55 +00:00
|
|
|
%python_uninstall_alternative chardetect
|
2017-08-15 09:57:44 +00:00
|
|
|
|
2017-03-20 14:35:26 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%doc README.rst
|
2017-08-15 09:57:44 +00:00
|
|
|
%python_alternative %{_bindir}/chardetect
|
2017-03-20 14:35:26 +00:00
|
|
|
%{python_sitelib}/chardet
|
Accepting request 987203 from home:bnavigator:branches:devel:languages:python
- Update to 5.0.0
* This release is the first release of chardet that no longer
supports Python < 3.6
* Added a prober for Johab Korean (#207, @grizlupo)
* Added a prober for UTF-16/32 BE/LE (#109, #206, @jpz)
* Added test data for Croatian, Czech, Hungarian, Polish, Slovak,
Slovene, Greek, and Turkish, which should help prevent future
errors with those languages
* Improved XML tag filtering, which should improve accuracy for
XML files (#208)
* Tweaked SingleByteCharSetProber confidence to match latest
uchardet (#209)
* Made detect_all return child prober confidences (#210)
* Updated examples in docs (#223, @domdfcoding)
* Documentation fixes (#212, #224, #225, #226, #220, #221, #244
from too many to mention)
* Minor performance improvements (#252, @deedy5)
* Add support for Python 3.10 when testing (#232, @jdufresne)
* Lots of little development cycle improvements, mostly thanks to
@jdufresne
- Canonicalize alternatives creation
OBS-URL: https://build.opensuse.org/request/show/987203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=51
2022-07-11 09:41:02 +00:00
|
|
|
%{python_sitelib}/chardet-%{version}*-info
|
2019-02-26 08:19:35 +00:00
|
|
|
%endif
|
2010-05-28 15:53:25 +00:00
|
|
|
|
|
|
|
%changelog
|