14
0

Accepting request 855356 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/855356
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-python-xlib?expand=0&rev=8
This commit is contained in:
2020-12-16 09:59:15 +00:00
committed by Git OBS Bridge
5 changed files with 75 additions and 13 deletions

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri Dec 11 23:39:19 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- 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 <jayvdb@gmail.com> Sun Aug 16 21:12:28 UTC 2020 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -19,32 +19,34 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python %define oldpython python
Name: python-python-xlib Name: python-python-xlib
Version: 0.27 Version: 0.29
Release: 0 Release: 0
Summary: Python X11 interface Summary: Python X11 interface
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
Group: Development/Libraries/Python Group: Development/Libraries/Python
URL: https://github.com/python-xlib/python-xlib URL: https://github.com/python-xlib/python-xlib
Source: https://files.pythonhosted.org/packages/source/p/python-xlib/python-xlib-%{version}.tar.bz2 Source: https://files.pythonhosted.org/packages/source/p/python-xlib/python-xlib-%{version}.tar.gz
BuildRequires: %{python_module mock} # 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 pytest}
BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six >= 1.10.0} BuildRequires: %{python_module six >= 1.10.0}
%if 0%{suse_version} < 1550
BuildRequires: python-mock
%endif
BuildRequires: dos2unix BuildRequires: dos2unix
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: xvfb-run
Requires: python-six >= 1.10.0 Requires: python-six >= 1.10.0
BuildArch: noarch BuildArch: noarch
Provides: python-xlib = %{version}
Obsoletes: python-xlib < %{version}
%ifpython2 %ifpython2
Provides: %{oldpython}-xlib = %{version} Provides: %{oldpython}-xlib = %{version}
Obsoletes: %{oldpython}-xlib < %{version} Obsoletes: %{oldpython}-xlib < %{version}
%endif %endif
%ifpython3
Provides: python3-xlib = %{version}
Obsoletes: python3-xlib < %{version}
%endif
%python_subpackages %python_subpackages
%description %description
@@ -53,7 +55,9 @@ library for Python programs.
%prep %prep
%setup -q -n python-xlib-%{version} %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 %build
%python_build %python_build
@@ -63,7 +67,7 @@ dos2unix CHANGELOG.md README.rst TODO
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
%python_expand xvfb-run --server-args "-screen 0 1920x1080x24" $python -m pytest -rs %pytest -rs
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a90667c70905c6ef0754c8a09fa61acbc1e1b7ddb946d527831800d7cbfe9348
size 207119

3
python-xlib-0.29.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e4bcb756f4aa05be7b82ee21de0ba04d73414018727b42ebd9fbcf409ea75d13
size 263519

45
remove-mock.patch Normal file
View File

@@ -0,0 +1,45 @@
From 8bab50254d78370398dcbdf247d59976b866c27f Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
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 <code@bnavigator.de>
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