14
0

- Add nose_to_unittest.patch to avoid nose BR and rewrite tests

to work (gh#pyparsing/pyparsing#64)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=52
This commit is contained in:
2019-01-07 14:16:05 +00:00
committed by Git OBS Bridge
parent 02825dedbb
commit 0a12b50e88
3 changed files with 395 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pyparsing
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
#
%define modname pyparsing
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
@@ -37,8 +38,9 @@ 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}
BuildRequires: %{python_module nose}
# Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -61,7 +63,8 @@ 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 pyparsing-2.3.1
%setup -q -n %{modname}-2.3.1
%autopatch -p1
%build
%python_build
@@ -79,7 +82,11 @@ cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py%
%check
%if %{with test}
export PYTHONPATH=.:example
%python_exec setup.py nosetests -v
# 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
%endif
%files %{python_files}