From 3fd35cf8279a94358c3b0545eb19cdc980d1ce11 Mon Sep 17 00:00:00 2001 From: mara004 Date: Sun, 19 May 2024 16:15:07 +0200 Subject: [PATCH] Fix conda packaging (upstream behavior change) (#314) * Try to fix conda not finding external deps * Prepare changelog --- README.md | 2 +- docs/devel/changelog_staging.md | 2 ++ setupsrc/pypdfium2_setup/craft_packages.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 628da8ad4..45ce02267 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ pypdfium2 includes helpers to simplify common use cases, while the raw PDFium/ct Alternatively, with temporary channel config: ```bash - conda install pypdfium2-team::pypdfium2_helpers --override-channels -c pypdfium2-team -c bblanchon + conda install pypdfium2-team::pypdfium2_helpers --override-channels -c pypdfium2-team -c bblanchon -c defaults ``` Adding the channels permanently and tightening priority is encouraged to include pypdfium2 in `conda update` by default, and to avoid accidentally replacing the install with a different channel. (If desired, you may limit the channel config to the current environment by adding `--env`.) diff --git a/docs/devel/changelog_staging.md b/docs/devel/changelog_staging.md index 7d1bd5f3e..c14b1f852 100644 --- a/docs/devel/changelog_staging.md +++ b/docs/devel/changelog_staging.md @@ -6,3 +6,5 @@ # Changelog for next release - `PdfPage.get_objects()`: Don't register pageobjects as children, because they don't need to be closed by the caller when part of a page. This avoids excessive caching of weakrefs that are not cleaned up with the object they refer to. - Autorelease: Swapped default condition for minor/patch update, as pypdfium2 changes are likely more API-significant than pdfium updates. Added ability for manual override. +- Fixed conda packaging: It is now required to explicitly specify `-c defaults` with `--override-channels`, presumably due to an upstream change. +- Bumped workflows to Python 3.12. diff --git a/setupsrc/pypdfium2_setup/craft_packages.py b/setupsrc/pypdfium2_setup/craft_packages.py index 8580cdf00..de42bc421 100644 --- a/setupsrc/pypdfium2_setup/craft_packages.py +++ b/setupsrc/pypdfium2_setup/craft_packages.py @@ -138,7 +138,7 @@ def main_conda_raw(args): os.environ["BUILD_NUM"] = str(_get_build_num(args)) emplace_func = partial(prepare_setup, ExtPlats.system, args.pdfium_ver, use_v8=None) with CondaExtPlatfiles(emplace_func): - run_conda_build(CondaDir/"raw", CondaDir/"raw"/"out", args=["--override-channels", "-c", "bblanchon"]) + run_conda_build(CondaDir/"raw", CondaDir/"raw"/"out", args=["--override-channels", "-c", "bblanchon", "-c", "defaults"]) def main_conda_helpers(args): @@ -149,7 +149,7 @@ def main_conda_helpers(args): # NOTE To build with a local pypdfium2_raw, add the args below for the source dir, and remove the pypdfium2-team prefix from the helpers recipe's run requirements # args=["-c", CondaDir/"raw"/"out"] - run_conda_build(CondaDir/"helpers", CondaDir/"helpers"/"out", args=["--override-channels", "-c", "pypdfium2-team", "-c", "bblanchon"]) + run_conda_build(CondaDir/"helpers", CondaDir/"helpers"/"out", args=["--override-channels", "-c", "pypdfium2-team", "-c", "bblanchon", "-c", "defaults"]) class ArtifactStash: