From e86ef1cf22e6cf303016dc4be6bcc082012c31cd2687cbfd0e82dc26a393e063 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 12 Dec 2020 12:15:29 +0000 Subject: [PATCH] Accepting request 855004 from home:bnavigator:branches:devel:languages:python - Update to version 0.29 * Drawable & XInput: Avoid using array.array.tostring() which will be removed in Python 3.9 (thanks @t-wissmann). - Changelog for version 0.28 * DPMS: Display Power Management Signaling (by @thiagokokada) - Add remove-mock.patch gh#python-xlib/python-xlib#186 - Let the python-rpm-macros do their job for correct provides and obsoletes tag for all python3 flavors gh#openSUSE/python-rpm-macros#66 OBS-URL: https://build.opensuse.org/request/show/855004 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-xlib?expand=0&rev=16 --- python-python-xlib.changes | 13 +++++++++++ python-python-xlib.spec | 24 +++++++++++--------- python-xlib-0.27.tar.bz2 | 3 --- python-xlib-0.29.tar.gz | 3 +++ remove-mock.patch | 45 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+), 13 deletions(-) delete mode 100644 python-xlib-0.27.tar.bz2 create mode 100644 python-xlib-0.29.tar.gz create mode 100644 remove-mock.patch diff --git a/python-python-xlib.changes b/python-python-xlib.changes index 21f6070..1ea329d 100644 --- a/python-python-xlib.changes +++ b/python-python-xlib.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Dec 11 23:39:19 UTC 2020 - Benjamin Greiner + +- Update to version 0.29 + * Drawable & XInput: Avoid using array.array.tostring() which + will be removed in Python 3.9 (thanks @t-wissmann). +- Changelog for version 0.28 + * DPMS: Display Power Management Signaling (by @thiagokokada) +- Add remove-mock.patch gh#python-xlib/python-xlib#186 +- Let the python-rpm-macros do their job for correct provides and + obsoletes tag for all python3 flavors + gh#openSUSE/python-rpm-macros#66 + ------------------------------------------------------------------- Sun Aug 16 21:12:28 UTC 2020 - John Vandenberg diff --git a/python-python-xlib.spec b/python-python-xlib.spec index 46c6610..3c8339c 100644 --- a/python-python-xlib.spec +++ b/python-python-xlib.spec @@ -19,32 +19,34 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-python-xlib -Version: 0.27 +Version: 0.29 Release: 0 Summary: Python X11 interface License: LGPL-2.1-or-later Group: Development/Libraries/Python URL: https://github.com/python-xlib/python-xlib -Source: https://files.pythonhosted.org/packages/source/p/python-xlib/python-xlib-%{version}.tar.bz2 -BuildRequires: %{python_module mock} +Source: https://files.pythonhosted.org/packages/source/p/python-xlib/python-xlib-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM remove-mock.patch -- gh#python-xlib/python-xlib#186 +Patch0: remove-mock.patch +BuildRequires: %{python_module pytest-xvfb} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.10.0} +%if 0%{suse_version} < 1550 +BuildRequires: python-mock +%endif BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: xvfb-run Requires: python-six >= 1.10.0 BuildArch: noarch +Provides: python-xlib = %{version} +Obsoletes: python-xlib < %{version} %ifpython2 Provides: %{oldpython}-xlib = %{version} Obsoletes: %{oldpython}-xlib < %{version} %endif -%ifpython3 -Provides: python3-xlib = %{version} -Obsoletes: python3-xlib < %{version} -%endif %python_subpackages %description @@ -53,7 +55,9 @@ library for Python programs. %prep %setup -q -n python-xlib-%{version} -dos2unix CHANGELOG.md README.rst TODO +dos2unix CHANGELOG.md README.rst TODO dev-requirements.txt test/* +# patch only applies to unix endings +%patch0 -p1 %build %python_build @@ -63,7 +67,7 @@ dos2unix CHANGELOG.md README.rst TODO %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand xvfb-run --server-args "-screen 0 1920x1080x24" $python -m pytest -rs +%pytest -rs %files %{python_files} %license LICENSE diff --git a/python-xlib-0.27.tar.bz2 b/python-xlib-0.27.tar.bz2 deleted file mode 100644 index b1080e5..0000000 --- a/python-xlib-0.27.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a90667c70905c6ef0754c8a09fa61acbc1e1b7ddb946d527831800d7cbfe9348 -size 207119 diff --git a/python-xlib-0.29.tar.gz b/python-xlib-0.29.tar.gz new file mode 100644 index 0000000..c9db7c7 --- /dev/null +++ b/python-xlib-0.29.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4bcb756f4aa05be7b82ee21de0ba04d73414018727b42ebd9fbcf409ea75d13 +size 263519 diff --git a/remove-mock.patch b/remove-mock.patch new file mode 100644 index 0000000..c653d69 --- /dev/null +++ b/remove-mock.patch @@ -0,0 +1,45 @@ +From 8bab50254d78370398dcbdf247d59976b866c27f Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Sat, 12 Dec 2020 00:57:16 +0100 +Subject: [PATCH 1/2] remove mock from dev-requirments + +--- + dev-requirements.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dev-requirements.txt b/dev-requirements.txt +index b2f5288..22fc710 100644 +--- a/dev-requirements.txt ++++ b/dev-requirements.txt +@@ -1,5 +1,4 @@ + coverage + codecov +-mock + nose + setuptools-scm + +From 4c08116d51e2b2b2bc53d01ee8dd9698793cad5d Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Sat, 12 Dec 2020 00:58:19 +0100 +Subject: [PATCH 2/2] Use mock from standard lib if possible + +--- + test/test_unix_connect.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/test/test_unix_connect.py b/test/test_unix_connect.py +index 7680ba5..36abede 100644 +--- a/test/test_unix_connect.py ++++ b/test/test_unix_connect.py +@@ -6,7 +6,10 @@ + import sys + import unittest + +-from mock import patch ++try: ++ from unittest.mock import patch ++except ImportError: ++ from mock import patch + + from Xlib.support import unix_connect + from Xlib.error import DisplayConnectionError, DisplayNameError