[packages/docutils] - added py3 patch, adjusted test BRs; tests are passing for me now

qboosh qboosh at pld-linux.org
Sun Mar 22 18:48:13 CET 2020


commit 93dcf25a2ab8b02de8fb2cd66bd4b02457dddfd0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 22 18:49:21 2020 +0100

    - added py3 patch, adjusted test BRs; tests are passing for me now

 docutils-py3.patch | 42 ++++++++++++++++++++++++++++++++++++++++++
 docutils.spec      | 22 +++++++++++++++++-----
 2 files changed, 59 insertions(+), 5 deletions(-)
---
diff --git a/docutils.spec b/docutils.spec
index 25085ad..0427fc5 100644
--- a/docutils.spec
+++ b/docutils.spec
@@ -15,15 +15,25 @@ Group:		Development/Tools
 #Source0Download: https://pypi.org/simple/docutils/
 Source0:	https://files.pythonhosted.org/packages/source/d/docutils/%{name}-%{version}.tar.gz
 # Source0-md5:	44952782107930ddfcd37ae48eee0857
+Patch0:		%{name}-py3.patch
 URL:		http://docutils.sourceforge.net/
 %if %{with python2}
-BuildRequires:	python-devel >= 1:2.6
+BuildRequires:	python-devel >= 1:2.7
 BuildRequires:	python-setuptools
+%if %{with tests}
+# py3 patch assumes python3 lexer is the default, as it is since pygments 2.5.0
+BuildRequires:	python-pygments >= 2.5.0
+# a few tests fail with _xmlplus implementation of xml
+BuildConflicts:	python-PyXML
+%endif
 %endif
 %if %{with python3}
-BuildRequires:	python3-2to3 >= 1:3.4
-BuildRequires:	python3-devel >= 1:3.4
+BuildRequires:	python3-devel >= 1:3.5
 BuildRequires:	python3-setuptools
+%if %{with tests}
+# py3 patch assumes python3 lexer is the default, as it is since pygments 2.5.0
+BuildRequires:	python3-pygments >= 2.5.0
+%endif
 %endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
@@ -46,7 +56,7 @@ do odczytania, łatwy w użyciu język opisu tekstu typu WYSIWYG.
 Summary:        Text documents processing modules for Python 2.x
 Summary(pl.UTF-8):      Moduły Pythona 2.x do przetwarzania dokumentów tekstowych
 Group:          Development/Languages/Python
-%pyrequires_eq	python-libs
+Requires:	python-libs >= 1:2.7
 
 %description -n python-%{name}
 Docutils are utilities for general- and special-purpose documentation,
@@ -88,6 +98,7 @@ Ten pakiet zawiera Docutils dla Pythona 3.
 Summary:        Text documents processing modules for Python 3.x
 Summary(pl.UTF-8):      Moduły Pythona 3.x do przetwarzania dokumentów tekstowych
 Group:          Development/Languages/Python
+Requires:	python3-libs >= 1:3.5
 
 %description -n python3-%{name}
 Docutils are utilities for general- and special-purpose documentation,
@@ -106,6 +117,7 @@ Ten pakiet dostarcza moduły Docutils dla Pythona 3.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %if %{with python2}
@@ -122,7 +134,7 @@ PYTHONPATH=$(pwd)/build-2/lib \
 
 %if %{with tests}
 PYTHONPATH=$(pwd)/build-3/lib \
-%{__python3} test3/alltests.py
+%{__python3} test/alltests.py
 %endif
 %endif
 
diff --git a/docutils-py3.patch b/docutils-py3.patch
new file mode 100644
index 0000000..a68bef9
--- /dev/null
+++ b/docutils-py3.patch
@@ -0,0 +1,42 @@
+--- docutils-0.16/test/test_parsers/test_rst/test_interpreted.py.orig	2019-11-04 16:12:47.000000000 +0100
++++ docutils-0.16/test/test_parsers/test_rst/test_interpreted.py	2020-03-22 16:07:00.375252448 +0100
+@@ -281,7 +281,7 @@
+     <paragraph>
+         Python code \n\
+         <literal classes="code testclass python">
+-            <inline classes="keyword">
++            <inline classes="name builtin">
+                 print
+             <inline classes="punctuation">
+                 (
+--- docutils-0.16/test/test_parsers/test_rst/test_directives/test_code.py.orig	2019-11-04 16:12:47.000000000 +0100
++++ docutils-0.16/test/test_parsers/test_rst/test_directives/test_code.py	2020-03-22 16:09:30.731104567 +0100
+@@ -105,7 +105,7 @@
+ <document source="test data">
+     <literal_block classes="code python testclass" xml:space="preserve">
+          \n\
+-        <inline classes="keyword">
++        <inline classes="name builtin">
+             print
+         <inline classes="punctuation">
+             (
+@@ -165,7 +165,7 @@
+         <inline classes="ln">
+             12 \n\
+             \n\
+-        <inline classes="keyword">
++        <inline classes="name builtin">
+             print
+         <inline classes="punctuation">
+             (
+--- docutils-0.16/test/test_parsers/test_rst/test_directives/test_code_long.py.orig	2019-11-04 16:12:47.000000000 +0100
++++ docutils-0.16/test/test_parsers/test_rst/test_directives/test_code_long.py	2020-03-22 16:10:23.674151084 +0100
+@@ -67,7 +67,7 @@
+         <inline classes="ln">
+             12 \n\
+             \n\
+-        <inline classes="keyword">
++        <inline classes="name builtin">
+             print
+         <inline classes="punctuation">
+             (
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/docutils.git/commitdiff/93dcf25a2ab8b02de8fb2cd66bd4b02457dddfd0



More information about the pld-cvs-commit mailing list