14
0

- Repackage back to plain 2.3.0 tarball with appropriate patches:

* docs_to_tarball_tests_pass_py2k.patch (gh#pyparsing/pyparsing#47)
    * pass_unitTests.patch (gh#pyparsing/pyparsing#63)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=54
This commit is contained in:
2019-01-08 14:07:22 +00:00
committed by Git OBS Bridge
parent 0a12b50e88
commit 046202169a
7 changed files with 4339 additions and 48 deletions

View File

@@ -30,21 +30,27 @@ Name: python-pyparsing-%{flavor}
%else
Name: python-pyparsing
%endif
Version: 2.3.1~test5
Version: 2.3.0
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
Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz
# Make tests passing, gh#pyparsing/pyparsing#47
Patch0: docs_to_tarball_tests_pass_py2k.patch
# Fix unitTests.py to pass, gh#pyparsing/pyparsing#63
Patch1: pass_unitTests.patch
# Remove dependency on nose, gh#pyparsing/pyparsing#64
Patch: nose_to_unittest.patch
Patch2: nose_to_unittest.patch
BuildRequires: %{python_module base}
# Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%%{version}.tar.gz
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
# do not add dependencies on setuptools and ideally not even full "python";
# this is now a dependency of setuptools
Requires: python-base
@@ -63,8 +69,9 @@ 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
sed -i -e 's/\r$//' README.md CHANGES
%build
%python_build
@@ -81,18 +88,17 @@ cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py%
%check
%if %{with test}
export PYTHONPATH=.:example
%{python_expand export PYTHONPATH=.:example
# 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
%{$python} -munittest2 -v simple_unit_tests.py examples.test_bibparse examples.antlr_grammar_tests
%{$python} unitTests.py
}
%endif
%files %{python_files}
%if ! %{with test}
%license LICENSE
%doc CHANGES README.rst
%doc CHANGES README.md
%{python_sitelib}/pyparsing.py*
%pycache_only %{python_sitelib}/__pycache__/*
%{python_sitelib}/pyparsing-%{version}-py*.egg-info/