graphics/py-img2pdf: Update to 0.5.0

Changelog:

https://github.com/josch/img2pdf/blob/0.5.0/CHANGES.rst
This commit is contained in:
Kai Knoblich 2023-10-31 13:27:52 +01:00
parent ee97e81743
commit 608775544e
3 changed files with 5 additions and 36 deletions

View file

@ -1,6 +1,5 @@
PORTNAME= img2pdf
DISTVERSION= 0.4.4
PORTREVISION= 3
DISTVERSION= 0.5.0
CATEGORIES= graphics python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -25,7 +24,7 @@ USES= python shebangfix magick:6,test
USE_PYTHON= autoplist concurrent distutils pytest
# Some tests fail, see following link for more info:
# https://gitlab.mister-muffin.de/josch/img2pdf/issues/152
PYTEST_BROKEN_TESTS= jpg_cmyk tiff_cmyk8
PYTEST_BROKEN_TESTS= jpg_cmyk miff_cmyk8 test_date tiff_cmyk8
SHEBANG_FILES= src/img2pdf.py
TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1680120812
SHA256 (img2pdf-0.4.4.tar.gz) = 8ec898a9646523fd3862b154f3f47cd52609c24cc3e2dc1fb5f0168f0cbe793c
SIZE (img2pdf-0.4.4.tar.gz) = 97796
TIMESTAMP = 1698568095
SHA256 (img2pdf-0.5.0.tar.gz) = ae6c19731bde2551356c178bf356ca118ac32a232c737a14b423f8039df3c24b
SIZE (img2pdf-0.5.0.tar.gz) = 103853

View file

@ -1,30 +0,0 @@
Fix value errors for some tests:
> psnr = float(psnr.strip(b"0"))
E ValueError: could not convert string to float: b'61.5441 (0.615441)'
src/img2pdf_test.py:347: ValueError
Obtained from:
https://gitlab.mister-muffin.de/josch/img2pdf/issues/152
--- src/img2pdf_test.py.orig 2023-03-30 18:01:47 UTC
+++ src/img2pdf_test.py
@@ -345,7 +345,7 @@ def compare(im1, im2, exact, icc, cmyk):
stderr=subprocess.PIPE,
).stderr
assert psnr != b"0"
- psnr = float(psnr.strip(b"0"))
+ psnr = float(psnr.split()[0])
assert psnr != 0 # or otherwise we would use the exact variant
assert psnr > 50
@@ -501,7 +501,7 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True
stderr=subprocess.PIPE,
).stderr
assert psnr != b"0"
- psnr = float(psnr.strip(b"0"))
+ psnr = float(psnr.split()[0])
assert psnr != 0 # or otherwise we would use the exact variant
assert psnr > 50
(tmpdir / "images-000.png").unlink()