Skip to content

Commit

Permalink
FIXUP: Implement review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
apyrgio committed Oct 8, 2024
1 parent 0792156 commit e027d85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion dangerzone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
try:
from . import vendor # type: ignore [attr-defined]

sys.path.insert(0, vendor.__path__[0])
vendor_path = vendor.__path__[0]
print(f"Using vendored PyMuPDF libraries from '{vendor_path}'")
sys.path.insert(0, vendor_path)
except ImportError:
pass

Expand Down
6 changes: 3 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/make -f
export PYBUILD_NAME=dangerzone
export DEB_BUILD_OPTIONS=nocheck
#export PYBUILD_INSTALL_ARGS=--install-lib=/usr/lib/python3/dist-packages
#export PYTHONDONTWRITEBYTECODE=1
#export DH_VERBOSE=1
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/lib/python3/dist-packages
export PYTHONDONTWRITEBYTECODE=1
export DH_VERBOSE=1

%:
dh $@ --with python3 --buildsystem=pybuild
Expand Down
9 changes: 6 additions & 3 deletions install/linux/vendor-pymupdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ def main():
container_requirements_txt = subprocess.check_output(cmd)

print(f">>> Vendoring PyMuPDF under '{args.dest}'", file=sys.stderr)
# We prefer to call the CLI version of `pip`, instead of importing it directly, as
# instructed here:
# https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program
cmd = [
"python3",
sys.executable,
"-m",
"pip",
"install",
"--no-cache-dir",
"--no-compile",
"-t",
"--target",
args.dest,
"-r",
"--requirements",
"/proc/self/fd/0", # XXX: pip does not read requirements.txt from stdin
]
subprocess.check_output(cmd, input=container_requirements_txt)
Expand Down

0 comments on commit e027d85

Please sign in to comment.