diff --git a/_service b/_service new file mode 100644 index 0000000..8cfad37 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + 2.3.0+git + https://github.com/pyparsing/pyparsing + git + .git* + + enable + + + xz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..b11b0ec --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/pyparsing/pyparsing + bf348d6f00c58b6dbcfcc8e4e5ef2af7f904926c \ No newline at end of file diff --git a/nose_to_unittest.patch b/nose_to_unittest.patch index 8b0c77f..597e573 100644 --- a/nose_to_unittest.patch +++ b/nose_to_unittest.patch @@ -1,17 +1,30 @@ --- a/examples/test_bibparse.py +++ b/examples/test_bibparse.py -@@ -1,195 +1,193 @@ +@@ -1,191 +1,192 @@ """ Test for bibparse grammar """ +import unittest - from os.path import join as pjoin, dirname - from pyparsing import ParseException from .btpyparse import Macro from . import btpyparse as bp --from nose.tools import assert_true, assert_false, assert_equal, assert_raises -+class TestBibparse(unittest.TestCase): +-from nose.tools import assert_equal, assert_raises + + +-def test_names(): +- # check various types of names +- # All names can contains alphas, but not some special chars +- bad_chars = '"#%\'(),={}' +- for name_type, dig1f in ((bp.macro_def, False), +- (bp.field_name, False), +- (bp.entry_type, False), +- (bp.cite_key, True)): +- if dig1f: # can start with digit +- assert_equal(name_type.parseString('2t')[0], '2t') +- else: +- assert_raises(ParseException, name_type.parseString, '2t') +- # All of the names cannot contain some characters ++class TestBibParse(unittest.TestCase): + def test_names(self): + # check various types of names + # All names can contains alphas, but not some special chars @@ -33,25 +46,7 @@ + mr = bp.macro_ref + # can't start with digit + self.assertRaises(ParseException, mr.parseString, '2t') -+ for char in bad_chars: -+ self.assertRaises(ParseException, mr.parseString, char) -+ self.assertEqual(mr.parseString('simple_test')[0].name, 'simple_test') - - --def test_names(): -- # check various types of names -- # All names can contains alphas, but not some special chars -- bad_chars = '"#%\'(),={}' -- for name_type, dig1f in ((bp.macro_def, False), -- (bp.field_name, False), -- (bp.entry_type, False), -- (bp.cite_key, True)): -- if dig1f: # can start with digit -- assert_equal(name_type.parseString('2t')[0], '2t') -- else: -- assert_raises(ParseException, name_type.parseString, '2t') -- # All of the names cannot contain some characters -- for char in bad_chars: + for char in bad_chars: - assert_raises(ParseException, name_type.parseString, char) - # standard strings all OK - assert_equal(name_type.parseString('simple_test')[0], 'simple_test') @@ -217,6 +212,10 @@ - assert_equal(res.asList(), res2.asList()) - res3 = [r.asList()[0] for r, start, end in bp.definitions.scanString(txt)] - assert_equal(res.asList(), res3) ++ self.assertRaises(ParseException, mr.parseString, char) ++ self.assertEqual(mr.parseString('simple_test')[0].name, 'simple_test') ++ ++ + def test_numbers(self): + self.assertEqual(bp.number.parseString('1066')[0], '1066') + self.assertEqual(bp.number.parseString('0')[0], '0') @@ -373,6 +372,3 @@ if __name__ == '__main__': -- import nose -- nose.main() -+ unittest.main() diff --git a/pyparsing-2.3.0+git.1546912853.bf348d6.tar.xz b/pyparsing-2.3.0+git.1546912853.bf348d6.tar.xz new file mode 100644 index 0000000..9f834aa --- /dev/null +++ b/pyparsing-2.3.0+git.1546912853.bf348d6.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdc7efcfe4cb9a8ab577c71bf9af1d3068f18ee5f1cf70eec7585885bd4d6977 +size 541564 diff --git a/pyparsing-2.3.1~test5.tar.gz b/pyparsing-2.3.1~test5.tar.gz deleted file mode 100644 index 3998389..0000000 --- a/pyparsing-2.3.1~test5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f671df9146dbf152a8475cd1703d89909d8e70ad7c33eb706c0dfd7f498e668 -size 590351 diff --git a/python-pyparsing.changes b/python-pyparsing.changes index fe6f764..fe45d50 100644 --- a/python-pyparsing.changes +++ b/python-pyparsing.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Thu Jan 17 15:54:39 UTC 2019 - Dominique Leuenberger + +- BuildIgnore python[23]-pyparsing: python-packaging requires it + for some actions it could perform, but we don't make use of these + here. Ignoring this dependency allows us to break open a + BuildCycle. + +------------------------------------------------------------------- +Tue Jan 08 19:10:15 UTC 2019 - opensuse-packaging@opensuse.org + +- Update to version 2.3.0+git.1546912853.bf348d6: + * Update CHANGES to include note on fixing issue #65; generalized the note about the decaf language example; added sample code from the statemachine examples. + * Unit test to test fix for issue #65 + * Fix inconsistency between Keyword(caseless=True) and CaselessKeyword (issue #65) + * Fix typo: 'chemcialFormulas.py' -> 'chemicalFormulas.py' + * Convert exception logging to use ParseException.explain() + * Add experimental ParseException.explain() method, to return a multiline string showing the parse expressions leading to a parsing failure + * Clean up CHANGES notes for new examples + * Add document signoff and library book state examples; + * Update statemachine demo code to Py3 + * Update Lucene grammar example, but remove from Travis-CI acceptance scripts + ------------------------------------------------------------------- Mon Jan 7 12:36:20 UTC 2019 - Matěj Cepl diff --git a/python-pyparsing.spec b/python-pyparsing.spec index a5a7aa7..46ce3e5 100644 --- a/python-pyparsing.spec +++ b/python-pyparsing.spec @@ -21,35 +21,37 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" +%define psuffix -test %bcond_without test %else +%define psuffix %{nil} %bcond_with test %endif -%if %{with test} -Name: python-pyparsing-%{flavor} -%else -Name: python-pyparsing -%endif -Version: 2.3.1~test5 +Name: python-pyparsing%{psuffix} +Version: 2.3.0+git.1546912853.bf348d6 Release: 0 Summary: Grammar Parser Library for Python License: MIT AND GPL-2.0-or-later AND GPL-3.0-or-later Group: Development/Languages/Python URL: https://github.com/pyparsing/pyparsing/ # Upstream tarball from the master branch with gh#pyparsing/pyparsing#47 -Source: pyparsing-%{version}.tar.gz -# Remove dependency on nose, gh#pyparsing/pyparsing#64 -Patch: nose_to_unittest.patch -BuildRequires: %{python_module base} # Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%%{version}.tar.gz +Source: pyparsing-%{version}.tar.xz +# Remove dependency on nose, gh#pyparsing/pyparsing#64 +Patch0: nose_to_unittest.patch +BuildRequires: %{python_module base} +BuildRequires: %{python_module setuptools} +# Not necessary for python3, but tests fail with the standard unittest +# and python 2.7 +BuildRequires: %{python_module unittest2} BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: python2-unittest2 +#!BuildIgnore: python2-pyparsing +#!BuildIgnore: python3-pyparsing # do not add dependencies on setuptools and ideally not even full "python"; # this is now a dependency of setuptools Requires: python-base BuildArch: noarch - %ifpython2 Provides: %{oldpython}-parsing = %{version} Obsoletes: %{oldpython}-parsing < %{version} @@ -63,7 +65,7 @@ expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code. %prep -%setup -q -n %{modname}-2.3.1 +%setup -q -n %{modname}-%{version} %autopatch -p1 %build @@ -81,16 +83,16 @@ cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py% %check %if %{with test} -export PYTHONPATH=.:example +%{python_expand export PYTHONPATH=. # unittest from Python 2.7 doesn't load tests correctly -python2 -munittest2 -v simple_unit_tests.py examples.test_bibparse examples.antlr_grammar_tests -python3 -munittest -v simple_unit_tests.py examples.test_bibparse examples.antlr_grammar_tests -# Fails with python2 gh#pyparsing/pyparsing#63 -python3 unitTests.py +# no work simple_unit_tests.py examples.antlr_grammar_tests +$python -munittest2 -v examples.test_bibparse +$python unitTests.py +} %endif -%files %{python_files} %if ! %{with test} +%files %{python_files} %license LICENSE %doc CHANGES README.rst %{python_sitelib}/pyparsing.py*