mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
FIXUP: Implement review comments
This commit is contained in:
parent
07921566ba
commit
e027d853c2
3 changed files with 12 additions and 7 deletions
|
@ -4,7 +4,9 @@ import sys
|
||||||
try:
|
try:
|
||||||
from . import vendor # type: ignore [attr-defined]
|
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:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
6
debian/rules
vendored
6
debian/rules
vendored
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
export PYBUILD_NAME=dangerzone
|
export PYBUILD_NAME=dangerzone
|
||||||
export DEB_BUILD_OPTIONS=nocheck
|
export DEB_BUILD_OPTIONS=nocheck
|
||||||
#export PYBUILD_INSTALL_ARGS=--install-lib=/usr/lib/python3/dist-packages
|
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/lib/python3/dist-packages
|
||||||
#export PYTHONDONTWRITEBYTECODE=1
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
#export DH_VERBOSE=1
|
export DH_VERBOSE=1
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --with python3 --buildsystem=pybuild
|
dh $@ --with python3 --buildsystem=pybuild
|
||||||
|
|
|
@ -22,16 +22,19 @@ def main():
|
||||||
container_requirements_txt = subprocess.check_output(cmd)
|
container_requirements_txt = subprocess.check_output(cmd)
|
||||||
|
|
||||||
print(f">>> Vendoring PyMuPDF under '{args.dest}'", file=sys.stderr)
|
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 = [
|
cmd = [
|
||||||
"python3",
|
sys.executable,
|
||||||
"-m",
|
"-m",
|
||||||
"pip",
|
"pip",
|
||||||
"install",
|
"install",
|
||||||
"--no-cache-dir",
|
"--no-cache-dir",
|
||||||
"--no-compile",
|
"--no-compile",
|
||||||
"-t",
|
"--target",
|
||||||
args.dest,
|
args.dest,
|
||||||
"-r",
|
"--requirements",
|
||||||
"/proc/self/fd/0", # XXX: pip does not read requirements.txt from stdin
|
"/proc/self/fd/0", # XXX: pip does not read requirements.txt from stdin
|
||||||
]
|
]
|
||||||
subprocess.check_output(cmd, input=container_requirements_txt)
|
subprocess.check_output(cmd, input=container_requirements_txt)
|
||||||
|
|
Loading…
Reference in a new issue