Skip to content

Commit

Permalink
conda: slightly improve script and recipes
Browse files Browse the repository at this point in the history
script: tighten channels

recipes: quote some potentially problematic variables (although in
practice it works with conda-build ATM, but it wouldn't in an
interactive bash)
  • Loading branch information
mara004 committed Nov 16, 2023
1 parent 9e73c75 commit 24839ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conda/bundle/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build:
entry_points:
- pypdfium2 = pypdfium2.__main__:cli_main
script_env:
- PDFIUM_PLATFORM=prepared!{{ pl_spec }}
- PDFIUM_PLATFORM="prepared!{{ pl_spec }}"
script:
- {{ PYTHON }} conda/prepare_script.py
- {{ PYTHON }} -m pip install . -v --no-deps --no-build-isolation
Expand Down
2 changes: 1 addition & 1 deletion conda/raw/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:
noarch: python
script_env:
- PYPDFIUM_MODULES=raw
- PDFIUM_PLATFORM=prepared!system:{{ pdfium_short }}
- PDFIUM_PLATFORM="prepared!system:{{ pdfium_short }}"
script:
- {{ PYTHON }} conda/prepare_script.py
- {{ PYTHON }} -m pip install . -v --no-deps --no-build-isolation
Expand Down
7 changes: 3 additions & 4 deletions setupsrc/pypdfium2_setup/craft_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
P_CONDA_RAW = "conda_raw"
P_CONDA_HELPERS = "conda_helpers"

CondaChannels = ("-c", "bblanchon", "-c", "pypdfium2-team")
CondaDir = ProjectDir / "conda"


Expand Down Expand Up @@ -110,7 +109,7 @@ def __exit__(self, *_):

def run_conda_build(recipe_dir, out_dir, args=[]):
with TmpCommitCtx():
run_cmd(["conda", "build", recipe_dir, "--output-folder", out_dir, *args, *CondaChannels], cwd=ProjectDir, env=os.environ)
run_cmd(["conda", "build", recipe_dir, "--output-folder", out_dir, *args], cwd=ProjectDir, env=os.environ)


CondaNames = {
Expand Down Expand Up @@ -171,7 +170,7 @@ def main_conda_raw(args):
os.environ["PDFIUM_FULL"] = ".".join([str(v) for v in PdfiumVer.to_full(args.pdfium_ver)])
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")
run_conda_build(CondaDir/"raw", CondaDir/"raw"/"out", args=["--override-channels", "-c", "bblanchon"])


def main_conda_helpers(args):
Expand All @@ -190,7 +189,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")
run_conda_build(CondaDir/"helpers", CondaDir/"helpers"/"out", args=["--override-channels", "-c", "pypdfium2-team", "-c", "bblanchon"])


class TmpCommitCtx:
Expand Down

0 comments on commit 24839ea

Please sign in to comment.