[packages/python3-pyperclip] - python-pyperclip.spec updated to 1.9.0 (+tests fix) for python 3.6+

qboosh qboosh at pld-linux.org
Wed Jul 9 18:23:35 CEST 2025


commit 47d892f18ab8862b8ea0ed1cf99c44c587c4e91e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jul 9 18:25:07 2025 +0200

    - python-pyperclip.spec updated to 1.9.0 (+tests fix) for python 3.6+

 pyperclip-tests.patch                           | 21 ++++++++
 python-pyperclip.spec => python3-pyperclip.spec | 71 ++++---------------------
 2 files changed, 32 insertions(+), 60 deletions(-)
---
diff --git a/python-pyperclip.spec b/python3-pyperclip.spec
similarity index 55%
rename from python-pyperclip.spec
rename to python3-pyperclip.spec
index 0bee35f..b945f7b 100644
--- a/python-pyperclip.spec
+++ b/python3-pyperclip.spec
@@ -2,35 +2,28 @@
 # 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:	A cross-platform clipboard module for Python
 Summary(pl.UTF-8):	Wieloplatformowy moduł schowka dla Pythona
-Name:		python-pyperclip
-Version:	1.8.2
-Release:	3
+Name:		python3-pyperclip
+Version:	1.9.0
+Release:	1
 License:	BSD
 Group:		Libraries/Python
 Source0:	https://files.pythonhosted.org/packages/source/p/pyperclip/pyperclip-%{version}.tar.gz
-# Source0-md5:	853603b2e8fa1b13622fdbe72d1fb201
+# Source0-md5:	43f9e69bf948139055683d28080787f4
+Patch0:		pyperclip-tests.patch
 URL:		https://pypi.org/project/pyperclip/
+# 3.6 is minimum for f-strings
+BuildRequires:	python3 >= 1:3.6
+BuildRequires:	python3-modules >= 1:3.6
+BuildRequires:	python3-setuptools
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with python2}
-BuildRequires:	python >= 1:2.6
-BuildRequires:	python-modules >= 1:2.6
-BuildRequires:	python-setuptools
-%endif
-%if %{with python3}
-BuildRequires:	python3 >= 1:3.1
-BuildRequires:	python3-modules >= 1:3.1
-BuildRequires:	python3-setuptools
-%endif
 %if %{with doc}
 BuildRequires:	sphinx-pdg-3
 %endif
-Requires:	python-modules >= 1:2.6
+Requires:	python3-modules >= 1:3.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -42,20 +35,6 @@ for now)
 Wieloplatformowy moduł schowka dla Pythona (obecnie obsługuje tylko
 czysty tekst).
 
-%package -n python3-pyperclip
-Summary:	A cross-platform clipboard module for Python
-Summary(pl.UTF-8):	Wieloplatformowy moduł schowka dla Pythona
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.1
-
-%description -n python3-pyperclip
-A cross-platform clipboard module for Python. (only handles plain text
-for now)
-
-%description -n python3-pyperclip -l pl.UTF-8
-Wieloplatformowy moduł schowka dla Pythona (obecnie obsługuje tylko
-czysty tekst).
-
 %package apidocs
 Summary:	API documentation for Python pyperclip module
 Summary(pl.UTF-8):	Dokumentacja API modułu Pythona pyperclip
@@ -69,25 +48,15 @@ Dokumentacja API modułu Pythona pyperclip.
 
 %prep
 %setup -q -n pyperclip-%{version}
+%patch -P0 -p1
 
 %build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd)/src \
-%{__python} tests/test_pyperclip.py
-%endif
-%endif
-
-%if %{with python3}
 %py3_build
 
 %if %{with tests}
 PYTHONPATH=$(pwd)/src \
 %{__python3} tests/test_pyperclip.py
 %endif
-%endif
 
 %if %{with doc}
 %{__make} -C docs -j1 html \
@@ -97,34 +66,16 @@ PYTHONPATH=$(pwd)/src \
 %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 AUTHORS.txt CHANGES.txt LICENSE.txt README.md
-%{py_sitescriptdir}/pyperclip
-%{py_sitescriptdir}/pyperclip-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-pyperclip
-%defattr(644,root,root,755)
-%doc AUTHORS.txt CHANGES.txt LICENSE.txt README.md
 %{py3_sitescriptdir}/pyperclip
 %{py3_sitescriptdir}/pyperclip-%{version}-py*.egg-info
-%endif
 
 %if %{with doc}
 %files apidocs
diff --git a/pyperclip-tests.patch b/pyperclip-tests.patch
new file mode 100644
index 0000000..7764e4e
--- /dev/null
+++ b/pyperclip-tests.patch
@@ -0,0 +1,21 @@
+HAS_DISPLAY disappeared before 1.9.0 release, tests hasn't been updated yet
+--- pyperclip-1.9.0/tests/test_pyperclip.py.orig	2024-06-18 20:46:25.000000000 +0200
++++ pyperclip-1.9.0/tests/test_pyperclip.py	2025-07-09 18:22:37.560176946 +0200
+@@ -8,7 +8,7 @@ import platform
+ #import sys
+ #sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+ 
+-from pyperclip import _executable_exists, HAS_DISPLAY
++from pyperclip import _executable_exists
+ from pyperclip import (init_osx_pbcopy_clipboard, init_osx_pyobjc_clipboard,
+                                   init_dev_clipboard_clipboard,
+                                   init_qt_clipboard,
+@@ -135,7 +135,7 @@ class TestOSX(_TestClipboard):
+ 
+ 
+ class TestQt(_TestClipboard):
+-    if HAS_DISPLAY:
++    if os.getenv("DISPLAY", False):
+         try:
+             import PyQt5.QtWidgets
+         except ImportError:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-pyperclip.git/commitdiff/47d892f18ab8862b8ea0ed1cf99c44c587c4e91e



More information about the pld-cvs-commit mailing list