Skip to content

Commit f0518a8

Browse files
Chore: Use pdf_similar from diff_pdf_visually instead of pdfdiff (#22)
1 parent f07401a commit f0518a8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/run-tox.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
workflow_dispatch:
89

910
jobs:
1011
build:

dir_content_diff/base_comparators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import dictdiffer
99
import yaml
10-
from diff_pdf_visually import pdfdiff
10+
from diff_pdf_visually import pdf_similar
1111

1212
from dir_content_diff.util import diff_msg_formatter
1313

@@ -466,8 +466,8 @@ class PdfComparator(BaseComparator):
466466
def diff(self, ref, comp, *args, **kwargs):
467467
"""Compare data from two PDF files.
468468
469-
This function calls the `diff_pdf_visually.pdfdiff() <https://github.com/bgeron/diff-pdf-
470-
visually/blob/21e85f1db1bdaee5c0e8e0b730771d6c4e8c3e44/diff_pdf_visually/diff.py#L83>`_
469+
This function calls the `diff_pdf_visually.pdf_similar() <https://github.com/bgeron/diff-
470+
pdf-visually/blob/b5298cfaa6d74a3bf1c043817d1239678519ed71/diff_pdf_visually/diff.py#L85>`_
471471
function, read the doc of this function for details on args and kwargs.
472472
It compares the visual aspects of the PDF files, ignoring the invisible content (e.g. file
473473
header or invisible things like white font on white background). The PDF files are converted
@@ -483,4 +483,4 @@ def diff(self, ref, comp, *args, **kwargs):
483483
num_threads (int): If set to 2 (the default), the image conversion are processed in
484484
parallel. If set to 1 it is processed sequentially.
485485
"""
486-
return not pdfdiff(ref, comp, *args, **kwargs)
486+
return not pdf_similar(ref, comp, *args, **kwargs)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
]
2222
test_reqs = [
2323
"coverage",
24-
"dicttoxml",
24+
"dicttoxml<=1.7.12",
2525
"matplotlib",
2626
"rst2pdf>=0.99",
2727
"pytest",

0 commit comments

Comments
 (0)