Skip to content

Commit c4325c8

Browse files
authored
Merge pull request #5878 from DWesl/add-cygwin-to-ci
2 parents 9c580ce + 30db27c commit c4325c8

File tree

8 files changed

+151
-23
lines changed

8 files changed

+151
-23
lines changed

.ci/after_success.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# gather the coverage data
44
python3 -m pip install codecov
55
if [[ $MATRIX_DOCKER ]]; then
6-
coverage xml --ignore-errors
6+
python3 -m coverage xml --ignore-errors
77
else
8-
coverage xml
8+
python3 -m coverage xml
99
fi

.ci/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
coverage erase
5+
python3 -m coverage erase
66
if [ $(uname) == "Darwin" ]; then
77
export CPPFLAGS="-I/usr/local/miniconda/include";
88
fi

.ci/install.sh

+28-19
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ aptget_update()
1313
return 1
1414
fi
1515
}
16-
aptget_update || aptget_update retry || aptget_update retry
16+
if [[ $(uname) != CYGWIN* ]]; then
17+
aptget_update || aptget_update retry || aptget_update retry
18+
fi
1719

1820
set -e
1921

20-
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
21-
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
22-
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
22+
if [[ $(uname) != CYGWIN* ]]; then
23+
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
24+
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
25+
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
26+
fi
2327

2428
python3 -m pip install --upgrade pip
2529
python3 -m pip install --upgrade wheel
@@ -32,23 +36,28 @@ python3 -m pip install -U pytest-cov
3236
python3 -m pip install -U pytest-timeout
3337
python3 -m pip install pyroma
3438
python3 -m pip install test-image-results
35-
# TODO Remove condition when NumPy supports 3.11
36-
if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi
3739

38-
# PyQt6 doesn't support PyPy3
39-
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
40-
sudo apt-get -qq install libegl1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxkbcommon-x11-0
41-
python3 -m pip install pyqt6
42-
fi
40+
if [[ $(uname) != CYGWIN* ]]; then
41+
# TODO Remove condition when NumPy supports 3.11
42+
if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi
4343

44-
# webp
45-
pushd depends && ./install_webp.sh && popd
44+
# PyQt6 doesn't support PyPy3
45+
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
46+
sudo apt-get -qq install libegl1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxkbcommon-x11-0
47+
python3 -m pip install pyqt6
48+
fi
49+
50+
# webp
51+
pushd depends && ./install_webp.sh && popd
4652

47-
# libimagequant
48-
pushd depends && ./install_imagequant.sh && popd
53+
# libimagequant
54+
pushd depends && ./install_imagequant.sh && popd
4955

50-
# raqm
51-
pushd depends && ./install_raqm.sh && popd
56+
# raqm
57+
pushd depends && ./install_raqm.sh && popd
5258

53-
# extra test images
54-
pushd depends && ./install_extra_test_images.sh && popd
59+
# extra test images
60+
pushd depends && ./install_extra_test_images.sh && popd
61+
else
62+
cd depends && ./install_extra_test_images.sh && cd ..
63+
fi

.github/mergify.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pull_request_rules:
88
- status-success=Docker Test Successful
99
- status-success=Windows Test Successful
1010
- status-success=MinGW Test Successful
11+
- status-success=Cygwin Test Successful
1112
- status-success=continuous-integration/appveyor/pr
1213
actions:
1314
merge:

.github/workflows/test-cygwin.yml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Test Cygwin
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-minor-version: [7, 8, 9]
12+
13+
timeout-minutes: 40
14+
15+
name: Python 3.${{ matrix.python-minor-version }}
16+
17+
steps:
18+
- name: Fix line endings
19+
run: |
20+
git config --global core.autocrlf input
21+
22+
- name: Checkout Pillow
23+
uses: actions/checkout@v3
24+
25+
- name: Install Cygwin
26+
uses: cygwin/cygwin-install-action@v2
27+
with:
28+
platform: x86_64
29+
packages: >
30+
ImageMagick gcc-g++ ghostscript jpeg libfreetype-devel
31+
libimagequant-devel libjpeg-devel liblapack-devel
32+
liblcms2-devel libopenjp2-devel libraqm-devel
33+
libtiff-devel libwebp-devel libxcb-devel libxcb-xinerama0
34+
make netpbm perl
35+
python3${{ matrix.python-minor-version }}-cffi
36+
python3${{ matrix.python-minor-version }}-cython
37+
python3${{ matrix.python-minor-version }}-devel
38+
python3${{ matrix.python-minor-version }}-numpy
39+
python3${{ matrix.python-minor-version }}-sip
40+
python3${{ matrix.python-minor-version }}-tkinter
41+
qt5-devel-tools subversion xorg-server-extra zlib-devel
42+
43+
- name: Add Lapack to PATH
44+
uses: egor-tensin/cleanup-path@v1
45+
with:
46+
dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack'
47+
48+
- name: pip cache
49+
uses: actions/cache@v3
50+
with:
51+
path: 'C:\cygwin\home\runneradmin\.cache\pip'
52+
key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }}
53+
restore-keys: |
54+
${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-
55+
56+
- name: Build system information
57+
run: |
58+
dash.exe -c "python3 .github/workflows/system-info.py"
59+
60+
- name: Install dependencies
61+
run: |
62+
bash.exe .ci/install.sh
63+
64+
- name: Install a different NumPy
65+
shell: dash.exe -l "{0}"
66+
run: |
67+
python3 -m pip install -U 'numpy!=1.21.*'
68+
69+
- name: Build
70+
shell: bash.exe -eo pipefail -o igncr "{0}"
71+
run: |
72+
.ci/build.sh
73+
74+
- name: Test
75+
run: |
76+
bash.exe xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
77+
78+
- name: Prepare to upload errors
79+
if: failure()
80+
run: |
81+
dash.exe -c "mkdir -p Tests/errors"
82+
83+
- name: Upload errors
84+
uses: actions/upload-artifact@v3
85+
if: failure()
86+
with:
87+
name: errors
88+
path: Tests/errors
89+
90+
- name: After success
91+
run: |
92+
bash.exe .ci/after_success.sh
93+
94+
- name: Upload coverage
95+
uses: codecov/codecov-action@v3
96+
with:
97+
file: ./coverage.xml
98+
flags: GHA_Cygwin
99+
name: Cygwin Python 3.${{ matrix.python-minor-version }}
100+
101+
success:
102+
needs: build
103+
runs-on: ubuntu-latest
104+
name: Cygwin Test Successful
105+
steps:
106+
- name: Success
107+
run: echo Cygwin Test Successful

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ As of 2019, Pillow development is
3636
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-mingw.yml"><img
3737
alt="GitHub Actions build status (Test MinGW)"
3838
src="https://github.com/python-pillow/Pillow/workflows/Test%20MinGW/badge.svg"></a>
39+
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-cygwin.yml"><img
40+
alt="GitHub Actions build status (Test Cygwin)"
41+
src="https://github.com/python-pillow/Pillow/workflows/Test%20Cygwin/badge.svg"></a>
3942
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-docker.yml"><img
4043
alt="GitHub Actions build status (Test Docker)"
4144
src="https://github.com/python-pillow/Pillow/workflows/Test%20Docker/badge.svg"></a>

docs/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more <h
2929
:target: https://github.com/python-pillow/Pillow/actions/workflows/test-mingw.yml
3030
:alt: GitHub Actions build status (Test MinGW)
3131

32+
.. image:: https://github.com/python-pillow/Pillow/workflows/Test%20Cygwin/badge.svg
33+
:target: https://github.com/python-pillow/Pillow/actions/workflows/test-cygwin.yml
34+
:alt: GitHub Actions build status (Test Cygwin)
35+
3236
.. image:: https://img.shields.io/appveyor/build/python-pillow/Pillow/main.svg?label=Windows%20build
3337
:target: https://ci.appveyor.com/project/python-pillow/Pillow
3438
:alt: AppVeyor CI build status (Windows)

docs/installation.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,9 @@ These platforms are built and tested for every change.
485485
| Windows Server 2022 | 3.7, 3.8, 3.9, 3.10, 3.11, | x86, x86-64 |
486486
| | PyPy3 | |
487487
| +----------------------------+---------------------+
488-
| | 3.9/MinGW | x86, x86-64 |
488+
| | 3.9 (MinGW) | x86, x86-64 |
489+
| +----------------------------+---------------------+
490+
| | 3.7, 3.8, 3.9 (Cygwin) | x86-64 |
489491
+----------------------------------+----------------------------+---------------------+
490492

491493

@@ -570,6 +572,8 @@ These platforms have been reported to work at the versions mentioned.
570572
+----------------------------------+---------------------------+------------------+--------------+
571573
| Windows 10 | 3.7 | 7.1.0 |x86-64 |
572574
+----------------------------------+---------------------------+------------------+--------------+
575+
| Windows 10/Cygwin 3.3 | 3.6, 3.7, 3.8, 3.9 | 8.4.0 |x86-64 |
576+
+----------------------------------+---------------------------+------------------+--------------+
573577
| Windows 8.1 Pro | 2.6, 2.7, 3.2, 3.3, 3.4 | 2.4.0 |x86,x86-64 |
574578
+----------------------------------+---------------------------+------------------+--------------+
575579
| Windows 8 Pro | 2.6, 2.7, 3.2, 3.3, 3.4a3 | 2.2.0 |x86,x86-64 |

0 commit comments

Comments
 (0)