diff --git a/.github/workflows/wheels-test.cmd b/.github/workflows/wheels-test.cmd index 7e135befe3c..68c5980abb2 100644 --- a/.github/workflows/wheels-test.cmd +++ b/.github/workflows/wheels-test.cmd @@ -1,3 +1,3 @@ echo TODO!!!! - +set diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9f08b6c2444..a7e24e8386e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -105,16 +105,36 @@ jobs: # Install extra test images xcopy /S /Y Tests\test-images\* Tests\images + & python.exe -m pip install cibuildwheel==2.16.2 + & python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.arch }} shell: pwsh - name: Build wheels - uses: pypa/cibuildwheel@v2.16.2 - with: - output-dir: wheelhouse + run: | + setlocal EnableDelayedExpansion + for %%f in (winbuild\build\license\*) do ( + set x=%%~nf + rem Skip FriBiDi license, it is not included in the wheel. + set fribidi=!x:~0,7! + if NOT !fribidi!==fribidi ( + rem Skip imagequant license, it is not included in the wheel. + set libimagequant=!x:~0,13! + if NOT !libimagequant!==libimagequant ( + echo. >> LICENSE + echo ===== %%~nf ===== >> LICENSE + echo. >> LICENSE + type %%f >> LICENSE + ) + ) + ) + call winbuild\\build\\build_env.cmd + %pythonLocation%\python.exe -m cibuildwheel . --output-dir wheelhouse env: CIBW_ARCHS: ${{ matrix.cibw_arch }} - CIBW_BEFORE_ALL: "call {package}\\winbuild\\build\\build_dep_all.cmd" CIBW_CONFIG_SETTINGS: raqm=enable raqm=vendor fribidi=vendor + CIBW_BEFORE_ALL: "{package}\\winbuild\\build\\build_dep_all.cmd" + CIBW_TEST_COMMAND: "cd /d {project} && call .github/workflows/wheels-test.cmd" + shell: cmd - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 71719b1cf67..70572b99435 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,10 +82,6 @@ before-all = ".github/workflows/wheels-dependencies.sh" test-command = "cd {project} && .github/workflows/wheels-test.sh" test-extras = "tests" -[[tool.cibuildwheel.overrides]] -select = "*-win*" -test-command = "cd /d {project} && call .github/workflows/wheels-test.cmd" - [tool.ruff] line-length = 88 select = [ diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index 81970a2c55a..34b694a94e7 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -567,23 +567,25 @@ def build_dep(name: str) -> str: *get_footer(dep), ] - if "GITHUB_ACTIONS" in os.environ: - lines = [f"echo ::group::{banner}", *lines, "echo ::endgroup::"] - write_script(file, lines) return file def build_dep_all() -> None: lines = [r'call "{build_dir}\build_env.cmd"'] + gha_groups = "GITHUB_ACTIONS" in os.environ for dep_name in DEPS: print() if dep_name in disabled: print(f"Skipping disabled dependency {dep_name}") continue script = build_dep(dep_name) + if gha_groups: + lines.append(f"@echo ::group::Running {script}") lines.append(rf'cmd.exe /c "{{build_dir}}\{script}"') lines.append("if errorlevel 1 echo Build failed! && exit /B 1") + if gha_groups: + lines.append("@echo ::endgroup::") print() lines.append("@echo All Pillow dependencies built successfully!") write_script("build_dep_all.cmd", lines)