From 90013da958603bac231e685ce7392311cc100f4a Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Mar 20 2022 13:05:34 +0000 Subject: Update to 20220319 (close RHBZ#2065998) --- diff --git a/.gitignore b/.gitignore index e0d47a2..84fa7f8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /pdfminer.six-20200517.tar.xz /pdfminer.six-20200517-filtered.tar.xz /pdfminer.six-da5b96828efdb184f6410c43fea30f7b7c893dfb-filtered.tar.xz +/pdfminer.six-20220319-filtered.tar.xz diff --git a/python-pdfminer.spec b/python-pdfminer.spec index b266884..36eae5a 100644 --- a/python-pdfminer.spec +++ b/python-pdfminer.spec @@ -1,11 +1,3 @@ -# The import name is pdfminer. The upstream project name (as specified in -# setup.py) is pdfminer.six, which results in a canonical project name of -# pdfminer-six. -%global forgeurl https://github.com/pdfminer/pdfminer.six - -# When upstream forgets to tag a release, but it is available from PyPI: -%global commit da5b96828efdb184f6410c43fea30f7b7c893dfb - # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # @@ -13,8 +5,7 @@ %bcond_without doc_pdf Name: python-pdfminer -Version: 20211012 -%forgemeta +Version: 20220319 Release: %autorelease Summary: Tool for extracting information from PDF documents @@ -47,14 +38,14 @@ Summary: Tool for extracting information from PDF documents # the Adobe Glyph List License; but that this license is just an MIT variant # (https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT#AdobeGlyph). License: MIT and Public Domain and APAFML and BSD and (ASL 2.0 and MIT) -URL: %{forgeurl} +URL: https://github.com/pdfminer/pdfminer.six # This has the samples/ directory stripped out. While upstream claims the # sample PDFs are “freely distributable”, they have unclear or unspecified # licenses, which makes them unsuitable for Fedora. This applies especially, # but not exclusively, to the contents of samples/nonfree. # -# Generated with ./get_source.sh %%{version}, or ./get_source.sh %%{commit} -Source0: pdfminer.six-%{?commit:%{commit}}%{?!commit:%{version}}-filtered.tar.xz +# Generated with ./get_source.sh %%{version} +Source0: pdfminer.six-%{version}-filtered.tar.xz # Script to generate Source0; see comments above. Source1: get_source.sh # Man pages written by hand for Fedora in groff_man(7) format using the @@ -78,14 +69,7 @@ BuildRequires: latexmk # We do not generate BR’s from the “dev” extra because it includes an exact # version requirement on mypy (and we do not intend to do typechecking), and it -# pulls in tox (and the tox configuration currently builds the documentation as -# part of the tests, which we do not desire). - -# Note: this package still depends on deprecated -# nose/python3-nose/python3dist(nose). Upstream intends to migrate; see -# https://github.com/pdfminer/pdfminer.six/issues/498 for progress. -BuildRequires: python3dist(nose) -# However, we use pytest as a runner to more easily skip tests. +# pulls in nox and black. We just want to use plain pytest. BuildRequires: python3dist(pytest) %global common_description %{expand: \ @@ -125,6 +109,9 @@ Features: %package -n python3-pdfminer Summary: %{summary} +# The import name is pdfminer. The upstream project name (as specified in +# setup.py) is pdfminer.six, which results in a canonical project name of +# pdfminer-six. %py_provides python3-pdfminer-six # One file, pdfminer/_saslprep.py, is forked from from ASL 2.0 code by MongoDB, @@ -155,10 +142,11 @@ License: MIT %{common_description} +%pyproject_extras_subpkg -n python3-pdfminer image + + %prep -%autosetup -n pdfminer.six-%{?commit:%{commit}}%{?!commit:%{version}} -p1 -mkdir -p '_man' -cp -p '%{SOURCE2}' '%{SOURCE3}' '_man/' +%autosetup -n pdfminer.six-%{version} # Unbundle cmap data; it will be replaced in %%build. rm -vf cmaprsrc/* pdfminer/cmap/* @@ -168,10 +156,14 @@ sed -r -i '1{/^#!/d}' pdfminer/psparser.py # Fix unversioned Python shebangs %py3_shebang_fix tools +# Imitate the “publish” GitHub action, which sets the version metadata from the +# git tag when publishing to PyPI. See .github/workflows/actions.yml. +sed -r -i 's/__VERSION__/%{version}/g' pdfminer/__init__.py + %generate_buildrequires %if %{with doc_pdf} -%pyproject_buildrequires -x docs +%pyproject_buildrequires -x docs,image %else %pyproject_buildrequires -r %endif @@ -198,7 +190,8 @@ PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}' %pyproject_install %pyproject_save_files pdfminer -install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 _man/* +install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ + '%{SOURCE2}' '%{SOURCE3}' # Also, ship symlinks of the scripts without the .py extension. for script in pdf2txt dumppdf do @@ -207,9 +200,6 @@ done %check -# We do not use tox because it would test the documentation build; we don’t -# want to do that. -# # Skipped tests (and ignored files) are those that require the sample PDFs, # which are not included in our version of the source tarball. k="${k-}${k+ and }not TestDumpImages" @@ -219,8 +209,11 @@ k="${k-}${k+ and }not TestExtractText" k="${k-}${k+ and }not TestOpenFilename" k="${k-}${k+ and }not TestPdf2Txt" k="${k-}${k+ and }not TestPdfDocument" +k="${k-}${k+ and }not TestPdfPage" k="${k-}${k+ and }not test_font_size" k="${k-}${k+ and }not test_paint_path_quadrilaterals" +k="${k-}${k+ and }not test_pdf_with_empty_characters_horizontal" +k="${k-}${k+ and }not test_pdf_with_empty_characters_vertical" %pytest -k "${k-}" \ --ignore='tests/test_tools_dumppdf.py' \ diff --git a/sources b/sources index 29a3d9c..98909a5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pdfminer.six-da5b96828efdb184f6410c43fea30f7b7c893dfb-filtered.tar.xz) = 7874899502a022adb89a56d877c2c72afe4dde8ca236ccea10eca1340fa904516e04c143852570aa163dfb5e66dda468cdb6a5866fd119303ef87413c58e8eb7 +SHA512 (pdfminer.six-20220319-filtered.tar.xz) = 33527aecf990672d57c7bd15c43838d449eb5acf144f586293ac0799e75f24a3492c6c966a7b36146c14686ee33d3832518e10de6c64a7d0b627aff587f5a872