[packages/python-elementpath] - new - added hash patch to disable hashing tests with expected result specific to 64-bit platforms

qboosh qboosh at pld-linux.org
Fri Sep 18 19:05:22 CEST 2020


commit 3cadde8c2eb14141213b47f838196cb53fa73490
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Sep 18 19:08:04 2020 +0200

    - new
    - added hash patch to disable hashing tests with expected result specific to 64-bit platforms

 python-elementpath-hash.patch |  26 ++++++++
 python-elementpath.spec       | 142 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+)
---
diff --git a/python-elementpath.spec b/python-elementpath.spec
new file mode 100644
index 0000000..4fae049
--- /dev/null
+++ b/python-elementpath.spec
@@ -0,0 +1,142 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
+Summary:	XPath 1.0/2.0 parsers and selectors for ElementTree and lxml
+Summary(pl.UTF-8):	Parsery i selektory XPath 1.0/2.0 dla ElementTree oraz lxml
+Name:		python-elementpath
+Version:	1.3.3
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/elementpath/
+Source0:	https://files.pythonhosted.org/packages/source/e/elementpath/elementpath-%{version}.tar.gz
+# Source0-md5:	3712104ae5970878a112c31aea71a503
+Patch0:		%{name}-hash.patch
+URL:		https://pypi.org/project/elementpath/
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-lxml
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-lxml
+%endif
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	sphinx-pdg
+%endif
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The proposal of this package is to provide XPath 1.0 and 2.0 selectors
+for Python's ElementTree XML data structures, both for the standard
+ElementTree library and for the lxml.etree library.
+
+%description -l pl.UTF-8
+Celem tego pakietu jest udostępnienie selektorów XPath 1.0 i 2.0 do
+pythonowych struktur danych XML ElementTree, zarówno dla ElementTree z
+biblioteki strandardowej, jak i lxml.etree.
+
+%package -n python3-elementpath
+Summary:	XPath 1.0/2.0 parsers and selectors for ElementTree and lxml
+Summary(pl.UTF-8):	Parsery i selektory XPath 1.0/2.0 dla ElementTree oraz lxml
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.5
+
+%description -n python3-elementpath
+The proposal of this package is to provide XPath 1.0 and 2.0 selectors
+for Python's ElementTree XML data structures, both for the standard
+ElementTree library and for the lxml.etree library.
+
+%description -n python3-elementpath -l pl.UTF-8
+Celem tego pakietu jest udostępnienie selektorów XPath 1.0 i 2.0 do
+pythonowych struktur danych XML ElementTree, zarówno dla ElementTree z
+biblioteki strandardowej, jak i lxml.etree.
+
+%package apidocs
+Summary:	API documentation for Python elementpath module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona elementpath
+Group:		Documentation
+
+%description apidocs
+API documentation for Python elementpath module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona elementpath.
+
+%prep
+%setup -q -n elementpath-%{version}
+%patch0 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+%{__python} tests/test_elementpath.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m unittest
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C doc html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst LICENSE README.rst
+%{py_sitescriptdir}/elementpath
+%{py_sitescriptdir}/elementpath-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-elementpath
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst LICENSE README.rst
+%{py3_sitescriptdir}/elementpath
+%{py3_sitescriptdir}/elementpath-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/python-elementpath-hash.patch b/python-elementpath-hash.patch
new file mode 100644
index 0000000..279157c
--- /dev/null
+++ b/python-elementpath-hash.patch
@@ -0,0 +1,26 @@
+--- elementpath-1.3.3/tests/test_datatypes.py.orig	2019-10-21 14:02:17.000000000 +0200
++++ elementpath-1.3.3/tests/test_datatypes.py	2020-09-18 10:17:58.564091550 +0200
+@@ -597,10 +597,7 @@
+         self.assertEqual(YearMonthDuration(10).months, 10)
+ 
+     def test_hashing(self):
+-        if sys.version_info < (3, 8):
+-            self.assertEqual(hash(Duration(16)), 3713063228956366931)
+-        else:
+-            self.assertEqual(hash(Duration(16)), 6141449309508620102)
++        self.assertIsInstance(hash(Duration(16)), int)
+ 
+ 
+ class TimezoneTypeTest(unittest.TestCase):
+@@ -647,10 +644,7 @@
+         self.assertNotEqual(Timezone.fromstring('+05:00'), Timezone.fromstring('+06:00'))
+ 
+     def test_hashing(self):
+-        if sys.version_info < (3, 8):
+-            self.assertEqual(hash(Timezone.fromstring('+05:00')), 1289844826723787395)
+-        else:
+-            self.assertEqual(hash(Timezone.fromstring('+05:00')), 7009945331308913293)
++        self.assertIsInstance(hash(Timezone.fromstring('+05:00')), int)
+ 
+ 
+ class TypeProxiesTest(unittest.TestCase):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-elementpath.git/commitdiff/3cadde8c2eb14141213b47f838196cb53fa73490



More information about the pld-cvs-commit mailing list