[packages/python-reno] - updated to 2.11.3 - added mock patch (use unittest.mock under Python 3)

qboosh qboosh at pld-linux.org
Mon Jan 13 21:41:18 CET 2020


commit 8e2410dfda8c11b05011469b8e79cc35107405c9
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Jan 13 21:41:05 2020 +0100

    - updated to 2.11.3
    - added mock patch (use unittest.mock under Python 3)

 python-reno-mock.patch | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++
 python-reno.spec       | 69 ++++++++++++++++++-----------------
 2 files changed, 134 insertions(+), 33 deletions(-)
---
diff --git a/python-reno.spec b/python-reno.spec
index 2b892fc..9803b08 100644
--- a/python-reno.spec
+++ b/python-reno.spec
@@ -2,40 +2,34 @@
 #
 # Conditional build:
 %bcond_with	doc	# Sphinx documentation [broken, requires git repo?]
-%bcond_with	tests	# subunit tests (FIXME: incomplete dependencies, some fail)
+%bcond_with	tests	# subunit tests (requires git repo?)
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
 Summary:	reno: a New Way to manage Release Notes
 Summary(pl.UTF-8):	reno: nowy sposób zarządzania informacjami o wydaniu (Release Notes)
 Name:		python-reno
-Version:	2.2.0
-Release:	4
+Version:	2.11.3
+Release:	1
 License:	Apache v2.0
 Group:		Libraries/Python
 #Source0Download: https://pypi.python.org/simple/reno
 Source0:	https://files.pythonhosted.org/packages/source/r/reno/reno-%{version}.tar.gz
-# Source0-md5:	cacb861fa82ef46caca91e0d50306642
+# Source0-md5:	c582cf344169a91f8d9a86b22ae3660a
+Patch0:		%{name}-mock.patch
 URL:		http://docs.openstack.org/developer/reno/
 %if %{with python2}
 BuildRequires:	python-modules >= 1:2.7
 BuildRequires:	python-pbr >= 1.4
 BuildRequires:	python-setuptools
 %if %{with tests}
-BuildRequires:	python-PyYAML >= 3.1.0
-BuildRequires:	python-babel >= 1.3
-BuildRequires:	python-coverage >= 3.6
+BuildRequires:	python-PyYAML >= 3.10.0
+BuildRequires:	python-Sphinx >= 1.6.1
+BuildRequires:	python-coverage >= 4.0
 BuildRequires:	python-dulwich >= 0.15.0
-#BuildRequires:	python-hacking >= 0.12.0
-#BuildRequires:	python-hacking < 0.14
 BuildRequires:	python-mock >= 1.2
-BuildRequires:	python-oslosphinx >= 2.5.0
-#BuildRequires:	python-oslotest >= 1.10.0
 BuildRequires:	python-six >= 1.9.0
-BuildRequires:	python-subunit >= 0.0.18
-BuildRequires:	python-testrepository >= 0.0.18
-BuildRequires:	python-testscenarios >= 0.4
-BuildRequires:	python-testtools # >= 1.4.0
+BuildRequires:	python-testtools >= 1.4.0
 %endif
 %endif
 %if %{with python3}
@@ -43,25 +37,18 @@ BuildRequires:	python3-modules >= 1:3.4
 BuildRequires:	python3-pbr >= 1.4
 BuildRequires:	python3-setuptools
 %if %{with tests}
-BuildRequires:	python3-PyYAML >= 3.1.0
-BuildRequires:	python3-babel >= 1.3
-BuildRequires:	python3-coverage >= 3.6
+BuildRequires:	python3-PyYAML >= 3.10.0
+BuildRequires:	python3-Sphinx >= 1.6.1
+BuildRequires:	python3-coverage >= 4.0
 BuildRequires:	python3-dulwich >= 0.15.0
-#BuildRequires:	python3-hacking >= 0.12.0
-#BuildRequires:	python3-hacking < 0.14
-BuildRequires:	python3-oslosphinx >= 2.5.0
-#BuildRequires:	python3-oslotest >= 1.10.0
 BuildRequires:	python3-six >= 1.9.0
-BuildRequires:	python3-subunit >= 0.0.18
-BuildRequires:	python3-testrepository >= 0.0.18
-BuildRequires:	python3-testscenarios >= 0.4
-BuildRequires:	python3-testtools # >= 1.4.0
+BuildRequires:	python3-testtools >= 1.4.0
 %endif
 %endif
 %if %{with doc}
 BuildRequires:	python3-docutils >= 0.11
-BuildRequires:	python3-oslosphinx >= 2.5.0
-BuildRequires:	sphinx-pdg
+BuildRequires:	python3-openstackdocstheme >= 1.11.0
+BuildRequires:	sphinx-pdg >= 1.6.1
 %endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
@@ -112,20 +99,28 @@ Dokumentacja API modułu reno.
 
 %prep
 %setup -q -n reno-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+%{__python} -m unittest discover -s reno/tests
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test} %{?with_doc:build_sphinx}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m unittest discover -s reno/tests
+%endif
 %endif
 
 %if %{with doc}
-cd docs
-%{__make} -j1 html
-rm -rf _build/html/_sources
+PYTHONPATH=$(pwd) \
+sphinx-build-3 -b html doc/source doc/source/_build/html
 %endif
 
 %install
@@ -134,11 +129,16 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %py_install
 
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/reno{,-2}
+
 %py_postclean
 %endif
 
 %if %{with python3}
 %py3_install
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/reno{,-3}
+ln -s reno-3 $RPM_BUILD_ROOT%{_bindir}/reno
 %endif
 
 %clean
@@ -148,6 +148,7 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog README.rst
+%attr(755,root,root) %{_bindir}/reno-2
 %{py_sitescriptdir}/reno
 %{py_sitescriptdir}/reno-%{version}-py*.egg-info
 %endif
@@ -156,6 +157,8 @@ rm -rf $RPM_BUILD_ROOT
 %files -n python3-reno
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog README.rst
+%attr(755,root,root) %{_bindir}/reno
+%attr(755,root,root) %{_bindir}/reno-3
 %{py3_sitescriptdir}/reno
 %{py3_sitescriptdir}/reno-%{version}-py*.egg-info
 %endif
diff --git a/python-reno-mock.patch b/python-reno-mock.patch
new file mode 100644
index 0000000..be77958
--- /dev/null
+++ b/python-reno-mock.patch
@@ -0,0 +1,98 @@
+--- reno-2.11.3/reno/tests/test_cache.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_cache.py	2020-01-13 20:36:08.997885009 +0100
+@@ -15,7 +15,10 @@
+ import fixtures
+ import textwrap
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ from reno import cache
+ from reno import config
+--- reno-2.11.3/reno/tests/test_config.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_config.py	2020-01-13 20:36:28.684445025 +0100
+@@ -21,7 +21,10 @@
+ from reno import main
+ from reno.tests import base
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ 
+ class TestConfig(base.TestCase):
+--- reno-2.11.3/reno/tests/test_create.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_create.py	2020-01-13 20:36:44.131028010 +0100
+@@ -14,7 +14,10 @@
+ 
+ import fixtures
+ import io
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ from reno import create
+ from reno.tests import base
+--- reno-2.11.3/reno/tests/test_formatter.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_formatter.py	2020-01-13 20:36:59.774276596 +0100
+@@ -12,7 +12,10 @@
+ # License for the specific language governing permissions and limitations
+ # under the License.
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ from reno import config
+ from reno import formatter
+--- reno-2.11.3/reno/tests/test_loader.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_loader.py	2020-01-13 20:37:14.794195227 +0100
+@@ -16,7 +16,10 @@
+ import textwrap
+ 
+ import fixtures
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import six
+ import yaml
+ 
+--- reno-2.11.3/reno/tests/test_scanner.py.orig	2020-01-13 20:37:28.574120574 +0100
++++ reno-2.11.3/reno/tests/test_scanner.py	2020-01-13 20:37:30.737442188 +0100
+@@ -25,7 +25,10 @@
+ from dulwich import diff_tree
+ from dulwich import objects
+ import fixtures
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ from testtools.content import text_content
+ 
+ from reno import config
+--- reno-2.11.3/reno/tests/test_utils.py.orig	2019-04-04 05:59:54.000000000 +0200
++++ reno-2.11.3/reno/tests/test_utils.py	2020-01-13 20:37:40.040725121 +0100
+@@ -12,7 +12,10 @@
+ # License for the specific language governing permissions and limitations
+ # under the License.
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import six
+ 
+ from reno.tests import base
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-reno.git/commitdiff/8e2410dfda8c11b05011469b8e79cc35107405c9



More information about the pld-cvs-commit mailing list