[python-pyquery] Enable tests during build, add proper dependencies for them.
Bohuslav Kabrda
bkabrda at fedoraproject.org
Fri Jun 13 11:56:14 UTC 2014
commit a9af90e62939bb9f47ca4610e80a2bf972384063
Author: Slavek Kabrda <bkabrda at redhat.com>
Date: Fri Jun 13 13:56:06 2014 +0200
Enable tests during build, add proper dependencies for them.
...query-fix-tests-failing-with-libxml-2.9.0.patch | 33 ++++++++++++++++++
python-pyquery.spec | 35 +++++++++++++++++---
2 files changed, 63 insertions(+), 5 deletions(-)
---
diff --git a/python-pyquery-fix-tests-failing-with-libxml-2.9.0.patch b/python-pyquery-fix-tests-failing-with-libxml-2.9.0.patch
new file mode 100644
index 0000000..931fa9d
--- /dev/null
+++ b/python-pyquery-fix-tests-failing-with-libxml-2.9.0.patch
@@ -0,0 +1,33 @@
+From 531fed28dcb1e24906ffcbeee91470e699a40d52 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= <bugs at bergstroem.nu>
+Date: Tue, 15 Apr 2014 15:32:44 +1000
+Subject: [PATCH] Fix whitespace issue in test_pyquery.py
+
+This resolves two broken tests for me: test_replaceWith,
+test_replaceWith_with_function
+---
+ tests/test_pyquery.py | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_pyquery.py b/tests/test_pyquery.py
+index 91ebf63..eec2507 100644
+--- a/tests/test_pyquery.py
++++ b/tests/test_pyquery.py
+@@ -379,13 +379,11 @@ def test_class(self):
+
+ class TestHTMLParser(TestCase):
+ xml = "<div>I'm valid XML</div>"
+- html = '''
+- <div class="portlet">
++ html = '''<div class="portlet">
+ <a href="/toto">TestimageMy link text</a>
+ <a href="/toto2">imageMy link text 2</a>
+ Behind you, a three-headed HTML‐Entity!
+- </div>
+- '''
++ </div>'''
+
+ def test_parser_persistance(self):
+ d = pq(self.xml, parser='xml')
+--
+1.9.3
diff --git a/python-pyquery.spec b/python-pyquery.spec
index 3903cea..e7cfdd1 100644
--- a/python-pyquery.spec
+++ b/python-pyquery.spec
@@ -3,17 +3,31 @@
Name: python-%{real_name}
Version: 1.2.8
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A jQuery-like library for python
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/pyquery
Source0: https://pypi.python.org/packages/source/p/pyquery/pyquery-1.2.8.zip
+# Patch from upstream - fixes test issues with lxml compiled with
+# libxml >= 2.9.0
+# https://github.com/gawel/pyquery/pull/63
+Patch0: python-pyquery-fix-tests-failing-with-libxml-2.9.0.patch
+
BuildArch: noarch
BuildRequires: python-devel, python-setuptools
-BuildRequires: python-lxml >= 2.1
+
+# test deps
+BuildRequires: python-beautifulsoup
BuildRequires: python-cssselect
+BuildRequires: python-lxml >= 2.1
+BuildRequires: python-nose
+BuildRequires: python-requests
+BuildRequires: python-restkit
+BuildRequires: python-webob
+BuildRequires: python-webtest
+
Requires: python-lxml >= 2.1
Requires: python-cssselect
@@ -27,8 +41,15 @@ XML and HTML manipulation.
Summary: Easily build and distribute Python 3 packages
Group: Applications/System
BuildRequires: python3-devel, python3-setuptools
-BuildRequires: python3-lxml >= 2.1
+
+# test deps
BuildRequires: python3-cssselect
+BuildRequires: python3-lxml >= 2.1
+BuildRequires: python3-nose
+BuildRequires: python3-requests
+BuildRequires: python3-webob
+BuildRequires: python3-webtest
+
Requires: python3-lxml >= 2.1
Requires: python3-cssselect
@@ -41,6 +62,7 @@ XML and HTML manipulation.
%prep
%setup -qn %{real_name}-%{version}
+%patch0 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
@@ -68,11 +90,11 @@ XML and HTML manipulation.
%check
%if 0%{?with_python3}
pushd %{py3dir}
- %{__python3} setup.py test
+ nosetests-%{python3_version}
popd
%endif # with_python3
-%{__python} setup.py test
+nosetests
%files
%doc CHANGES.rst README.rst
@@ -85,6 +107,9 @@ XML and HTML manipulation.
%{python3_sitelib}/pyquery*.egg-info/
%changelog
+* Fri Jun 13 2014 Bohuslav Kabrda <bkabrda at redhat.com> - 1.2.8-2
+- Enable tests during build, add proper dependencies for them.
+
* Sat Jun 07 2014 Brendan Jones <brendan.jones.it at gmail.com> 1.2.8-1
- Update to 1.2.8
- Add python3 support
More information about the scm-commits
mailing list