diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ecec790..6946ca5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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 diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index 1fe5342..dccc145 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -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") @@ -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, "..")) @@ -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()