Compare commits
No commits in common. "c8s" and "c9-beta" have entirely different histories.
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,7 +1 @@
|
|||||||
artifacts/
|
SOURCES/pyenchant-3.2.0.tar.gz
|
||||||
pyenchant-1.3.1.tar.gz
|
|
||||||
/pyenchant-1.6.5.tar.gz
|
|
||||||
/pyenchant-1.6.6.tar.gz
|
|
||||||
/pyenchant-1.6.8.tar.gz
|
|
||||||
/pyenchant-1.6.10.tar.gz
|
|
||||||
/pyenchant-2.0.0.tar.gz
|
|
||||||
|
1
.python-enchant.metadata
Normal file
1
.python-enchant.metadata
Normal file
@ -0,0 +1 @@
|
|||||||
|
d2a88525257d43c5c0e512fc4f5b7871459b42c9 SOURCES/pyenchant-3.2.0.tar.gz
|
@ -3,16 +3,9 @@
|
|||||||
%global enchant_dep enchant >= 1.5.0
|
%global enchant_dep enchant >= 1.5.0
|
||||||
%global srcname enchant
|
%global srcname enchant
|
||||||
|
|
||||||
%if 0%{?rhel} > 7
|
|
||||||
# Disable python2 build by default
|
|
||||||
%bcond_with python2
|
|
||||||
%else
|
|
||||||
%bcond_without python2
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Name: python-enchant
|
Name: python-enchant
|
||||||
Version: 2.0.0
|
Version: 3.2.0
|
||||||
Release: 3%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: Python bindings for Enchant spellchecking library
|
Summary: Python bindings for Enchant spellchecking library
|
||||||
|
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
@ -26,33 +19,12 @@ BuildRequires: enchant-devel
|
|||||||
PyEnchant is a spellchecking library for Python, based on the Enchant
|
PyEnchant is a spellchecking library for Python, based on the Enchant
|
||||||
library by Dom Lachowicz.
|
library by Dom Lachowicz.
|
||||||
|
|
||||||
%if %{with python2}
|
|
||||||
%package -n python2-%{srcname}
|
|
||||||
Summary: Python 2 bindings for Enchant spellchecking library
|
|
||||||
|
|
||||||
BuildRequires: python2-devel
|
|
||||||
BuildRequires: python2-setuptools
|
|
||||||
# For running tests
|
|
||||||
BuildRequires: python2-nose
|
|
||||||
|
|
||||||
Requires: %{enchant_dep}
|
|
||||||
|
|
||||||
Provides: PyEnchant
|
|
||||||
|
|
||||||
%{?python_provide:%python_provide python2-%{srcname}}
|
|
||||||
|
|
||||||
%description -n python2-%{srcname}
|
|
||||||
PyEnchant is a spellchecking library for Python 2, based on the Enchant
|
|
||||||
library by Dom Lachowicz.
|
|
||||||
%endif # with python2
|
|
||||||
|
|
||||||
%package -n python3-%{srcname}
|
%package -n python3-%{srcname}
|
||||||
Summary: Python 3 bindings for Enchant spellchecking library
|
Summary: Python 3 bindings for Enchant spellchecking library
|
||||||
|
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
# For running tests
|
|
||||||
BuildRequires: python3-nose
|
|
||||||
|
|
||||||
Requires: %{enchant_dep}
|
Requires: %{enchant_dep}
|
||||||
|
|
||||||
@ -67,64 +39,25 @@ library by Dom Lachowicz.
|
|||||||
# Remove bundled egg-info
|
# Remove bundled egg-info
|
||||||
rm -rf py%{srcname}.egg-info
|
rm -rf py%{srcname}.egg-info
|
||||||
|
|
||||||
rm -rf %{py3dir}
|
find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||||
cp -a . %{py3dir}
|
|
||||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{with python2}
|
%py3_build
|
||||||
CFLAGS="$RPM_OPT_FLAGS" %py2_build
|
|
||||||
%endif # with python2
|
|
||||||
|
|
||||||
pushd %{py3dir}
|
|
||||||
CFLAGS="$RPM_OPT_FLAGS" %py3_build
|
|
||||||
popd
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd %{py3dir}
|
%py3_install
|
||||||
%py3_install \
|
|
||||||
--single-version-externally-managed
|
|
||||||
# Directories used in windows build
|
# Directories used in windows build
|
||||||
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/lib
|
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/lib
|
||||||
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/share
|
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/share
|
||||||
popd
|
|
||||||
%if %{with python2}
|
|
||||||
%py2_install \
|
|
||||||
--single-version-externally-managed
|
|
||||||
# Directories used in windows build
|
|
||||||
rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/lib
|
|
||||||
rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/share
|
|
||||||
%endif # with python2
|
|
||||||
|
|
||||||
%check
|
|
||||||
%if %{with python2}
|
|
||||||
pushd $RPM_BUILD_ROOT/%{python2_sitelib}
|
|
||||||
# There is no dictionary for language C, need to use en_US
|
|
||||||
LANG=en_US.UTF-8 /usr/bin/nosetests-2.*
|
|
||||||
popd
|
|
||||||
%endif # with python2
|
|
||||||
|
|
||||||
pushd $RPM_BUILD_ROOT/%{python3_sitelib}
|
# Tests are not included in the upstream tarball
|
||||||
# There is no dictionary for language C, need to use en_US
|
#%%check
|
||||||
LANG=en_US.UTF-8 /usr/bin/nosetests-3.*
|
|
||||||
popd
|
|
||||||
|
|
||||||
%if %{with python2}
|
|
||||||
%files -n python2-%{srcname}
|
|
||||||
%doc README.txt TODO.txt
|
|
||||||
%license LICENSE.txt
|
|
||||||
%dir %{python2_sitelib}/%{srcname}
|
|
||||||
%dir %{python2_sitelib}/%{srcname}/checker
|
|
||||||
%dir %{python2_sitelib}/%{srcname}/tokenize
|
|
||||||
%{python2_sitelib}/%{srcname}/*.py
|
|
||||||
%{python2_sitelib}/%{srcname}/*.py[co]
|
|
||||||
%{python2_sitelib}/%{srcname}/*/*.py
|
|
||||||
%{python2_sitelib}/%{srcname}/*/*.py[co]
|
|
||||||
%{python2_sitelib}/py%{srcname}-%{version}-py?.?.egg-info
|
|
||||||
%endif # with python2
|
|
||||||
|
|
||||||
%files -n python3-%{srcname}
|
%files -n python3-%{srcname}
|
||||||
%doc README.txt TODO.txt
|
%doc README.rst
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%dir %{python3_sitelib}/%{srcname}
|
%dir %{python3_sitelib}/%{srcname}
|
||||||
%dir %{python3_sitelib}/%{srcname}/__pycache__
|
%dir %{python3_sitelib}/%{srcname}/__pycache__
|
||||||
@ -138,10 +71,64 @@ popd
|
|||||||
%{python3_sitelib}/%{srcname}/checker/__pycache__/*.py[co]
|
%{python3_sitelib}/%{srcname}/checker/__pycache__/*.py[co]
|
||||||
%{python3_sitelib}/%{srcname}/tokenize/*.py
|
%{python3_sitelib}/%{srcname}/tokenize/*.py
|
||||||
%{python3_sitelib}/%{srcname}/tokenize/__pycache__/*.py[co]
|
%{python3_sitelib}/%{srcname}/tokenize/__pycache__/*.py[co]
|
||||||
%{python3_sitelib}/py%{srcname}-%{version}-py?.?.egg-info
|
%{python3_sitelib}/py%{srcname}-%{version}-py%{python3_version}.egg-info
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 3.2.0-5
|
||||||
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||||
|
Related: rhbz#1991688
|
||||||
|
|
||||||
|
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.2.0-4
|
||||||
|
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||||
|
|
||||||
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jan 20 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.2.0-2
|
||||||
|
- Drop dependency on python-nose as tests are not included
|
||||||
|
|
||||||
|
* Wed Dec 09 2020 Charalampos Stratakis <cstratak@redhat.com> - 3.2.0-1
|
||||||
|
- Update to 3.2.0 (rhbz#1905482)
|
||||||
|
|
||||||
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jun 01 2020 Charalampos Stratakis <cstratak@redhat.com> - 3.1.1-1
|
||||||
|
- Update to version 3.1.1 (rhbz#1837989)
|
||||||
|
|
||||||
|
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.1-2
|
||||||
|
- Rebuilt for Python 3.9
|
||||||
|
|
||||||
|
* Wed Mar 18 2020 Charalampos Stratakis <cstratak@redhat.com> - 3.0.1-1
|
||||||
|
- Update to version 3.0.1 (rhbz#1794914)
|
||||||
|
|
||||||
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-11
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Sep 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-10
|
||||||
|
- Subpackage python2-enchant has been removed
|
||||||
|
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||||
|
|
||||||
|
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-9
|
||||||
|
- Rebuilt for Python 3.8
|
||||||
|
|
||||||
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.0.0-6
|
||||||
|
- Drop explicit locale setting for python3, use C.UTF-8 for python2
|
||||||
|
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
|
||||||
|
|
||||||
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-4
|
||||||
|
- Rebuilt for Python 3.7
|
||||||
|
|
||||||
* Thu Mar 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.0.0-3
|
* Thu Mar 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.0.0-3
|
||||||
- Conditionalize the python2 subpackage
|
- Conditionalize the python2 subpackage
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
--- !Policy
|
|
||||||
product_versions:
|
|
||||||
- rhel-8
|
|
||||||
decision_context: osci_compose_gate
|
|
||||||
rules:
|
|
||||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
|
1
sources
1
sources
@ -1 +0,0 @@
|
|||||||
SHA512 (pyenchant-2.0.0.tar.gz) = c985714bc8ad69b6580fa1dd546243da5f3f92e8681d846ed265b086c486ae7ed33754fba303b450be4c0cb20e975a9a10efbeb700ea5213a11ed00612a93af0
|
|
@ -1,3 +0,0 @@
|
|||||||
cantle
|
|
||||||
estivation
|
|
||||||
activation
|
|
@ -1,80 +0,0 @@
|
|||||||
import enchant
|
|
||||||
from enchant.checker import SpellChecker
|
|
||||||
from enchant.tokenize import (get_tokenizer, HTMLChunker, EmailFilter)
|
|
||||||
import unittest
|
|
||||||
import sys
|
|
||||||
|
|
||||||
class TestPyenchant(unittest.TestCase):
|
|
||||||
|
|
||||||
def test_check_dict(self):
|
|
||||||
d = enchant.Dict("en_US")
|
|
||||||
self.assertEqual(d.tag, 'en_US')
|
|
||||||
# invalid test string
|
|
||||||
result = d.check("こんにちは")
|
|
||||||
self.assertFalse(result)
|
|
||||||
# valid test sting
|
|
||||||
result = d.check("Hello")
|
|
||||||
self.assertTrue(result)
|
|
||||||
|
|
||||||
def test_dict_exist(self):
|
|
||||||
# invalid locale
|
|
||||||
result = enchant.dict_exists("de_kk")
|
|
||||||
self.assertFalse(result)
|
|
||||||
# valid locale
|
|
||||||
result = enchant.dict_exists("en_US")
|
|
||||||
self.assertTrue(result)
|
|
||||||
|
|
||||||
|
|
||||||
def test_suggestion(self):
|
|
||||||
d = enchant.Dict("en_US")
|
|
||||||
# valid string sugesstion
|
|
||||||
result = d.suggest("Hello")
|
|
||||||
self.assertGreater(len(result),0)
|
|
||||||
# invalid string sugesstion
|
|
||||||
result = d.suggest("こんにちは")
|
|
||||||
self.assertEqual(len(result), 0)
|
|
||||||
|
|
||||||
|
|
||||||
def test_personal_word_list(self):
|
|
||||||
d = enchant.DictWithPWL("en_US", "mywords.txt")
|
|
||||||
|
|
||||||
result = d.check("estivation")
|
|
||||||
self.assertTrue(result)
|
|
||||||
|
|
||||||
suggestion_list = d.suggest('estivateion')
|
|
||||||
self.assertIn("estivation", suggestion_list)
|
|
||||||
|
|
||||||
|
|
||||||
def test_check_entire_block(self):
|
|
||||||
chkr = SpellChecker("en_US")
|
|
||||||
chkr.set_text("This is erors text.")
|
|
||||||
errorlist = list()
|
|
||||||
for err in chkr:
|
|
||||||
errorlist.append(err.word)
|
|
||||||
self.assertIn("erors", errorlist)
|
|
||||||
|
|
||||||
|
|
||||||
def test_tokenization(self):
|
|
||||||
tknzr = get_tokenizer("en_US")
|
|
||||||
tknzr_list = [word for word in tknzr("Hello world")]
|
|
||||||
self.assertEqual(tknzr_list, [('Hello', 0), ('world', 6)])
|
|
||||||
|
|
||||||
|
|
||||||
def test_chunkers(self):
|
|
||||||
tknzr = get_tokenizer("en_US",chunkers=(HTMLChunker,))
|
|
||||||
tknzr_list = [w for w in tknzr("Hello <span class='important'>World</span>")]
|
|
||||||
self.assertEqual(tknzr_list ,[('Hello', 0), ('World', 30)])
|
|
||||||
|
|
||||||
|
|
||||||
# logger function
|
|
||||||
def main(out = sys.stderr, verbosity = 2):
|
|
||||||
loader = unittest.TestLoader()
|
|
||||||
suite = loader.loadTestsFromModule(sys.modules[__name__])
|
|
||||||
unittest.TextTestRunner(out, verbosity = verbosity).run(suite)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
test_log_path = sys.argv[1] if len(sys.argv)>1 else "test.log"
|
|
||||||
with open(test_log_path, 'w') as f:
|
|
||||||
main(f)
|
|
||||||
|
|
||||||
# unittest.main()
|
|
@ -1,34 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
vars:
|
|
||||||
config:
|
|
||||||
packagename: enchant
|
|
||||||
testfilename: test_pyenchant.py
|
|
||||||
logfilepath: /tmp/test.log
|
|
||||||
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
|
|
||||||
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
|
|
||||||
remote_user: root
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: Install required package
|
|
||||||
dnf:
|
|
||||||
name:
|
|
||||||
- python3
|
|
||||||
- langpacks-en
|
|
||||||
- "python3-{{ config.packagename }}"
|
|
||||||
|
|
||||||
- name: Test Execution
|
|
||||||
block:
|
|
||||||
- name: Execute the tests
|
|
||||||
command: python3 {{ config.testfilename }} "{{ config.logfilepath }}"
|
|
||||||
|
|
||||||
always:
|
|
||||||
- name: Pull out the artifacts
|
|
||||||
fetch:
|
|
||||||
dest: "{{ config.artifacts }}/"
|
|
||||||
src: "{{ item }}"
|
|
||||||
flat: yes
|
|
||||||
with_items:
|
|
||||||
- "{{ config.logfilepath }}"
|
|
Loading…
Reference in New Issue
Block a user