14
0

- Upgrade to the current upstrem master with additional patches

to make the test suite pass.

- Add all tests.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=44
This commit is contained in:
2018-11-21 16:58:27 +00:00
committed by Git OBS Bridge
parent a9b2b63dae
commit 3899205e0e
6 changed files with 52 additions and 79 deletions

View File

@@ -18,18 +18,26 @@
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-pyparsing
Version: 2.3.0
Version: 2.3.1~test4
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: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz
BuildRequires: %{python_module base}
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python2-unittest2
BuildRequires: python3-Sphinx
BuildRequires: python3-Sphinx
%if %{with test}
BuildRequires: %{python_module nose}
%endif
# do not add dependencies on setuptools and ideally not even full "python";
# this is now a dependency of setuptools
Requires: python-base
@@ -46,27 +54,50 @@ simple grammars, vs. the traditional lex/yacc approach, or the use of regular
expressions. The pyparsing module provides a library of classes that client
code uses to construct the grammar directly in Python code.
%package -n %{name}-docs
Summary: Documentation files for %name
Group: Documentation/Other
%description -n %{name}-docs
HTML Documentation and examples for %name.
%prep
%setup -q -n pyparsing-%{version}
# Fix wrong EOL encoding:
dos2unix CHANGES LICENSE README.md
%setup -q -n pyparsing-2.3.1
%build
%python_build
(cd docs/
make html
)
%install
%if ! %{with test}
%python_install
# ensure egg-info is a directory
%{python_expand rm %{buildroot}%{$python_sitelib}/*.egg-info
%{python_expand rm -rf %{buildroot}%{$python_sitelib}/*.egg-info
cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py%{$python_version}.egg-info
}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
export PYTHONPATH=.:example
%python_exec setup.py nosetests -v
%endif
%files %{python_files}
%if ! %{with test}
%license LICENSE
%doc CHANGES README.md
%doc CHANGES README.rst
%{python_sitelib}/pyparsing.py*
%pycache_only %{python_sitelib}/__pycache__/*
%{python_sitelib}/pyparsing-%{version}-py*.egg-info/
%endif
%files -n %{name}-docs
%if ! %{with test}
%doc examples docs/_build/html/
%endif
%changelog