Skip to content

Commit

Permalink
emplace: improve prints
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Nov 5, 2023
1 parent 6d860a4 commit 3f3dd40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions setupsrc/pypdfium2_setup/emplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def _get_pdfium_with_cache(pl_name, req_ver, req_flags, use_v8):
else:
update_binary = True

if update_binary: # TODO better repr
print(f"Updating to {req_ver} {req_flags}", file=sys.stderr)
if update_binary:
flags_repr = ":{%s}" % ",".join(req_flags) if req_flags else ""
print(f"Downloading binary {req_ver}{flags_repr} ...", file=sys.stderr)
update_pdfium.main([pl_name], version=req_ver, use_v8=use_v8)
else:
print("Using cache")
print("Using cached binary")

# build_pdfium_bindings() has its own cache logic, so always call to ensure bindings match
compile_lds = [DataDir/Host.platform] if pl_name == Host.platform else []
Expand Down
4 changes: 3 additions & 1 deletion setupsrc/pypdfium2_setup/packaging_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,11 @@ def build_pdfium_bindings(version, headers_dir=None, flags=[], run_lds=["."], **
if bind_path.exists() and ver_path.exists():
prev_info = read_json(ver_path)
if prev_info == curr_info:
print(f"Using cached bindings", file=sys.stderr)
return
else:
print(f"{prev_info} != {curr_info}")
print(f"Rebuilding bindings ...", file=sys.stderr)
# print(f"{prev_info} != {curr_info}", file=sys.stderr)

if not headers_dir.exists() or not list(headers_dir.glob("fpdf*.h")):
print("Downloading headers ...", file=sys.stderr)
Expand Down

0 comments on commit 3f3dd40

Please sign in to comment.