From fdbb1870d44b2a831d37b0545f5bdba2d147518e Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 08:52:46 -0500 Subject: [PATCH 01/63] CI: Add a cygwin run to GitHub Actions. Requested for the _imagingtk fix. --- .github/workflows/test-cygwin.yml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/test-cygwin.yml diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml new file mode 100644 index 00000000000..4275e65a67b --- /dev/null +++ b/.github/workflows/test-cygwin.yml @@ -0,0 +1,48 @@ +name: Test Cygwin + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: windows-2019 + name: Cygwin Python 3.8 + + steps: + - name: Checkout Pillow + uses: actions/checkout@v2 + - name: Set up Cygwin + uses: egor-tensin/setup-cygwin@v3 + with: + platform: x64 + packages: > + python38-devel python38-tkinter libfreetype-devel + libimagequant-devel libjpeg-devel liblcms2-devel + libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel + libxcb-devel python38-olefile python38-pathlib + python38-numpy netpbm ImageMagick jpeg xorg-server-extra + xorg-server-common xinit python38-setuptools + python38-wheel + install-dir: 'C:\tools\cygwin' + - name: Clean up path + uses: egor-tensin/cleanup-path@v2 + with: + dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' + - name: Build Pillow + shell: 'C:\tools\cygwin\bin\dash.exe' + run: | + /usr/bin/python3.8 setup.py bdist_wheel + - name: Install Pillow + shell: 'C:\tools\cygwin\bin\dash.exe' + run: | + /usr/bin/python3.8 -m pip install Pillow-*-cp38-cp38-cygwin_*_x86_64.whl + - name: Test Pillow + shell: 'C:\tools\cygwin\bin\dash.exe' + run: | + /usr/bin/python3.8 selftest.py + xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From 67bef87a070af4e239707de64670ac833031e46c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 18:19:22 -0500 Subject: [PATCH 02/63] CI: Specify where the command line goes in the shell. I think this is how specifying the shell works. The documentation isn't terribly clear. --- .github/workflows/test-cygwin.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 4275e65a67b..c22fe2bec70 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -34,15 +34,15 @@ jobs: with: dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' - name: Build Pillow - shell: 'C:\tools\cygwin\bin\dash.exe' + shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | /usr/bin/python3.8 setup.py bdist_wheel - name: Install Pillow - shell: 'C:\tools\cygwin\bin\dash.exe' + shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | /usr/bin/python3.8 -m pip install Pillow-*-cp38-cp38-cygwin_*_x86_64.whl - name: Test Pillow - shell: 'C:\tools\cygwin\bin\dash.exe' + shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | /usr/bin/python3.8 selftest.py xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From b798989f33b4ef275360cb491d0c555079fd899e Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 19:08:28 -0500 Subject: [PATCH 03/63] CI: Make sure all python requirements are installed in Cygwin CI. For some reason wheel wasn't installed properly. --- .github/workflows/test-cygwin.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index c22fe2bec70..cb0c84ef53c 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -21,18 +21,24 @@ jobs: with: platform: x64 packages: > - python38-devel python38-tkinter libfreetype-devel - libimagequant-devel libjpeg-devel liblcms2-devel - libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel - libxcb-devel python38-olefile python38-pathlib - python38-numpy netpbm ImageMagick jpeg xorg-server-extra - xorg-server-common xinit python38-setuptools - python38-wheel + libfreetype-devel libimagequant-devel libjpeg-devel + liblcms2-devel libopenjp2-devel libraqm-devel + libtiff-devel libwebp-devel libxcb-devel netpbm + ImageMagick jpeg xorg-server-extra xorg-server-common + xinit python38-setuptools python38-devel python38-tkinter + python38-wheel python38-pip python38-olefile + python38-numpy python38-pytest python38-sphinx + python38-packaging python38-cffi install-dir: 'C:\tools\cygwin' - name: Clean up path uses: egor-tensin/cleanup-path@v2 with: dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' + - name: Ensure python dependencies installed + shell: 'C:\tools\cygwin\bin\dash.exe {0}' + run: | + /usr/bin/python3.8 -m pip install pip wheel setuptools + /usr/bin/python3.8 -m pip install -r requirements.txt - name: Build Pillow shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | From a4495decf878298abb8b379251c6cf98aa662736 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 19:57:44 -0500 Subject: [PATCH 04/63] CI: Stop using dash so the DOS line endings don't throw things off. --- .github/workflows/test-cygwin.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index cb0c84ef53c..904658f80a2 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -29,26 +29,23 @@ jobs: python38-wheel python38-pip python38-olefile python38-numpy python38-pytest python38-sphinx python38-packaging python38-cffi + libfribidi-devel zlib-devel libX11-xcb-devel tcl-tk-devel install-dir: 'C:\tools\cygwin' - name: Clean up path uses: egor-tensin/cleanup-path@v2 with: dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' - name: Ensure python dependencies installed - shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | - /usr/bin/python3.8 -m pip install pip wheel setuptools - /usr/bin/python3.8 -m pip install -r requirements.txt + C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools + C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt - name: Build Pillow - shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | - /usr/bin/python3.8 setup.py bdist_wheel + C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel - name: Install Pillow - shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | - /usr/bin/python3.8 -m pip install Pillow-*-cp38-cp38-cygwin_*_x86_64.whl + C:\tools\cygwin\bin\python3.8 -m pip install Pillow-*-cp38-cp38-cygwin_*_x86_64.whl - name: Test Pillow - shell: 'C:\tools\cygwin\bin\dash.exe {0}' run: | - /usr/bin/python3.8 selftest.py - xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + C:\tools\cygwin\bin\python3.8 selftest.py + C:\tools\cygwin\bin\xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From 8ebac45f24fa53bcdb148b418222b41db0455626 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:14:41 -0500 Subject: [PATCH 05/63] CI: Explicitly use dash to get shell globbing. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 904658f80a2..c1404b2c68b 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -44,7 +44,7 @@ jobs: C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel - name: Install Pillow run: | - C:\tools\cygwin\bin\python3.8 -m pip install Pillow-*-cp38-cp38-cygwin_*_x86_64.whl + C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install *.whl' - name: Test Pillow run: | C:\tools\cygwin\bin\python3.8 selftest.py From cd087c600775c52af65a1a3ea6ff9818718f63a9 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:20:47 -0500 Subject: [PATCH 06/63] CI: Fix the path to the build wheels. setup.py bdist_wheel goes to dist/*.whl pip wheel goes to *.whl --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index c1404b2c68b..ff496443b00 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -44,7 +44,7 @@ jobs: C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel - name: Install Pillow run: | - C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install *.whl' + C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install dist/*.whl' - name: Test Pillow run: | C:\tools\cygwin\bin\python3.8 selftest.py From 1daaf9273ceb94fd15e84cbe4f9f095ed7f6669c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:53:43 -0500 Subject: [PATCH 07/63] CI: Split the config check from the actual test. I'm using selftest.py to check whether I've installed everything. Pytest actually finds and runs the tests. For some reason that wasn't running earlier. --- .github/workflows/test-cygwin.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index ff496443b00..94711051441 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -45,7 +45,9 @@ jobs: - name: Install Pillow run: | C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install dist/*.whl' - - name: Test Pillow + - name: Check Pillow configuration run: | C:\tools\cygwin\bin\python3.8 selftest.py + - name: Test Pillow + run: | C:\tools\cygwin\bin\xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From 9ec4034bff2f03bac37ac0ec0e60f4c0bbaf3313 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 11 Dec 2021 08:26:24 -0500 Subject: [PATCH 08/63] CI: Incorporate suggestions from PR. Upload coverage information, add Cygwin to the list of systems with CI, space out entries. --- .github/workflows/test-cygwin.yml | 28 ++++++++++++++++++++-------- docs/installation.rst | 2 ++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 94711051441..d7c74e7bc65 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -1,12 +1,6 @@ name: Test Cygwin -on: - push: - branches: - - main - pull_request: - branches: - - main +on: [push, pull_request, workflow_dispatch] jobs: build: @@ -16,6 +10,7 @@ jobs: steps: - name: Checkout Pillow uses: actions/checkout@v2 + - name: Set up Cygwin uses: egor-tensin/setup-cygwin@v3 with: @@ -31,23 +26,40 @@ jobs: python38-packaging python38-cffi libfribidi-devel zlib-devel libX11-xcb-devel tcl-tk-devel install-dir: 'C:\tools\cygwin' + - name: Clean up path uses: egor-tensin/cleanup-path@v2 with: dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' - - name: Ensure python dependencies installed + + - name: Build system information + run: C:\tools\cygwin\bin\python3.8 .github/workflows/system-info.py + + - name: Ensure Python dependencies are installed run: | C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt + - name: Build Pillow run: | C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel + - name: Install Pillow run: | C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install dist/*.whl' + - name: Check Pillow configuration run: | C:\tools\cygwin\bin\python3.8 selftest.py + - name: Test Pillow run: | C:\tools\cygwin\bin\xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + + - name: After success + run: | + C:\tools\cygwin\bin\dash .ci/after_success.sh + + - name: Upload coverage + run: | + C:\tools\cygwin\bin\bash -c 'bash <(curl -s https://codecov.io/bash) -F' diff --git a/docs/installation.rst b/docs/installation.rst index 1fb6897d279..3e5123c7a53 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -460,6 +460,8 @@ These platforms are built and tested for every change. +----------------------------------+----------------------------+---------------------+ | CentOS Stream 8 | 3.9 | x86-64 | +----------------------------------+----------------------------+---------------------+ +| Cygwin | 3.8 | x86-64 | ++----------------------------------+----------------------------+---------------------+ | Debian 10 Buster | 3.7 | x86 | +----------------------------------+----------------------------+---------------------+ | Fedora 34 | 3.9 | x86-64 | From 407abbfa186d545cd2dc4850c0f6f4d29032c386 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:12:31 -0500 Subject: [PATCH 09/63] CI: Try to get tests fully working The actual test step wasn't running, so try to run that as a shell script rather than an executable. Also get more of the dependencies installed. --- .github/workflows/test-cygwin.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index d7c74e7bc65..24bd6a2be20 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -23,8 +23,7 @@ jobs: xinit python38-setuptools python38-devel python38-tkinter python38-wheel python38-pip python38-olefile python38-numpy python38-pytest python38-sphinx - python38-packaging python38-cffi - libfribidi-devel zlib-devel libX11-xcb-devel tcl-tk-devel + python38-packaging python38-cffi python38-requests install-dir: 'C:\tools\cygwin' - name: Clean up path @@ -54,11 +53,11 @@ jobs: - name: Test Pillow run: | - C:\tools\cygwin\bin\xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh - name: After success run: | - C:\tools\cygwin\bin\dash .ci/after_success.sh + C:\tools\cygwin\bin\bash .ci/after_success.sh - name: Upload coverage run: | From 4cfb1a854f531afdab4c0c4bb7a4fc6fc754e69a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:13:56 -0500 Subject: [PATCH 10/63] CI: Use the new GitHub Action for codecov The old bash downloader will be removed soon. --- .github/workflows/test-cygwin.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 24bd6a2be20..8bb3e4cdd4d 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -60,5 +60,8 @@ jobs: C:\tools\cygwin\bin\bash .ci/after_success.sh - name: Upload coverage - run: | - C:\tools\cygwin\bin\bash -c 'bash <(curl -s https://codecov.io/bash) -F' + uses: codecov/codecov-actions@v2 + with: + file: ./coverage.xml + flags: GHA_Cygwin + name: ${{ runner.os }} Cygwin Python 3.8 ${{ matrix.architecture }} From 90cf149cbe9449934767eba376f690d37b1cc53a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:17:28 -0500 Subject: [PATCH 11/63] CI: Fix the spelling on the codecov repository. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 8bb3e4cdd4d..6215b72f8f5 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -60,7 +60,7 @@ jobs: C:\tools\cygwin\bin\bash .ci/after_success.sh - name: Upload coverage - uses: codecov/codecov-actions@v2 + uses: codecov/codecov-action@v2 with: file: ./coverage.xml flags: GHA_Cygwin From 7fd3e9977e7dd0c04e4e72fdc65f59253f0e6281 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:59:45 -0500 Subject: [PATCH 12/63] CI: Make sure correct version of python is used for testing. Cygwin is trying to use the highest-available Python version. One of the Python packages has scripts in /usr/bin that should be in the python39- subpackage. --- .ci/test.sh | 4 ++-- .github/workflows/test-cygwin.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 8ff7c5f6483..b0f019d6607 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -2,6 +2,6 @@ set -e -python3 -c "from PIL import Image" +python3$1 -c "from PIL import Image" -python3 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE +python3$1 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 6215b72f8f5..bbe5eccee72 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,7 +53,8 @@ jobs: - name: Test Pillow run: | - C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + C:\tools\cygwin\bin\dash -c "mv .ci/test.sh .ci/test.sh.dos && /bin/tr -d '\r' <.ci/test.sh.dos >test.sh" + C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 - name: After success run: | From 1c25d95d5abf3ae8b4de6b4e55d42c8f8593cf80 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 18 Dec 2021 09:55:24 -0500 Subject: [PATCH 13/63] CI: Get cygwin tests running They segfault in one of the NumPy tests, but they run. --- .github/workflows/test-cygwin.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index bbe5eccee72..d3ab0a36149 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,7 +53,9 @@ jobs: - name: Test Pillow run: | - C:\tools\cygwin\bin\dash -c "mv .ci/test.sh .ci/test.sh.dos && /bin/tr -d '\r' <.ci/test.sh.dos >test.sh" + C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos + C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh" + C:\tools\cygwin\bin\chmod u+x .ci/test.sh C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 - name: After success @@ -66,3 +68,10 @@ jobs: file: ./coverage.xml flags: GHA_Cygwin name: ${{ runner.os }} Cygwin Python 3.8 ${{ matrix.architecture }} + + - name: After failure + if: failure() + run: | + C:\tools\cygwin\bin\uname -a + C:\tools\cygwin\bin\python3.8 -m pip list + C:\tools\cygwin\bin\python3.8 -m pip show --files Pillow From b9fee08c5911dcdb38d320260589cce3229c5c72 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 18 Dec 2021 10:00:14 -0500 Subject: [PATCH 14/63] TST: Parametrize numpy roundtrip to find failing case Segfaults are annoying to debug. --- .github/workflows/test-cygwin.yml | 2 ++ Tests/test_numpy.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index d3ab0a36149..b6a305b7151 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -38,6 +38,7 @@ jobs: run: | C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt + C:\tools\cygwin\bin\python3.8 -m pip install pytest-forked - name: Build Pillow run: | @@ -56,6 +57,7 @@ jobs: C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh" C:\tools\cygwin\bin\chmod u+x .ci/test.sh + C:\tools\cygwin\bin\python3.8 -m pytest --forked Tests/test_numpy.py -k roundtrip C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 - name: After success diff --git a/Tests/test_numpy.py b/Tests/test_numpy.py index def7adf3f02..936474fe8d2 100644 --- a/Tests/test_numpy.py +++ b/Tests/test_numpy.py @@ -189,8 +189,9 @@ def test_putdata(): assert len(im.getdata()) == len(arr) -def test_roundtrip_eye(): - for dtype in ( +@pytest.mark.parametrize( + "dtype", + ( bool, numpy.bool8, numpy.int8, @@ -202,9 +203,11 @@ def test_roundtrip_eye(): float, numpy.float32, numpy.float64, - ): - arr = numpy.eye(10, dtype=dtype) - numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr))) + ), +) +def test_roundtrip_eye(dtype): + arr = numpy.eye(10, dtype=dtype) + numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr))) def test_zero_size(): From 77c8a07f1c6f5330146a31023de06d6f541e4735 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 16 Dec 2021 12:28:30 -0500 Subject: [PATCH 15/63] DOC: Rearrange the Cygwin entries on the support matrix. From a suggestion on the PR, make it clearer that Cygwin runs on Windows. Also record the Cygwin versions in the check against Python versions. --- docs/installation.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 3e5123c7a53..d77e2742f2c 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -460,8 +460,6 @@ These platforms are built and tested for every change. +----------------------------------+----------------------------+---------------------+ | CentOS Stream 8 | 3.9 | x86-64 | +----------------------------------+----------------------------+---------------------+ -| Cygwin | 3.8 | x86-64 | -+----------------------------------+----------------------------+---------------------+ | Debian 10 Buster | 3.7 | x86 | +----------------------------------+----------------------------+---------------------+ | Fedora 34 | 3.9 | x86-64 | @@ -482,6 +480,8 @@ These platforms are built and tested for every change. | Windows Server 2019 | 3.7, 3.8, 3.9, 3.10, PyPy3 | x86, x86-64 | | +----------------------------+---------------------+ | | 3.9/MinGW | x86, x86-64 | +| +----------------------------+---------------------+ +| | 3.8/Cygwin | x86-64 | +----------------------------------+----------------------------+---------------------+ @@ -560,6 +560,8 @@ These platforms have been reported to work at the versions mentioned. +----------------------------------+---------------------------+------------------+--------------+ | Windows 10 | 3.7 | 7.1.0 |x86-64 | +----------------------------------+---------------------------+------------------+--------------+ +| Windows 10/Cygwin 3.3 | 3.6, 3.7, 3.8, 3.9 | 8.4.0 |x86-64 | ++----------------------------------+---------------------------+------------------+--------------+ | Windows 8.1 Pro | 2.6, 2.7, 3.2, 3.3, 3.4 | 2.4.0 |x86,x86-64 | +----------------------------------+---------------------------+------------------+--------------+ | Windows 8 Pro | 2.6, 2.7, 3.2, 3.3, 3.4a3 | 2.2.0 |x86,x86-64 | From 7ad8fdb67796300ab52e97e432bfe34d17860ad7 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:34:30 -0500 Subject: [PATCH 16/63] CI: Get all the tests running on Cygwin. --- .github/workflows/test-cygwin.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index b6a305b7151..f43460293b8 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -18,12 +18,13 @@ jobs: packages: > libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel libraqm-devel - libtiff-devel libwebp-devel libxcb-devel netpbm - ImageMagick jpeg xorg-server-extra xorg-server-common - xinit python38-setuptools python38-devel python38-tkinter - python38-wheel python38-pip python38-olefile - python38-numpy python38-pytest python38-sphinx - python38-packaging python38-cffi python38-requests + libtiff-devel libwebp-devel libxcb-devel libpng-devel + netpbm ImageMagick jpeg xorg-server-extra + xorg-server-common xinit subversion python38-setuptools + python38-devel python38-tkinter python38-wheel + python38-pip python38-olefile python38-numpy + python38-pytest python38-sphinx python38-packaging + python38-cffi python38-requests install-dir: 'C:\tools\cygwin' - name: Clean up path @@ -40,6 +41,12 @@ jobs: C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt C:\tools\cygwin\bin\python3.8 -m pip install pytest-forked + - name: Download extra test images + run: | + C:\tools\cygwin\bin\dash -c "tr -d '\r' install_extra_test_images.sh" + C:\tools\cygwin\bin\dash -c "mv install_extra_test_images.sh depends/install_extra_test_images.sh" + C:\tools\cygwin\bin\dash -c "cd depends; dash install_extra_test_images.sh" + - name: Build Pillow run: | C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel @@ -57,11 +64,16 @@ jobs: C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh" C:\tools\cygwin\bin\chmod u+x .ci/test.sh + C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 --ignore=Tests/test_numpy.py + + - name: Test the possibly-segfaulting NumPy tests separately + run: | C:\tools\cygwin\bin\python3.8 -m pytest --forked Tests/test_numpy.py -k roundtrip - C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 - name: After success run: | + C:\tools\cygwin\bin\mv .ci/after_success.sh .ci/after_success.sh.dos + C:\tools\cygwin\bin\dash -c "tr -d '\r' <.ci/after_success.sh.dos >.ci/after_success.sh" C:\tools\cygwin\bin\bash .ci/after_success.sh - name: Upload coverage From a23131c22e18d51b25398334f8f1e7b07a90d8ac Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:49:45 -0500 Subject: [PATCH 17/63] CI: Stop trying to run the netpbm tests. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index f43460293b8..10b83fe880a 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -19,7 +19,7 @@ jobs: libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel libpng-devel - netpbm ImageMagick jpeg xorg-server-extra + ImageMagick jpeg xorg-server-extra xorg-server-common xinit subversion python38-setuptools python38-devel python38-tkinter python38-wheel python38-pip python38-olefile python38-numpy From 4e7e70fd7982c6cf478b20bb1d11e9140283dccc Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 8 Jan 2022 10:08:18 -0500 Subject: [PATCH 18/63] CI: Install netpbm and dependencies on Cygwin CI. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 10b83fe880a..162522c0aa3 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -19,7 +19,7 @@ jobs: libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel libpng-devel - ImageMagick jpeg xorg-server-extra + ImageMagick jpeg netpbm perl xorg-server-extra xorg-server-common xinit subversion python38-setuptools python38-devel python38-tkinter python38-wheel python38-pip python38-olefile python38-numpy From e1c27358ba72a2a9f797e2eec81f90d9676c484c Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 14:44:16 +1100 Subject: [PATCH 19/63] Switched to windows-latest --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 162522c0aa3..ca18309be98 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch] jobs: build: - runs-on: windows-2019 + runs-on: windows-latest name: Cygwin Python 3.8 steps: From 629340654c72f67baa8bedd61d9e38141c0222df Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 15:31:20 +1100 Subject: [PATCH 20/63] Switched to cygwin/cygwin-install-action --- .ci/after_success.sh | 4 +- .github/workflows/test-cygwin.yml | 63 +++++++++++-------------------- 2 files changed, 23 insertions(+), 44 deletions(-) diff --git a/.ci/after_success.sh b/.ci/after_success.sh index 53832c573dd..23a6fcd4d45 100755 --- a/.ci/after_success.sh +++ b/.ci/after_success.sh @@ -3,7 +3,7 @@ # gather the coverage data python3 -m pip install codecov if [[ $MATRIX_DOCKER ]]; then - coverage xml --ignore-errors + python3 -m coverage xml --ignore-errors else - coverage xml + python3 -m coverage xml fi diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index ca18309be98..022ef480848 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -8,73 +8,52 @@ jobs: name: Cygwin Python 3.8 steps: + - name: Fix line endings + run: | + git config --global core.autocrlf input + - name: Checkout Pillow uses: actions/checkout@v2 - - name: Set up Cygwin - uses: egor-tensin/setup-cygwin@v3 + - name: Install Cygwin + uses: cygwin/cygwin-install-action@v1 with: - platform: x64 + platform: x86_64 packages: > - libfreetype-devel libimagequant-devel libjpeg-devel - liblcms2-devel libopenjp2-devel libraqm-devel - libtiff-devel libwebp-devel libxcb-devel libpng-devel - ImageMagick jpeg netpbm perl xorg-server-extra - xorg-server-common xinit subversion python38-setuptools - python38-devel python38-tkinter python38-wheel - python38-pip python38-olefile python38-numpy - python38-pytest python38-sphinx python38-packaging - python38-cffi python38-requests - install-dir: 'C:\tools\cygwin' - - - name: Clean up path - uses: egor-tensin/cleanup-path@v2 - with: - dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' + ImageMagick python38-cffi python38-numpy python38-sip + python38-devel python38-tkinter ghostscript libfreetype-devel + libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel + libraqm-devel libtiff-devel libwebp-devel libxcb-devel + libxcb-xinerama0 qt5-devel-tools xorg-server-extra zlib-devel - name: Build system information - run: C:\tools\cygwin\bin\python3.8 .github/workflows/system-info.py + run: | + bash.exe -c "python3 .github/workflows/system-info.py" - name: Ensure Python dependencies are installed run: | - C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools - C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt - C:\tools\cygwin\bin\python3.8 -m pip install pytest-forked + bash.exe -c "python3 -m pip install pip wheel setuptools" + bash.exe -c "python3 -m pip install -r requirements.txt" - name: Download extra test images run: | - C:\tools\cygwin\bin\dash -c "tr -d '\r' install_extra_test_images.sh" - C:\tools\cygwin\bin\dash -c "mv install_extra_test_images.sh depends/install_extra_test_images.sh" - C:\tools\cygwin\bin\dash -c "cd depends; dash install_extra_test_images.sh" + bash.exe -c "cd depends; dash install_extra_test_images.sh" - name: Build Pillow run: | - C:\tools\cygwin\bin\python3.8 setup.py bdist_wheel + bash.exe -c "python3 setup.py bdist_wheel" - name: Install Pillow run: | - C:\tools\cygwin\bin\dash -c '/usr/bin/python3.8 -m pip install dist/*.whl' - - - name: Check Pillow configuration - run: | - C:\tools\cygwin\bin\python3.8 selftest.py + bash.exe -c "python3 -m pip install dist/*.whl" - name: Test Pillow run: | - C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos - C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh" - C:\tools\cygwin\bin\chmod u+x .ci/test.sh - C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8 --ignore=Tests/test_numpy.py - - - name: Test the possibly-segfaulting NumPy tests separately - run: | - C:\tools\cygwin\bin\python3.8 -m pytest --forked Tests/test_numpy.py -k roundtrip + bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh - name: After success run: | - C:\tools\cygwin\bin\mv .ci/after_success.sh .ci/after_success.sh.dos - C:\tools\cygwin\bin\dash -c "tr -d '\r' <.ci/after_success.sh.dos >.ci/after_success.sh" - C:\tools\cygwin\bin\bash .ci/after_success.sh + bash.exe .ci/after_success.sh - name: Upload coverage uses: codecov/codecov-action@v2 From 728bc7d7789aeba50a6720282bf9b90da5389693 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 15:05:54 +1100 Subject: [PATCH 21/63] Added matrix to test Python 3.7 and 32-bit --- .github/workflows/test-cygwin.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 022ef480848..77d55682ffe 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -5,7 +5,15 @@ on: [push, pull_request, workflow_dispatch] jobs: build: runs-on: windows-latest - name: Cygwin Python 3.8 + strategy: + fail-fast: false + matrix: + python-minor-version: [7, 8] + architecture: ["x86", "x86_64"] + + timeout-minutes: 30 + + name: Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} steps: - name: Fix line endings @@ -18,12 +26,15 @@ jobs: - name: Install Cygwin uses: cygwin/cygwin-install-action@v1 with: - platform: x86_64 + platform: ${{ matrix.architecture }} packages: > - ImageMagick python38-cffi python38-numpy python38-sip - python38-devel python38-tkinter ghostscript libfreetype-devel - libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel - libraqm-devel libtiff-devel libwebp-devel libxcb-devel + ImageMagick python3${{ matrix.python-minor-version }}-cffi + python3${{ matrix.python-minor-version }}-devel + python3${{ matrix.python-minor-version }}-numpy + python3${{ matrix.python-minor-version }}-sip + python3${{ matrix.python-minor-version }}-tkinter ghostscript + libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel + libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel libxcb-xinerama0 qt5-devel-tools xorg-server-extra zlib-devel - name: Build system information @@ -60,7 +71,7 @@ jobs: with: file: ./coverage.xml flags: GHA_Cygwin - name: ${{ runner.os }} Cygwin Python 3.8 ${{ matrix.architecture }} + name: Cygwin Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} - name: After failure if: failure() From 4be3b760f2de24770823f1f9d592618b197c116e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 15:26:38 +1100 Subject: [PATCH 22/63] Connected Cygwin jobs to mergify --- .github/mergify.yml | 1 + .github/workflows/test-cygwin.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index 8b289bda671..8dfa07f4ec5 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -8,6 +8,7 @@ pull_request_rules: - status-success=Docker Test Successful - status-success=Windows Test Successful - status-success=MinGW Test Successful + - status-success=Cygwin Test Successful - status-success=continuous-integration/appveyor/pr actions: merge: diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 77d55682ffe..b78e1b231f0 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -79,3 +79,11 @@ jobs: C:\tools\cygwin\bin\uname -a C:\tools\cygwin\bin\python3.8 -m pip list C:\tools\cygwin\bin\python3.8 -m pip show --files Pillow + + success: + needs: build + runs-on: ubuntu-latest + name: Cygwin Test Successful + steps: + - name: Success + run: echo Cygwin Test Successful From 8d2c56ec1f85bec979bad2178309c8c9491bc1c9 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 15:09:49 +1100 Subject: [PATCH 23/63] Upload errors on failure --- .github/workflows/test-cygwin.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index b78e1b231f0..f4fbfd1f869 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -62,6 +62,18 @@ jobs: run: | bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + - name: Prepare to upload errors + if: failure() + run: | + mkdir -p Tests/errors + + - name: Upload errors + uses: actions/upload-artifact@v2 + if: failure() + with: + name: errors + path: Tests/errors + - name: After success run: | bash.exe .ci/after_success.sh @@ -73,13 +85,6 @@ jobs: flags: GHA_Cygwin name: Cygwin Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} - - name: After failure - if: failure() - run: | - C:\tools\cygwin\bin\uname -a - C:\tools\cygwin\bin\python3.8 -m pip list - C:\tools\cygwin\bin\python3.8 -m pip show --files Pillow - success: needs: build runs-on: ubuntu-latest From 05637393a62a79ce2e58e7458667cb8e8845a45a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Feb 2022 15:14:31 +1100 Subject: [PATCH 24/63] Install Pillow directly --- .ci/build_cygwin.sh | 8 +++++ .ci/install.sh | 55 ++++++++++++++++++------------- .github/workflows/test-cygwin.yml | 19 +++-------- 3 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 .ci/build_cygwin.sh diff --git a/.ci/build_cygwin.sh b/.ci/build_cygwin.sh new file mode 100644 index 00000000000..d621a53364f --- /dev/null +++ b/.ci/build_cygwin.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +python3 -m coverage erase +make clean +CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . +python3 selftest.py diff --git a/.ci/install.sh b/.ci/install.sh index efc57a6414a..ec427ff27d4 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -13,17 +13,20 @@ aptget_update() return 1 fi } -aptget_update || aptget_update retry || aptget_update retry +if [[ $(uname) != CYGWIN* ]]; then + aptget_update || aptget_update retry || aptget_update retry +fi set -e -sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ - ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\ - cmake meson imagemagick libharfbuzz-dev libfribidi-dev +if [[ $(uname) != CYGWIN* ]]; then + sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ + ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\ + cmake meson imagemagick libharfbuzz-dev libfribidi-dev + python3 -m pip install --upgrade pip +fi -python3 -m pip install --upgrade pip python3 -m pip install --upgrade wheel -PYTHONOPTIMIZE=0 python3 -m pip install cffi python3 -m pip install coverage python3 -m pip install defusedxml python3 -m pip install olefile @@ -32,24 +35,30 @@ python3 -m pip install -U pytest-cov python3 -m pip install -U pytest-timeout python3 -m pip install pyroma python3 -m pip install test-image-results -python3 -m pip install numpy - -# PyQt5 doesn't support PyPy3 -if [[ $GHA_PYTHON_VERSION == 3.* ]]; then - # arm64, ppc64le, s390x CPUs: - # "ERROR: Could not find a version that satisfies the requirement pyqt5" - sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools - python3 -m pip install pyqt5 -fi -# webp -pushd depends && ./install_webp.sh && popd +if [[ $(uname) != CYGWIN* ]]; then + PYTHONOPTIMIZE=0 python3 -m pip install cffi + python3 -m pip install numpy -# libimagequant -pushd depends && ./install_imagequant.sh && popd + # PyQt5 doesn't support PyPy3 + if [[ $GHA_PYTHON_VERSION == 3.* ]]; then + # arm64, ppc64le, s390x CPUs: + # "ERROR: Could not find a version that satisfies the requirement pyqt5" + sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools + python3 -m pip install pyqt5 + fi -# raqm -pushd depends && ./install_raqm.sh && popd + # webp + pushd depends && ./install_webp.sh && popd -# extra test images -pushd depends && ./install_extra_test_images.sh && popd + # libimagequant + pushd depends && ./install_imagequant.sh && popd + + # raqm + pushd depends && ./install_raqm.sh && popd + + # extra test images + pushd depends && ./install_extra_test_images.sh && popd +else + cd depends && ./install_extra_test_images.sh && cd .. +fi diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index f4fbfd1f869..6e2dc5b596d 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -41,24 +41,15 @@ jobs: run: | bash.exe -c "python3 .github/workflows/system-info.py" - - name: Ensure Python dependencies are installed + - name: Install dependencies run: | - bash.exe -c "python3 -m pip install pip wheel setuptools" - bash.exe -c "python3 -m pip install -r requirements.txt" + bash.exe .ci/install.sh - - name: Download extra test images + - name: Build run: | - bash.exe -c "cd depends; dash install_extra_test_images.sh" + bash.exe .ci/build_cygwin.sh - - name: Build Pillow - run: | - bash.exe -c "python3 setup.py bdist_wheel" - - - name: Install Pillow - run: | - bash.exe -c "python3 -m pip install dist/*.whl" - - - name: Test Pillow + - name: Test run: | bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From 6fded1ac97a5d2a588a7b60e49869525d04eb6f3 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 3 Feb 2022 14:07:51 +1100 Subject: [PATCH 25/63] Install cjpeg and djpeg --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 6e2dc5b596d..2dcdecd3009 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -28,7 +28,7 @@ jobs: with: platform: ${{ matrix.architecture }} packages: > - ImageMagick python3${{ matrix.python-minor-version }}-cffi + ImageMagick jpeg python3${{ matrix.python-minor-version }}-cffi python3${{ matrix.python-minor-version }}-devel python3${{ matrix.python-minor-version }}-numpy python3${{ matrix.python-minor-version }}-sip From 131212368d4f57f23b6c3a4520b3ca9545a57282 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 3 Feb 2022 15:55:44 +1100 Subject: [PATCH 26/63] Install netpbm --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 2dcdecd3009..e169a31419e 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -35,7 +35,7 @@ jobs: python3${{ matrix.python-minor-version }}-tkinter ghostscript libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel - libxcb-xinerama0 qt5-devel-tools xorg-server-extra zlib-devel + libxcb-xinerama0 netpbm perl qt5-devel-tools xorg-server-extra zlib-devel - name: Build system information run: | From 2d6dee1dae7c6f4ce639e1042c05152ef5d14c9e Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sun, 6 Feb 2022 07:34:15 -0500 Subject: [PATCH 27/63] CI: Try to get Cygwin workflow working. --- .github/workflows/test-cygwin.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index e169a31419e..3b133254206 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -11,7 +11,7 @@ jobs: python-minor-version: [7, 8] architecture: ["x86", "x86_64"] - timeout-minutes: 30 + timeout-minutes: 40 name: Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} @@ -31,11 +31,18 @@ jobs: ImageMagick jpeg python3${{ matrix.python-minor-version }}-cffi python3${{ matrix.python-minor-version }}-devel python3${{ matrix.python-minor-version }}-numpy + python3${{ matrix.python-minor-version }}-cython liblapack-devel gcc-g++ python3${{ matrix.python-minor-version }}-sip python3${{ matrix.python-minor-version }}-tkinter ghostscript libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel libxcb-xinerama0 netpbm perl qt5-devel-tools xorg-server-extra zlib-devel + subversion make + + - name: Add Lapack to PATH + uses: egor-tensin/cleanup-path@v1 + with: + dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack' - name: Build system information run: | @@ -45,10 +52,22 @@ jobs: run: | bash.exe .ci/install.sh + - name: Install a different NumPy + run: | + bash.exe -c "python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*'" + + - name: Check imports + run: | + bash.exe -c "python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)'" + - name: Build run: | bash.exe .ci/build_cygwin.sh + - name: Rebase dlls + run: | + bash.exe -c '/usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe)' + - name: Test run: | bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh @@ -56,7 +75,7 @@ jobs: - name: Prepare to upload errors if: failure() run: | - mkdir -p Tests/errors + dash.exe -c "mkdir -p Tests/errors" - name: Upload errors uses: actions/upload-artifact@v2 From 5588f572de4cd386f576fc761e50d373cf1ca239 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:03:36 -0500 Subject: [PATCH 28/63] BUG: Only set title in ImageShow.DisplayViewer when title provided --- src/PIL/ImageShow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/ImageShow.py b/src/PIL/ImageShow.py index f8829fc21e0..d76c2609016 100644 --- a/src/PIL/ImageShow.py +++ b/src/PIL/ImageShow.py @@ -269,7 +269,7 @@ def show_file(self, path=None, **options): else: raise TypeError("Missing required argument: 'path'") args = ["display"] - if "title" in options: + if "title" in options and options["title"] is not None: args += ["-name", options["title"]] args.append(path) From 4d0e294eb0b5ede4a4c92293aa4ef2794c3b6025 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:00:37 -0500 Subject: [PATCH 29/63] CI: Revert changes to test.sh Some early runs needed to explicitly specify the minor version to avoid calling python3.9 which had none of the dependencies installed. That problem should be fixed. --- .ci/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index b0f019d6607..8ff7c5f6483 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -2,6 +2,6 @@ set -e -python3$1 -c "from PIL import Image" +python3 -c "from PIL import Image" -python3$1 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE +python3 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE From 1d1c22e1d4979710b9e5fe951ac174308d12ebfb Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 15 Apr 2022 20:45:19 -0400 Subject: [PATCH 30/63] CI: Update versions of actions used by Cygwin CI As suggested by code review. Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- .github/workflows/test-cygwin.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 3b133254206..c85876ad115 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -21,10 +21,10 @@ jobs: git config --global core.autocrlf input - name: Checkout Pillow - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Cygwin - uses: cygwin/cygwin-install-action@v1 + uses: cygwin/cygwin-install-action@v2 with: platform: ${{ matrix.architecture }} packages: > @@ -78,7 +78,7 @@ jobs: dash.exe -c "mkdir -p Tests/errors" - name: Upload errors - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: errors @@ -89,7 +89,7 @@ jobs: bash.exe .ci/after_success.sh - name: Upload coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: file: ./coverage.xml flags: GHA_Cygwin From 635f8cf327aea361120a9f6a344355ed1caea03b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 16 Apr 2022 15:42:09 +1000 Subject: [PATCH 31/63] Added Python 3.9 --- .github/workflows/test-cygwin.yml | 2 +- docs/installation.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index c85876ad115..5597b2b34c4 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-minor-version: [7, 8] + python-minor-version: [7, 8, 9] architecture: ["x86", "x86_64"] timeout-minutes: 40 diff --git a/docs/installation.rst b/docs/installation.rst index e5f09dad48b..f2c08488f01 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -478,9 +478,9 @@ These platforms are built and tested for every change. +----------------------------------+----------------------------+---------------------+ | Windows Server 2019 | 3.7, 3.8, 3.9, 3.10, PyPy3 | x86, x86-64 | | +----------------------------+---------------------+ -| | 3.9/MinGW | x86, x86-64 | +| | 3.9 (MinGW) | x86, x86-64 | | +----------------------------+---------------------+ -| | 3.8/Cygwin | x86-64 | +| | 3.7, 3.8, 3.9 (Cygwin) | x86, x86-64 | +----------------------------------+----------------------------+---------------------+ From cdfe08bc5e06f0ac2debbf3dd1db69584623db2d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 16 Apr 2022 19:14:00 +1000 Subject: [PATCH 32/63] Only install NumPy through pip on 64-bit --- .github/workflows/test-cygwin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 5597b2b34c4..8683e72d71c 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,6 +53,7 @@ jobs: bash.exe .ci/install.sh - name: Install a different NumPy + if: matrix.architecture == 'x86_64' run: | bash.exe -c "python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*'" From 97e6197e9f8b1e4740528a2362299ff9fef21bef Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:17:45 -0400 Subject: [PATCH 33/63] CI: Set up cache for Cygwin pip Copied from the MIT-licensed: https://github.com/actions/cache/blob/main/examples.md#using-pip-to-get-cache-location --- .github/workflows/test-cygwin.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 8683e72d71c..e68275e4250 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -43,6 +43,19 @@ jobs: uses: egor-tensin/cleanup-path@v1 with: dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack' + + - name: Get pip cache dir + id: pip-cache + run: | + bash.exe -c 'echo "::set-output name=dir::$(pip cache dir)"' + + - name: pip cache + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- - name: Build system information run: | From bd61d1ef1b1c43bececd873c8ecb346bbbd4c786 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:28:02 -0400 Subject: [PATCH 34/63] FIX, CI: Actually run pip --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index e68275e4250..0874bc01a4a 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -47,7 +47,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - bash.exe -c 'echo "::set-output name=dir::$(pip cache dir)"' + bash.exe -c 'echo "::set-output name=dir::$(python -m pip cache dir)"' - name: pip cache uses: actions/cache@v3 From be6dd712ba6a14b38f5cd609110041564ffca10d Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:48:57 -0400 Subject: [PATCH 35/63] Ci: Simplify Cygwin pip cache This might pave the way for caching the Cygwin install, which might speed things up a bit. --- .github/workflows/test-cygwin.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 0874bc01a4a..70667bce60d 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -47,15 +47,16 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - bash.exe -c 'echo "::set-output name=dir::$(python -m pip cache dir)"' + bash.exe -c 'cygpath -wa $(python -m pip cache dir)' + bash.exe -c 'echo "::set-output name=dir::$(cygpath -wa $(python -m pip cache dir))"' - name: pip cache uses: actions/cache@v3 with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + path: 'C:\cygwin\home\runner\.cache\pip' + key: ${{ runner.os }}-cygwin-pip-${{ hashFiles('.ci/install.sh') }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-cygwin-pip- - name: Build system information run: | From c1d3bac917217b8f051ca8ad3576b18fd787b9fd Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:26:12 -0400 Subject: [PATCH 36/63] CI: Fix runner username for pip cache --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 70667bce60d..afddb85518a 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,7 +53,7 @@ jobs: - name: pip cache uses: actions/cache@v3 with: - path: 'C:\cygwin\home\runner\.cache\pip' + path: 'C:\cygwin\home\runneradmin\.cache\pip' key: ${{ runner.os }}-cygwin-pip-${{ hashFiles('.ci/install.sh') }} restore-keys: | ${{ runner.os }}-cygwin-pip- From 805e8f10bad8bf032fea26148a85d942a2d66e2f Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 22 Apr 2022 08:25:46 -0400 Subject: [PATCH 37/63] CI: Try to fix Cygwin pip cache --- .github/workflows/test-cygwin.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index afddb85518a..8353714af51 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -44,19 +44,13 @@ jobs: with: dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack' - - name: Get pip cache dir - id: pip-cache - run: | - bash.exe -c 'cygpath -wa $(python -m pip cache dir)' - bash.exe -c 'echo "::set-output name=dir::$(cygpath -wa $(python -m pip cache dir))"' - - name: pip cache uses: actions/cache@v3 with: path: 'C:\cygwin\home\runneradmin\.cache\pip' - key: ${{ runner.os }}-cygwin-pip-${{ hashFiles('.ci/install.sh') }} + key: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} restore-keys: | - ${{ runner.os }}-cygwin-pip- + ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information run: | From 7605e4601161da7f392d5db55559aade4d82565b Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 23 Apr 2022 08:22:33 -0400 Subject: [PATCH 38/63] CI: Set shell for Cygwin CI steps Allows me to avoid .ci/build_cygwin.sh --- .ci/build_cygwin.sh | 8 -------- .github/workflows/test-cygwin.yml | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 .ci/build_cygwin.sh diff --git a/.ci/build_cygwin.sh b/.ci/build_cygwin.sh deleted file mode 100644 index d621a53364f..00000000000 --- a/.ci/build_cygwin.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -e - -python3 -m coverage erase -make clean -CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . -python3 selftest.py diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 8353714af51..d05250a8d28 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,8 +53,9 @@ jobs: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information + shell: dash.exe -l "{0}" run: | - bash.exe -c "python3 .github/workflows/system-info.py" + python3 .github/workflows/system-info.py - name: Install dependencies run: | @@ -62,20 +63,27 @@ jobs: - name: Install a different NumPy if: matrix.architecture == 'x86_64' + shell: dash.exe -l "{0}" run: | - bash.exe -c "python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*'" + python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*' - name: Check imports + shell: dash.exe -l "{0}" run: | - bash.exe -c "python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)'" + python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)' - name: Build + shell: bash.exe --login -eo pipefail "{0}" run: | - bash.exe .ci/build_cygwin.sh + python3 -m coverage erase + make clean + CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . + python3 selftest.py - name: Rebase dlls + shell: dash.exe -l "{0}" run: | - bash.exe -c '/usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe)' + /usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe) - name: Test run: | From 1674e425a7bad3f710769c23b5bd515e66459c66 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 23 Apr 2022 08:25:58 -0400 Subject: [PATCH 39/63] CI: Sort the Cygwin requirements. --- .github/workflows/test-cygwin.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index d05250a8d28..a82c7446a09 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -28,16 +28,18 @@ jobs: with: platform: ${{ matrix.architecture }} packages: > - ImageMagick jpeg python3${{ matrix.python-minor-version }}-cffi + ImageMagick gcc-g++ ghostscript jpeg libfreetype-devel + libimagequant-devel libjpeg-devel liblapack-devel + liblcms2-devel libopenjp2-devel libraqm-devel + libtiff-devel libwebp-devel libxcb-devel libxcb-xinerama0 + make netpbm perl + python3${{ matrix.python-minor-version }}-cffi + python3${{ matrix.python-minor-version }}-cython python3${{ matrix.python-minor-version }}-devel python3${{ matrix.python-minor-version }}-numpy - python3${{ matrix.python-minor-version }}-cython liblapack-devel gcc-g++ python3${{ matrix.python-minor-version }}-sip - python3${{ matrix.python-minor-version }}-tkinter ghostscript - libfreetype-devel libimagequant-devel libjpeg-devel liblcms2-devel - libopenjp2-devel libraqm-devel libtiff-devel libwebp-devel libxcb-devel - libxcb-xinerama0 netpbm perl qt5-devel-tools xorg-server-extra zlib-devel - subversion make + python3${{ matrix.python-minor-version }}-tkinter + qt5-devel-tools subversion xorg-server-extra zlib-devel - name: Add Lapack to PATH uses: egor-tensin/cleanup-path@v1 From 46c1f9389e6d33e4e2dccf6a732c4e4ccfb0dd84 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 23 Apr 2022 08:28:57 -0400 Subject: [PATCH 40/63] CI: Update pip before installing dependencies. Avoid pip warnings. --- .github/workflows/test-cygwin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index a82c7446a09..f4e98adebe9 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -61,6 +61,7 @@ jobs: - name: Install dependencies run: | + dash.exe -c "python3.${{ matrix.python-minor-version }} -m pip install -U pip" bash.exe .ci/install.sh - name: Install a different NumPy From 9fb79513a256e422c73efd19205cd0f4e8b0368f Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 23 Apr 2022 08:51:09 -0400 Subject: [PATCH 41/63] FIX, CI: Change shell to stay in repository. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index f4e98adebe9..b037d33439b 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -55,7 +55,7 @@ jobs: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information - shell: dash.exe -l "{0}" + shell: bash.exe --login -eo pipefail "{0}" run: | python3 .github/workflows/system-info.py From fdbab82f9eaffd232a6d8b68ef2cab16c3da6f1d Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:54:23 -0400 Subject: [PATCH 42/63] CI: Use dash to check system-info.py This may be a problem with using a login shell (starts in ~) rather than with using bash over dash. We'll see in a bit. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index b037d33439b..f4e98adebe9 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -55,7 +55,7 @@ jobs: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information - shell: bash.exe --login -eo pipefail "{0}" + shell: dash.exe -l "{0}" run: | python3 .github/workflows/system-info.py From 91e6457360cf8bd384ce32cedd49fb2d75cfbd37 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:53:19 -0400 Subject: [PATCH 43/63] CI: Stop using login shell for build info I should probably avoid login shells in any step that uses a relative path. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index f4e98adebe9..4d1065b489a 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -55,7 +55,7 @@ jobs: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information - shell: dash.exe -l "{0}" + shell: dash.exe "{0}" run: | python3 .github/workflows/system-info.py From ed0c37d528295c31a25f786349adb0456c2807df Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 11:27:01 -0400 Subject: [PATCH 44/63] CI: Don't use shell for build information --- .github/workflows/test-cygwin.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 4d1065b489a..8f5dbe252ef 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -55,9 +55,8 @@ jobs: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- - name: Build system information - shell: dash.exe "{0}" run: | - python3 .github/workflows/system-info.py + dash.exe "python3 .github/workflows/system-info.py" - name: Install dependencies run: | From 41976ae125e6a7ffb4bde7b8b4e817029e4de647 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 11:34:13 -0400 Subject: [PATCH 45/63] FIX: Fix syntax for shell call --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 8f5dbe252ef..3205f2f68bf 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -56,7 +56,7 @@ jobs: - name: Build system information run: | - dash.exe "python3 .github/workflows/system-info.py" + dash.exe -c "python3 .github/workflows/system-info.py" - name: Install dependencies run: | From e0f4c21d0150f0b605e05ac485e3fba8a8dc33e4 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:36:05 -0400 Subject: [PATCH 46/63] CI: Remind bash to ignore CR in workflow --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 3205f2f68bf..fa99e04b691 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -75,7 +75,7 @@ jobs: python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)' - name: Build - shell: bash.exe --login -eo pipefail "{0}" + shell: bash.exe --login -eo pipefail -o igncr "{0}" run: | python3 -m coverage erase make clean From 88c406eac9deffcb2ad73d6c1841196268c5cf81 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:57:52 -0400 Subject: [PATCH 47/63] CI: Stop using login shell for build step --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index fa99e04b691..65cdb2039f2 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -75,7 +75,7 @@ jobs: python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)' - name: Build - shell: bash.exe --login -eo pipefail -o igncr "{0}" + shell: bash.exe -eo pipefail -o igncr "{0}" run: | python3 -m coverage erase make clean From 08e0d0b81766ca1f4416bbff97f9e809153a55fe Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 13:15:04 -0400 Subject: [PATCH 48/63] CI: Use bash for rebase step Hopefully this makes sure rebase finds all of pillow's C extension modules so rebase failures are less likely. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 65cdb2039f2..499d1f75a16 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -83,7 +83,7 @@ jobs: python3 selftest.py - name: Rebase dlls - shell: dash.exe -l "{0}" + shell: bash.exe -eo pipefail -o igncr "{0}" run: | /usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe) From 2d25e668e71c1ac6c83097953587330b67d24adc Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 30 Apr 2022 10:19:48 +1000 Subject: [PATCH 49/63] Do not install NumPy on Python 3.11 --- .ci/install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index fc7d9fc1893..856cbe5f97b 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -35,12 +35,11 @@ python3 -m pip install -U pytest-cov python3 -m pip install -U pytest-timeout python3 -m pip install pyroma python3 -m pip install test-image-results -# TODO Remove condition when NumPy supports 3.11 -if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi if [[ $(uname) != CYGWIN* ]]; then PYTHONOPTIMIZE=0 python3 -m pip install cffi - python3 -m pip install numpy + # TODO Remove condition when NumPy supports 3.11 + if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi # PyQt6 doesn't support PyPy3 if [[ $GHA_PYTHON_VERSION == 3.* ]]; then From 143e57b6cddc7effc2b74e9ccd7a330520295ceb Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 29 Apr 2022 20:40:57 -0400 Subject: [PATCH 50/63] CI: Specify python minor version everywhere on Cygwin Finish the last few of these. It's usually unnecessary, but I ran into trouble once with NumPy, and will likely run into more problems if I start submitting packages. A different option would be to use alternatives to point python3 at the right python. --- .github/workflows/test-cygwin.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 499d1f75a16..aec937aa7a8 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -56,7 +56,7 @@ jobs: - name: Build system information run: | - dash.exe -c "python3 .github/workflows/system-info.py" + dash.exe -c "python3.${{ matrix.python-minor-version }} .github/workflows/system-info.py" - name: Install dependencies run: | @@ -77,10 +77,10 @@ jobs: - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | - python3 -m coverage erase + python3.${{ matrix.python-minor-version }} -m coverage erase make clean - CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . - python3 selftest.py + CFLAGS="-coverage -Werror=implicit-function-declaration" python3.${{ matrix.python-minor-version }} -m pip install -v --global-option="build_ext" . + python3.${{ matrix.python-minor-version }} selftest.py - name: Rebase dlls shell: bash.exe -eo pipefail -o igncr "{0}" From ce7489884fa7951793d0d10118520017eaae214a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 2 May 2022 17:54:49 -0400 Subject: [PATCH 51/63] CI: Update Cygwin pip, but not on 32-bit * CI: Update Cygwin pip, but not on 32-bit 32-bit Cygwin pip>=22 fails to install coverage. * CI: Let .ci/install.sh handle updating pip * CI Combine pip update conditions * CI: Don't try to upgrade pip on 32-bit Cygwin --- .ci/install.sh | 3 +++ .github/workflows/test-cygwin.yml | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/install.sh b/.ci/install.sh index 856cbe5f97b..02e1474bd3f 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -23,6 +23,9 @@ if [[ $(uname) != CYGWIN* ]]; then sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\ cmake meson imagemagick libharfbuzz-dev libfribidi-dev +fi + +if [[ $(uname -mo) != "i*86 Cygwin" ]]; then python3 -m pip install --upgrade pip fi diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index aec937aa7a8..0c175a6d4e7 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -60,7 +60,6 @@ jobs: - name: Install dependencies run: | - dash.exe -c "python3.${{ matrix.python-minor-version }} -m pip install -U pip" bash.exe .ci/install.sh - name: Install a different NumPy From 0b134250faebec08b87ccf5e51c600972f84629a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 2 May 2022 20:38:12 -0400 Subject: [PATCH 52/63] CI: Use alternatives to select python version (#4) * CI: Use alternatives to select python version * CI: Specify full path to alternatives /usr/sbin isn't in PATH * DBG: Print uname to try to avoid bad pip install. pip>=22 on 32-bit Cygwin seems to cause problems installing coverage. I have no idea why this is, so I just skip upgrading pip there. * FIX: Fix syntax of conditional for 32-bit Cygwin I have no idea if it needs to be able to accept i386, but it will if it comes up. * FIX: Revert earlier debug change. --- .ci/install.sh | 2 +- .github/workflows/test-cygwin.yml | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index 02e1474bd3f..7364e4a196a 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -25,7 +25,7 @@ if [[ $(uname) != CYGWIN* ]]; then cmake meson imagemagick libharfbuzz-dev libfribidi-dev fi -if [[ $(uname -mo) != "i*86 Cygwin" ]]; then +if [[ $(uname -mo) != i*86" Cygwin" ]]; then python3 -m pip install --upgrade pip fi diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 0c175a6d4e7..c2b4159b4f4 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,10 +53,18 @@ jobs: key: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} restore-keys: | ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- + + - name: Ensure correct python minor version used in scripts + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + /usr/sbin/alternatives --set python3 /usr/bin/python3.${{ matrix.python-minor-version }} + /usr/sbin/alternatives --display python3 + /usr/sbin/alternatives --set python /usr/bin/python3.${{ matrix.python-minor-version }} + /usr/sbin/alternatives --display python - name: Build system information run: | - dash.exe -c "python3.${{ matrix.python-minor-version }} .github/workflows/system-info.py" + dash.exe -c "python3 .github/workflows/system-info.py" - name: Install dependencies run: | @@ -66,20 +74,20 @@ jobs: if: matrix.architecture == 'x86_64' shell: dash.exe -l "{0}" run: | - python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*' + python3 -m pip install -U 'numpy!=1.21.*' - name: Check imports shell: dash.exe -l "{0}" run: | - python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)' + python3 -c 'import numpy as np; print(np.__version__)' - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | - python3.${{ matrix.python-minor-version }} -m coverage erase + python3 -m coverage erase make clean - CFLAGS="-coverage -Werror=implicit-function-declaration" python3.${{ matrix.python-minor-version }} -m pip install -v --global-option="build_ext" . - python3.${{ matrix.python-minor-version }} selftest.py + CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . + python3 selftest.py - name: Rebase dlls shell: bash.exe -eo pipefail -o igncr "{0}" From 941ff61f17ed7b6a309128fdefd9bf72937afb54 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 4 May 2022 09:23:24 -0400 Subject: [PATCH 53/63] CI: Drop 32-bit Cygwin from regular testing Cygwin recommends using 64-bit if at all possible, and will discontinue support entirely within the next year or so. This also reduces CI load, which I suppose is polite to those who provide it at no cost. --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index c2b4159b4f4..103fb10f4e6 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: python-minor-version: [7, 8, 9] - architecture: ["x86", "x86_64"] + architecture: ["x86_64"] timeout-minutes: 40 From 2067f6040930e5c86bd396c4605c39b5eb5a4893 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 5 May 2022 15:21:22 -0400 Subject: [PATCH 54/63] STY: Commit suggestions from PR review. --- .ci/install.sh | 5 +---- .github/workflows/test-cygwin.yml | 12 +++++------- docs/installation.rst | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index 7364e4a196a..6d689456605 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -25,10 +25,7 @@ if [[ $(uname) != CYGWIN* ]]; then cmake meson imagemagick libharfbuzz-dev libfribidi-dev fi -if [[ $(uname -mo) != i*86" Cygwin" ]]; then - python3 -m pip install --upgrade pip -fi - +python3 -m pip install --upgrade pip python3 -m pip install --upgrade wheel python3 -m pip install coverage python3 -m pip install defusedxml diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 103fb10f4e6..61e745ea5c5 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -9,11 +9,10 @@ jobs: fail-fast: false matrix: python-minor-version: [7, 8, 9] - architecture: ["x86_64"] timeout-minutes: 40 - name: Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} + name: Python 3.${{ matrix.python-minor-version }} steps: - name: Fix line endings @@ -26,7 +25,7 @@ jobs: - name: Install Cygwin uses: cygwin/cygwin-install-action@v2 with: - platform: ${{ matrix.architecture }} + platform: x86_64 packages: > ImageMagick gcc-g++ ghostscript jpeg libfreetype-devel libimagequant-devel libjpeg-devel liblapack-devel @@ -50,9 +49,9 @@ jobs: uses: actions/cache@v3 with: path: 'C:\cygwin\home\runneradmin\.cache\pip' - key: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} + key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} restore-keys: | - ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}- + ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}- - name: Ensure correct python minor version used in scripts shell: bash.exe -eo pipefail -o igncr "{0}" @@ -71,7 +70,6 @@ jobs: bash.exe .ci/install.sh - name: Install a different NumPy - if: matrix.architecture == 'x86_64' shell: dash.exe -l "{0}" run: | python3 -m pip install -U 'numpy!=1.21.*' @@ -119,7 +117,7 @@ jobs: with: file: ./coverage.xml flags: GHA_Cygwin - name: Cygwin Python 3.${{ matrix.python-minor-version }} ${{ matrix.architecture }} + name: Cygwin Python 3.${{ matrix.python-minor-version }} success: needs: build diff --git a/docs/installation.rst b/docs/installation.rst index 48e5b94c296..8cc03f28edf 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -485,7 +485,7 @@ These platforms are built and tested for every change. | +----------------------------+---------------------+ | | 3.9 (MinGW) | x86, x86-64 | | +----------------------------+---------------------+ -| | 3.7, 3.8, 3.9 (Cygwin) | x86, x86-64 | +| | 3.7, 3.8, 3.9 (Cygwin) | x86-64 | +----------------------------------+----------------------------+---------------------+ From b670df828d03d410db8c2f8bb4d5346ad31ff9e7 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 6 May 2022 22:43:03 -0400 Subject: [PATCH 55/63] STY: Fix English in .github/workflows/test-cygwin.yml Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 61e745ea5c5..42f5f297595 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,7 +53,7 @@ jobs: restore-keys: | ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}- - - name: Ensure correct python minor version used in scripts + - name: Ensure correct Python minor version is used in scripts shell: bash.exe -eo pipefail -o igncr "{0}" run: | /usr/sbin/alternatives --set python3 /usr/bin/python3.${{ matrix.python-minor-version }} From eee481176dab05a64608079b0373cf2a3259c497 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 May 2022 14:52:28 +1000 Subject: [PATCH 56/63] Removed DLL rebase --- .github/workflows/test-cygwin.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 42f5f297595..2aa03b88e59 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -44,7 +44,7 @@ jobs: uses: egor-tensin/cleanup-path@v1 with: dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack' - + - name: pip cache uses: actions/cache@v3 with: @@ -52,7 +52,7 @@ jobs: key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} restore-keys: | ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}- - + - name: Ensure correct Python minor version is used in scripts shell: bash.exe -eo pipefail -o igncr "{0}" run: | @@ -87,11 +87,6 @@ jobs: CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . python3 selftest.py - - name: Rebase dlls - shell: bash.exe -eo pipefail -o igncr "{0}" - run: | - /usr/bin/rebase --database $(find /usr{,/local}/lib/python3.${{ matrix.python-minor-version }}/site-packages src/PIL ${HOME}/.local/lib/ /usr/lib/lapack /usr/bin -name \*.dll -o -name \*.exe) - - name: Test run: | bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh From a5b20f7a3468248d7ca718cd066ebb9f9bcbdb0e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 May 2022 15:29:49 +1000 Subject: [PATCH 57/63] Removed setting alternative --- .github/workflows/test-cygwin.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 2aa03b88e59..ae1c0fb8b6c 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -53,14 +53,6 @@ jobs: restore-keys: | ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}- - - name: Ensure correct Python minor version is used in scripts - shell: bash.exe -eo pipefail -o igncr "{0}" - run: | - /usr/sbin/alternatives --set python3 /usr/bin/python3.${{ matrix.python-minor-version }} - /usr/sbin/alternatives --display python3 - /usr/sbin/alternatives --set python /usr/bin/python3.${{ matrix.python-minor-version }} - /usr/sbin/alternatives --display python - - name: Build system information run: | dash.exe -c "python3 .github/workflows/system-info.py" From 7c97d8457621ed205406d1abddcef739aabc2f25 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 7 May 2022 07:42:40 -0400 Subject: [PATCH 58/63] CI: Stop testing numpy imports Install seems to be working now. Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- .github/workflows/test-cygwin.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 42f5f297595..3ff3a15af9c 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -73,12 +73,6 @@ jobs: shell: dash.exe -l "{0}" run: | python3 -m pip install -U 'numpy!=1.21.*' - - - name: Check imports - shell: dash.exe -l "{0}" - run: | - python3 -c 'import numpy as np; print(np.__version__)' - - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | From c6cdd4dd528bd616f84f4cbe11edc4a063ccb22a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 May 2022 23:13:41 +1000 Subject: [PATCH 59/63] Adjust formatting --- .github/workflows/test-cygwin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 80729efa13c..a656d64c5a0 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -65,6 +65,7 @@ jobs: shell: dash.exe -l "{0}" run: | python3 -m pip install -U 'numpy!=1.21.*' + - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | From c919db11a8d074a03e904dd9919d520d8d4b1584 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 May 2022 22:32:46 +1000 Subject: [PATCH 60/63] Install cffi --- .ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/install.sh b/.ci/install.sh index 6d689456605..c588af42ffa 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -27,6 +27,7 @@ fi python3 -m pip install --upgrade pip python3 -m pip install --upgrade wheel +PYTHONOPTIMIZE=0 python3 -m pip install cffi python3 -m pip install coverage python3 -m pip install defusedxml python3 -m pip install olefile @@ -37,7 +38,6 @@ python3 -m pip install pyroma python3 -m pip install test-image-results if [[ $(uname) != CYGWIN* ]]; then - PYTHONOPTIMIZE=0 python3 -m pip install cffi # TODO Remove condition when NumPy supports 3.11 if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi From 035e95551d0221083998d7cb4d52f02b03beadb1 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 8 May 2022 21:30:42 +1000 Subject: [PATCH 61/63] Use build.sh --- .ci/build.sh | 2 +- .github/workflows/test-cygwin.yml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index a2e3041bd27..e678f68ec85 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -2,7 +2,7 @@ set -e -coverage erase +python3 -m coverage erase if [ $(uname) == "Darwin" ]; then export CPPFLAGS="-I/usr/local/miniconda/include"; fi diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index a656d64c5a0..a2795b0881f 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -69,10 +69,7 @@ jobs: - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | - python3 -m coverage erase - make clean - CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" . - python3 selftest.py + bash.exe .ci/build.sh - name: Test run: | From 0c7868b8cde901092c6dc08615c7cb2d9b2be2d9 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 8 May 2022 21:40:46 +1000 Subject: [PATCH 62/63] Added Cygwin badge --- README.md | 3 +++ docs/index.rst | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 7bff737a289..5e9adaf7e95 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ As of 2019, Pillow development is GitHub Actions build status (Test MinGW) + GitHub Actions build status (Test Cygwin) GitHub Actions build status (Test Docker) diff --git a/docs/index.rst b/docs/index.rst index f1a721c6ac1..5e886c2e82a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,6 +29,10 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more Date: Wed, 11 May 2022 08:01:02 -0400 Subject: [PATCH 63/63] CI: Only invoke bash once for build step. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's see if this works. Co-authored-by: Ondrej Baranovič --- .github/workflows/test-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index a2795b0881f..2e8fc9c09f0 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -69,7 +69,7 @@ jobs: - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | - bash.exe .ci/build.sh + .ci/build.sh - name: Test run: |