| |
@@ -1,9 +1,15 @@
|
| |
+ # Sphinx-generated HTML documentation is not suitable for packaging; see
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
|
| |
+ #
|
| |
+ # We can generate PDF documentation as a substitute.
|
| |
+ %bcond_without doc_pdf
|
| |
+
|
| |
%global pypi_name pyperclip
|
| |
|
| |
|
| |
Name: python-%{pypi_name}
|
| |
Version: 1.8.2
|
| |
- Release: 1%{?dist}
|
| |
+ Release: 2%{?dist}
|
| |
Summary: A cross-platform clipboard module for Python
|
| |
|
| |
License: BSD
|
| |
@@ -15,12 +21,48 @@
|
| |
Pyperclip is a cross-platform Python module for copy and paste clipboard
|
| |
functions.
|
| |
|
| |
+
|
| |
%package -n python3-%{pypi_name}
|
| |
Summary: %{summary}
|
| |
|
| |
BuildRequires: python3-devel
|
| |
- BuildRequires: python3-setuptools
|
| |
- BuildRequires: python3-pytest
|
| |
+ BuildRequires: python3dist(setuptools)
|
| |
+
|
| |
+ # While upstream runs tests directly with Python/unittest, using pytest as the
|
| |
+ # runner allows us to more easily skip tests.
|
| |
+ BuildRequires: python3dist(pytest)
|
| |
+
|
| |
+ # Support graphical tests in non-graphical environment
|
| |
+ BuildRequires: xorg-x11-server-Xvfb
|
| |
+
|
| |
+ # TestGtk (module gtk)
|
| |
+ # (not available; this would be the obsolete PyGTK for GTK2, which never
|
| |
+ # supported Python 3)
|
| |
+
|
| |
+ # TestQt (module PyQt5.QtWidgets)
|
| |
+ BuildRequires: python3dist(pyqt5)
|
| |
+
|
| |
+ # TestXClip (executable xclip)
|
| |
+ BuildRequires: /usr/bin/xclip
|
| |
+
|
| |
+ # TestXSel (executable xsel)
|
| |
+ # These tests *can* pass, but some of them are flaky. It would be nice to
|
| |
+ # figure out why.
|
| |
+ # BuildRequires: /usr/bin/xsel
|
| |
+
|
| |
+ # TestWlClipboard (executable wl-copy)
|
| |
+ # These would fail with:
|
| |
+ # Failed to connect to a Wayland server
|
| |
+ # error: XDG_RUNTIME_DIR not set in the environment.
|
| |
+ # BuildRequires: /usr/bin/wl-copy
|
| |
+
|
| |
+ # TestKlipper (executables klipper and qdbus)
|
| |
+ # These would fail with:
|
| |
+ # Could not connect to D-Bus server:
|
| |
+ # org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch
|
| |
+ # terminated abnormally without any error message
|
| |
+ # BuildRequires: /usr/bin/klipper
|
| |
+ # BuildRequires: /usr/bin/qdbus
|
| |
|
| |
%description -n python3-%{pypi_name}
|
| |
Pyperclip is a cross-platform Python module for copy and paste clipboard
|
| |
@@ -29,7 +71,44 @@
|
| |
|
| |
%package -n python-%{pypi_name}-doc
|
| |
Summary: Pyperclip documentation
|
| |
- BuildRequires: python3-sphinx
|
| |
+
|
| |
+ %if %{with doc_pdf}
|
| |
+ BuildRequires: make
|
| |
+ BuildRequires: python3dist(sphinx)
|
| |
+ %if ! 0%{?el8}
|
| |
+ BuildRequires: python3-sphinx-latex
|
| |
+ %else
|
| |
+ BuildRequires: tex(amsmath.sty)
|
| |
+ BuildRequires: tex(amsthm.sty)
|
| |
+ BuildRequires: tex(anyfontsize.sty)
|
| |
+ BuildRequires: tex(article.cls)
|
| |
+ BuildRequires: tex(capt-of.sty)
|
| |
+ BuildRequires: tex(cmap.sty)
|
| |
+ BuildRequires: tex(color.sty)
|
| |
+ BuildRequires: tex(ctablestack.sty)
|
| |
+ BuildRequires: tex(fancyhdr.sty)
|
| |
+ BuildRequires: tex(fancyvrb.sty)
|
| |
+ BuildRequires: tex(fncychap.sty)
|
| |
+ BuildRequires: tex(framed.sty)
|
| |
+ BuildRequires: tex(geometry.sty)
|
| |
+ BuildRequires: tex(hyperref.sty)
|
| |
+ BuildRequires: tex(kvoptions.sty)
|
| |
+ BuildRequires: tex(luatex85.sty)
|
| |
+ BuildRequires: tex(needspace.sty)
|
| |
+ BuildRequires: tex(parskip.sty)
|
| |
+ BuildRequires: tex(polyglossia.sty)
|
| |
+ BuildRequires: tex(tabulary.sty)
|
| |
+ BuildRequires: tex(titlesec.sty)
|
| |
+ BuildRequires: tex(upquote.sty)
|
| |
+ BuildRequires: tex(utf8x.def)
|
| |
+ BuildRequires: tex(wrapfig.sty)
|
| |
+ BuildRequires: texlive-collection-fontsrecommended
|
| |
+ BuildRequires: texlive-collection-latex
|
| |
+ BuildRequires: texlive-dvipng
|
| |
+ BuildRequires: texlive-dvisvgm
|
| |
+ %endif
|
| |
+ BuildRequires: latexmk
|
| |
+ %endif
|
| |
|
| |
%description -n python-%{pypi_name}-doc
|
| |
Documentation for pyperclip
|
| |
@@ -45,27 +124,40 @@
|
| |
|
| |
%build
|
| |
%py3_build
|
| |
- # generate html docs
|
| |
- PYTHONPATH=${PWD} sphinx-build docs html
|
| |
- # remove the sphinx-build leftovers
|
| |
- rm -rf html/.{doctrees,buildinfo}
|
| |
+
|
| |
+ %if %{with doc_pdf}
|
| |
+ PYTHONPATH="${PWD}/src" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
|
| |
+ %make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
|
| |
+ %endif
|
| |
|
| |
%install
|
| |
%py3_install
|
| |
|
| |
%check
|
| |
- #%%{__python3} setup.py test
|
| |
- %pytest
|
| |
+ %global __pytest /usr/bin/xvfb-run -a %{python3} -m pytest
|
| |
+ # Explicitly skip backends that we know will fail in the mock environment if
|
| |
+ # their dependencies happen to be present. See notes in the BuildRequires.
|
| |
+ %pytest -k 'not TestGtk and not TestXSel and not TestWlClipboard and not TestKlipper' -v
|
| |
|
| |
%files -n python3-%{pypi_name}
|
| |
+ %license LICENSE.txt
|
| |
+ %doc AUTHORS.txt
|
| |
+ %doc CHANGES.txt
|
| |
%doc README.md
|
| |
%{python3_sitelib}/%{pypi_name}
|
| |
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
| |
|
| |
%files -n python-%{pypi_name}-doc
|
| |
- %doc html
|
| |
+ %license LICENSE.txt
|
| |
+ %if %{with doc_pdf}
|
| |
+ %doc docs/_build/latex/Pyperclip.pdf
|
| |
+ %endif
|
| |
|
| |
%changelog
|
| |
+ * Fri Aug 12 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.8.2-2
|
| |
+ - Enable running most of the graphical tests
|
| |
+ - Switch Sphinx documentation to PDF to sidestep guidelines issues
|
| |
+
|
| |
* Mon Aug 08 2022 Jonathan Wright <jonathan@almalinux.org> - 1.8.2-1
|
| |
- Update to 1.8.2
|
| |
|
| |
See https://bugzilla.redhat.com/show_bug.cgi?id=1887119#c2.
I am happy to port the spec file to
pyproject-rpm-macros
as an additional commit or as a separate PR.