Skip to content

Commit

Permalink
FIXUP: Various CI-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apyrgio committed Jun 17, 2024
1 parent 91963c0 commit 8f918c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install poetry
- run: poetry install
- name: Restore cached tessdata
uses: actions/cache/restore@v4
with:
path: share/tessdata/
enableCrossOsArchive: true
fail-on-cache-miss: true
key: v1-tessdata-${{ hashFiles('./install/common/download-tessdata.py') }}
- run: pip install poetry
- run: poetry install
- name: Run CLI tests
run: poetry run make test
# Taken from: https://github.com/orgs/community/discussions/27149#discussioncomment-3254829
Expand Down
10 changes: 8 additions & 2 deletions dangerzone/isolation_provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,14 @@ def pixels_to_pdf_page(
page_pdf_bytes = self.ocr_page(pixmap, ocr_lang)
else: # Don't OCR
page_doc = fitz.Document()
page_doc.insert_file(pixmap)
page_pdf_bytes = page_doc.tobytes(deflate_images=True)
# Added in PyMuPDF 1.22.0 (commit 6a9c9d8175c307f7f3baf605c8632745f69a8b1b)
if hasattr(page_doc, "insert_file"):
page_doc.insert_file(pixmap)
page_pdf_bytes = page_doc.tobytes(deflate_images=True)
else:
page = page_doc.newPage()
page.insertImage(page.rect, pixmap=pixmap)
page_pdf_bytes = page_doc.write(deflate=True)

return fitz.open("pdf", page_pdf_bytes)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python = ">=3.9,<3.13"
click = "*"
appdirs = "*"
PySide6 = "^6.7.1"
PyMuPDF = "^1.23.8"
PyMuPDF = "^1.16.11"
colorama = "*"
pyxdg = {version = "*", platform = "linux"}
requests = "*"
Expand Down
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
Package3: dangerzone
Depends3: podman, python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging, python3-fitz (>= 1.19.0) | pyocr
Depends3: podman, python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging, python3-fitz (>= 1.19.0) | python3-pyocr
Build-Depends: dh-python, python3, python3-setuptools, python3-stdeb
Suite: bionic
X-Python3-Version: >= 3.8
Expand Down

0 comments on commit 8f918c8

Please sign in to comment.