Skip to content

Commit

Permalink
require explicit build number
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Nov 22, 2023
1 parent 3456cdb commit a2ba356
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/autorelease_conda_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():
search = reversed(json.loads(search)["pypdfium2_raw"])

# determine build number
# TODO `search` is ordered descendingly, so we could break the iteration when we find a matching version. though for a new version, we have to traverse the full list anyway...
# TODO `search` seems to be ordered by date, so we could probably break the iteration when we find a matching version. though for a new version, we have to traverse the full list anyway...
build = max([d["build_number"] for d in search if int(d["version"]) == args.pdfium_ver], default=None)
build = 0 if build is None else build+1
print(build, file=sys.stderr)
Expand Down
5 changes: 2 additions & 3 deletions setupsrc/pypdfium2_setup/craft_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ def main_conda_bundle(args):
def main_conda_raw(args):
os.environ["PDFIUM_SHORT"] = str(args.pdfium_ver)
os.environ["PDFIUM_FULL"] = ".".join([str(v) for v in PdfiumVer.to_full(args.pdfium_ver)])
build_num = 0
if CondaRaw_BuildNumF.exists():
build_num = int(CondaRaw_BuildNumF.read_text().strip())
assert CondaRaw_BuildNumF.exists(), "build number must be given explicitly through conda/raw/build_num.txt - run autorelease_conda_raw.py to create"
build_num = int(CondaRaw_BuildNumF.read_text().strip())
os.environ["BUILD_NUM"] = str(build_num)
emplace_func = partial(prepare_setup, ExtPlats.system, args.pdfium_ver, use_v8=None)
with CondaExtPlatfiles(emplace_func):
Expand Down

0 comments on commit a2ba356

Please sign in to comment.