| |
@@ -1,5 +1,12 @@
|
| |
%global srcname pikepdf
|
| |
|
| |
+ # disable docs on EPEL 9 to avoid circular dependency on matplotlib
|
| |
+ %if %{defined el9}
|
| |
+ %bcond_with docs
|
| |
+ %else
|
| |
+ %bcond_without docs
|
| |
+ %endif
|
| |
+
|
| |
Name: python-%{srcname}
|
| |
Version: 2.16.1
|
| |
Release: %autorelease
|
| |
@@ -8,97 +15,93 @@
|
| |
License: MPLv2.0
|
| |
URL: https://github.com/pikepdf/pikepdf
|
| |
Source0: %pypi_source
|
| |
- Patch0001: 0001-Relax-some-requirements.patch
|
| |
+ # downstream only
|
| |
+ Patch1: 0001-Adjust-test-requirements.patch
|
| |
+ # https://github.com/pikepdf/pikepdf/commit/caaf1119784b32f8b68d26b2c05a8fc2bea5ad89
|
| |
+ Patch2: 0002-Replace-pkg_resources-with-importlib.metadata.patch
|
| |
+ # https://github.com/pikepdf/pikepdf/commit/4f6923fe33c2d7e78d1482a5eb2beb6e9155977b
|
| |
+ Patch3: 0003-Fix-palette-handling-for-Pillow-9.1.0.patch
|
| |
|
| |
BuildRequires: gcc-c++
|
| |
BuildRequires: qpdf-devel >= 10.0.3
|
| |
BuildRequires: python3-devel
|
| |
- BuildRequires: python3dist(lxml) >= 4
|
| |
- BuildRequires: (python3dist(pillow) >= 7 with python3dist(pillow) < 9)
|
| |
- BuildRequires: (python3dist(pybind11) >= 2.6 with python3dist(pybind11) < 3)
|
| |
- BuildRequires: python3dist(setuptools)
|
| |
- BuildRequires: python3dist(setuptools-scm)
|
| |
- BuildRequires: python3dist(setuptools-scm[toml]) >= 4.1
|
| |
- BuildRequires: python3dist(setuptools-scm-git-archive)
|
| |
# Tests:
|
| |
BuildRequires: poppler-utils
|
| |
- BuildRequires: python3dist(attrs) >= 20.2
|
| |
- BuildRequires: (python3dist(hypothesis) >= 5 with python3dist(hypothesis) < 7)
|
| |
- BuildRequires: python3dist(psutil) >= 5
|
| |
- BuildRequires: (python3dist(pytest) >= 6 with python3dist(pytest) < 7)
|
| |
- BuildRequires: python3dist(pytest-forked)
|
| |
- BuildRequires: python3dist(pytest-timeout) >= 1.4.2
|
| |
- BuildRequires: (python3dist(pytest-xdist) >= 1.28 with python3dist(pytest-xdist) < 3)
|
| |
- BuildRequires: python3dist(python-dateutil) >= 2.8
|
| |
- BuildRequires: python3dist(python-xmp-toolkit) >= 2.0.1
|
| |
-
|
| |
- %description
|
| |
+
|
| |
+ %global _description %{expand:
|
| |
pikepdf is a Python library for reading and writing PDF files. pikepdf is
|
| |
- based on QPDF, a powerful PDF manipulation and repair library.
|
| |
+ based on QPDF, a powerful PDF manipulation and repair library.}
|
| |
+
|
| |
+
|
| |
+ %description %{_description}
|
| |
|
| |
|
| |
%package -n python3-%{srcname}
|
| |
Summary: %{summary}
|
| |
|
| |
- # Force a minimum version (same soname as 8.1.x):
|
| |
- Requires: qpdf-libs >= 8.4.2
|
| |
|
| |
- %description -n python3-%{srcname}
|
| |
- pikepdf is a Python library for reading and writing PDF files. pikepdf is
|
| |
- based on QPDF, a powerful PDF manipulation and repair library.
|
| |
+ %description -n python3-%{srcname} %{_description}
|
| |
|
| |
|
| |
+ %if %{with docs}
|
| |
%package -n python-%{srcname}-doc
|
| |
Summary: pikepdf documentation
|
| |
|
| |
- BuildRequires: python3dist(sphinx) >= 3
|
| |
- BuildRequires: python3dist(sphinx-issues)
|
| |
- BuildRequires: python3dist(sphinx-rtd-theme)
|
| |
- BuildRequires: python3dist(matplotlib)
|
| |
+ # Not autorequired because it's a Fedora-specific subpackage.
|
| |
BuildRequires: python3-ipython-sphinx
|
| |
|
| |
+
|
| |
%description -n python-%{srcname}-doc
|
| |
Documentation for pikepdf
|
| |
+ %endif
|
| |
|
| |
|
| |
%prep
|
| |
%autosetup -n %{srcname}-%{version} -p1
|
| |
|
| |
- # Remove bundled egg-info
|
| |
- rm -rf src/%{srcname}.egg-info
|
| |
-
|
| |
+ %if %{with docs}
|
| |
# We don't build docs against the installed version, so force the version.
|
| |
sed -i -e "s/release = .\+/release = '%{version}'/g" docs/conf.py
|
| |
+ %endif
|
| |
+
|
| |
+
|
| |
+ %generate_buildrequires
|
| |
+ %pyproject_buildrequires -x test %{?with_docs:-x docs}
|
| |
|
| |
|
| |
%build
|
| |
- %py3_build
|
| |
+ %pyproject_wheel
|
| |
|
| |
+ %if %{with docs}
|
| |
# generate html docs
|
| |
+ export PYTHONPATH="%{pyproject_build_lib}"
|
| |
pushd docs
|
| |
- PYTHONPATH=$(ls -d ${PWD}/../build/lib*) sphinx-build-3 . ../html
|
| |
+ sphinx-build-3 . ../html
|
| |
popd
|
| |
# remove the sphinx-build leftovers
|
| |
rm -rf html/.{doctrees,buildinfo}
|
| |
+ %endif
|
| |
|
| |
|
| |
%install
|
| |
- %py3_install
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files %{srcname}
|
| |
|
| |
|
| |
%check
|
| |
- %{pytest} -ra
|
| |
+ %pytest
|
| |
|
| |
|
| |
- %files -n python3-%{srcname}
|
| |
+ %files -n python3-%{srcname} -f %{pyproject_files}
|
| |
%license LICENSE.txt
|
| |
%doc README.md
|
| |
- %{python3_sitearch}/%{srcname}/
|
| |
- %{python3_sitearch}/%{srcname}-%{version}-py%{python3_version}.egg-info/
|
| |
|
| |
+
|
| |
+ %if %{with docs}
|
| |
%files -n python-%{srcname}-doc
|
| |
%doc html
|
| |
%license LICENSE.txt
|
| |
+ %endif
|
| |
|
| |
|
| |
%changelog
|
| |
After a good bit of research, to get an EPEL 9 package of python-pikepdf I determined that we'll need to start with version 2.16.1 from the f34 branch. Before opening this PR I fast-forward merged f34 to epel9 to avoid this PR having 90+ commits. A few additional changes were needed to get this to build, and for buildrequirement sanity I went ahead and converted it to pyproject macros. Once merged and built this will resolve rhbz#2093516. This actually won't be able to be built until RHEL 9.2 is released, because that's when qpdf-devel is supposed to be added to CRB.