Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Sep 26, 2023
1 parent 1917473 commit fc1b522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 35 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,20 @@ jobs:
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libavif.cmd"

- name: Install dependencies / Pillow
run: "& winbuild\\build\\install_pillow.cmd"

# trim ~150MB x 9
- name: Optimize build cache
if: steps.build-cache.outputs.cache-hit != 'true'
run: rmdir /S /Q winbuild\build\src
shell: cmd

- name: Install dependencies / Pillow
run: |
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe -m pip install -v Pillow"
shell: pwsh

- name: Build pillow-avif-plugin
run: "& winbuild\\build\\build_pillow_avif_plugin.cmd install"
run: |
cmd /c "winbuild\build\build_env.cmd && $env:pythonLocation\python.exe setup.py build_ext install"
shell: pwsh

# failing with PyPy3
Expand Down
32 changes: 1 addition & 31 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,6 @@ def build_dep_all() -> None:
write_script("build_dep_all.cmd", lines)


def install_pillow():
lines = [
"@echo on",
"@echo ---- Installing pillow ----",
r'"{python_dir}\{python_exe}" -m pip install Pillow',
"@echo Pillow installed successfully",
]
write_script("install_pillow.cmd", lines)


def install_meson():
msi_url = "https://github.com/mesonbuild/meson/releases/download/0.56.2/meson-0.56.2-64.msi" # noqa: E501
msi_file = os.path.join(args.depends_dir, "meson-0.56.2-64.msi")
Expand All @@ -465,24 +455,6 @@ def install_meson():
write_script("install_meson.cmd", lines)


def build_pillow_avif_plugin():
lines = (
[
"@echo ---- Building pillow-avif-plugin (build_ext %*) ----",
cmd_cd("{pillow_avif_plugin_dir}"),
]
+ prefs["header"]
+ [
cmd_set("DISTUTILS_USE_SDK", "1"), # use same compiler to build pillow-avif
cmd_set("MSSdk", "1"), # for PyPy3.6
cmd_set("py_vcruntime_redist", "true"), # use /MD, not /MT
r'"{python_dir}\{python_exe}" setup.py build_ext %*',
]
)

write_script("build_pillow_avif_plugin.cmd", lines)


if __name__ == "__main__":
winbuild_dir = os.path.dirname(os.path.realpath(__file__))
pillow_dir = os.path.realpath(os.path.join(winbuild_dir, ".."))
Expand Down Expand Up @@ -599,7 +571,5 @@ def build_pillow_avif_plugin():

write_script(".gitignore", ["*"])
build_env()
build_dep_all()
install_pillow()
install_meson()
build_pillow_avif_plugin()
build_dep_all()

0 comments on commit fc1b522

Please sign in to comment.