Skip to content

Commit 90ece13

Browse files
authored
Merge branch 'master' into master
2 parents f366330 + 28330c2 commit 90ece13

File tree

429 files changed

+23409
-16880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

429 files changed

+23409
-16880
lines changed

.appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ install:
2323
- 7z x pillow-depends.zip -oc:\
2424
- mv c:\pillow-depends-master c:\pillow-depends
2525
- xcopy /S /Y c:\pillow-depends\test_images\* c:\pillow\tests\images
26-
- 7z x ..\pillow-depends\nasm-2.14.02-win64.zip -oc:\
27-
- ..\pillow-depends\gs9533w32.exe /S
28-
- path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.53.3\bin;%PATH%
26+
- 7z x ..\pillow-depends\nasm-2.15.05-win64.zip -oc:\
27+
- ..\pillow-depends\gs9540w32.exe /S
28+
- path c:\nasm-2.15.05;C:\Program Files (x86)\gs\gs9.54.0\bin;%PATH%
2929
- cd c:\pillow\winbuild\
3030
- ps: |
3131
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
3232
c:\pillow\winbuild\build\build_dep_all.cmd
3333
$host.SetShouldExit(0)
3434
- path C:\pillow\winbuild\build\bin;%PATH%
35-
- '%PYTHON%\%EXECUTABLE% -m pip install -U "setuptools>=49.3.2"'
35+
- '%PYTHON%\%EXECUTABLE% -m pip install -U setuptools'
3636

3737
build_script:
3838
- ps: |
@@ -45,6 +45,7 @@ test_script:
4545
- cd c:\pillow
4646
- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov'
4747
- c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE%
48+
- '%PYTHON%\%EXECUTABLE% -c "from PIL import Image"'
4849
- '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests'
4950
#- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest?
5051

.ci/install.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@ python3 -m pip install coverage
2727
python3 -m pip install olefile
2828
python3 -m pip install -U pytest
2929
python3 -m pip install -U pytest-cov
30+
python3 -m pip install -U pytest-timeout
3031
python3 -m pip install pyroma
3132
python3 -m pip install test-image-results
3233
# TODO Remove condition when numpy supports 3.10
3334
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
3435

35-
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
36-
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
37-
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
38-
3936
# PyQt5 doesn't support PyPy3
4037
# Wheel doesn't yet support 3.10
4138
if [[ $GHA_PYTHON_VERSION == 3.* && $GHA_PYTHON_VERSION != "3.10-dev" ]]; then

.ci/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
set -e
44

5-
python -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests
5+
python3 -c "from PIL import Image"
6+
7+
python3 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE

.clang-format

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# A clang-format style that approximates Python's PEP 7
2+
# Useful for IDE integration
3+
BasedOnStyle: Google
4+
AlwaysBreakAfterReturnType: All
5+
AllowShortIfStatementsOnASingleLine: false
6+
AlignAfterOpenBracket: AlwaysBreak
7+
BinPackArguments: false
8+
BinPackParameters: false
9+
BreakBeforeBraces: Attach
10+
ColumnLimit: 88
11+
DerivePointerAlignment: false
12+
IndentWidth: 4
13+
Language: Cpp
14+
PointerAlignment: Right
15+
ReflowComments: true
16+
SortIncludes: false
17+
SpaceBeforeParens: ControlStatements
18+
SpacesInParentheses: false
19+
TabWidth: 4
20+
UseTab: Never

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Please send a pull request to the master branch. Please include [documentation](
1818
- Provide tests for any newly added code.
1919
- Follow PEP 8.
2020
- When committing only documentation changes please include `[ci skip]` in the commit message to avoid running tests on AppVeyor.
21+
- Include [release notes](https://github.com/python-pillow/Pillow/tree/master/docs/releasenotes) as needed or appropriate with your bug fixes, feature additions and tests.
2122

2223
## Reporting Issues
2324

.github/workflows/cifuzz.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CIFuzz
2+
on:
3+
push:
4+
paths:
5+
- "**.c"
6+
- "**.h"
7+
pull_request:
8+
paths:
9+
- "**.c"
10+
- "**.h"
11+
12+
jobs:
13+
Fuzzing:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Build Fuzzers
17+
id: build
18+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
19+
with:
20+
oss-fuzz-project-name: 'pillow'
21+
language: python
22+
dry-run: false
23+
- name: Run Fuzzers
24+
id: run
25+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
26+
with:
27+
oss-fuzz-project-name: 'pillow'
28+
fuzz-seconds: 600
29+
language: python
30+
dry-run: false
31+
- name: Upload New Crash
32+
uses: actions/upload-artifact@v2
33+
if: failure() && steps.build.outcome == 'success'
34+
with:
35+
name: artifacts
36+
path: ./out/artifacts
37+
- name: Upload Legacy Crash
38+
uses: actions/upload-artifact@v2
39+
if: steps.run.outcome == 'success'
40+
with:
41+
name: crash
42+
path: ./out/crash*
43+
- name: Fail on legacy crash
44+
if: success()
45+
run: |
46+
[ ! -e out/crash-* ]
47+
echo No legacy crash detected

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
python-version: 3.8
3535

3636
- name: Build system information
37-
run: python .github/workflows/system-info.py
37+
run: python3 .github/workflows/system-info.py
3838

3939
- name: Install dependencies
4040
run: |
41-
python -m pip install -U pip
42-
python -m pip install -U tox
41+
python3 -m pip install -U pip
42+
python3 -m pip install -U tox
4343
4444
- name: Lint
4545
run: tox -e lint

.github/workflows/macos-install.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ python3 -m pip install coverage
99
python3 -m pip install olefile
1010
python3 -m pip install -U pytest
1111
python3 -m pip install -U pytest-cov
12+
python3 -m pip install -U pytest-timeout
1213
python3 -m pip install pyroma
1314
python3 -m pip install test-image-results
1415

1516
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
1617
# TODO Remove condition when numpy supports 3.10
1718
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
1819

19-
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
20-
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
21-
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
22-
2320
# extra test images
2421
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/test-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
centos-7-amd64,
2222
centos-8-amd64,
2323
debian-10-buster-x86,
24-
fedora-32-amd64,
2524
fedora-33-amd64,
25+
fedora-34-amd64,
2626
ubuntu-18.04-bionic-amd64,
2727
ubuntu-20.04-focal-amd64,
2828
]
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v2
4242

4343
- name: Build system information
44-
run: python .github/workflows/system-info.py
44+
run: python3 .github/workflows/system-info.py
4545

4646
- name: Set up QEMU
4747
if: "matrix.qemu-arch"

.github/workflows/test-valgrind.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test Valgrind
2+
3+
# like the docker tests, but running valgrind only on *.c/*.h changes.
4+
5+
on:
6+
push:
7+
paths:
8+
- "**.c"
9+
- "**.h"
10+
pull_request:
11+
paths:
12+
- "**.c"
13+
- "**.h"
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
docker: [
23+
ubuntu-20.04-focal-amd64-valgrind,
24+
]
25+
dockerTag: [master]
26+
27+
name: ${{ matrix.docker }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Build system information
33+
run: python3 .github/workflows/system-info.py
34+
35+
- name: Docker pull
36+
run: |
37+
docker pull pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
38+
39+
- name: Build and Run Valgrind
40+
run: |
41+
# The Pillow user in the docker container is UID 1000
42+
sudo chown -R 1000 $GITHUB_WORKSPACE
43+
docker run --name pillow_container -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
44+
sudo chown -R runner $GITHUB_WORKSPACE
45+
46+
success:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
name: Valgrind Test Successful
50+
steps:
51+
- name: Success
52+
run: echo Valgrind Test Successful

.github/workflows/test-windows.yml

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ["pypy-3.6", "pypy-3.7", "3.6", "3.7", "3.8", "3.9", "3.10-dev"]
11+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"]
1212
architecture: ["x86", "x64"]
1313
include:
14-
- architecture: "x86"
15-
platform-vcvars: "x86"
16-
platform-msbuild: "Win32"
17-
- architecture: "x64"
18-
platform-vcvars: "x86_amd64"
19-
platform-msbuild: "x64"
20-
exclude:
21-
# PyPy does not support 64-bit on Windows
14+
# PyPy3.6 only ships 32-bit binaries for Windows
2215
- python-version: "pypy-3.6"
23-
architecture: "x64"
16+
architecture: "x86"
17+
# PyPy 7.3.4+ only ships 64-bit binaries for Windows
2418
- python-version: "pypy-3.7"
2519
architecture: "x64"
2620
timeout-minutes: 30
@@ -57,22 +51,17 @@ jobs:
5751
- name: Print build system information
5852
run: python .github/workflows/system-info.py
5953

60-
- name: python -m pip install wheel pytest pytest-cov
61-
run: python -m pip install wheel pytest pytest-cov
62-
63-
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
64-
- name: Upgrade setuptools
65-
if: "contains(matrix.python-version, '3.8') || contains(matrix.python-version, '3.9')"
66-
run: python -m pip install -U "setuptools>=49.3.2"
54+
- name: python -m pip install wheel pytest pytest-cov pytest-timeout
55+
run: python -m pip install wheel pytest pytest-cov pytest-timeout
6756

6857
- name: Install dependencies
6958
id: install
7059
run: |
71-
7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\"
72-
echo "$env:RUNNER_WORKSPACE\nasm-2.14.02" >> $env:GITHUB_PATH
60+
7z x winbuild\depends\nasm-2.15.05-win64.zip "-o$env:RUNNER_WORKSPACE\"
61+
echo "$env:RUNNER_WORKSPACE\nasm-2.15.05" >> $env:GITHUB_PATH
7362
74-
winbuild\depends\gs9533w32.exe /S
75-
echo "C:\Program Files (x86)\gs\gs9.53.3\bin" >> $env:GITHUB_PATH
63+
winbuild\depends\gs9540w32.exe /S
64+
echo "C:\Program Files (x86)\gs\gs9.54.0\bin" >> $env:GITHUB_PATH
7665
7766
xcopy /S /Y winbuild\depends\test_images\* Tests\images\
7867
@@ -110,7 +99,7 @@ jobs:
11099
if: steps.build-cache.outputs.cache-hit != 'true'
111100
run: "& winbuild\\build\\build_dep_libwebp.cmd"
112101

113-
# for FreeType CBDT font support
102+
# for FreeType CBDT/SBIX font support
114103
- name: Build dependencies / libpng
115104
if: steps.build-cache.outputs.cache-hit != 'true'
116105
run: "& winbuild\\build\\build_dep_libpng.cmd"
@@ -137,14 +126,11 @@ jobs:
137126
if: steps.build-cache.outputs.cache-hit != 'true'
138127
run: "& winbuild\\build\\build_dep_harfbuzz.cmd"
139128

129+
# Raqm dependencies
140130
- name: Build dependencies / FriBidi
141131
if: steps.build-cache.outputs.cache-hit != 'true'
142132
run: "& winbuild\\build\\build_dep_fribidi.cmd"
143133

144-
- name: Build dependencies / Raqm
145-
if: steps.build-cache.outputs.cache-hit != 'true'
146-
run: "& winbuild\\build\\build_dep_libraqm.cmd"
147-
148134
# trim ~150MB x 9
149135
- name: Optimize build cache
150136
if: steps.build-cache.outputs.cache-hit != 'true'
@@ -174,7 +160,7 @@ jobs:
174160
if: failure()
175161
run: |
176162
mkdir -p Tests/errors
177-
shell: pwsh
163+
shell: bash
178164

179165
- name: Upload errors
180166
uses: actions/upload-artifact@v2
@@ -197,16 +183,14 @@ jobs:
197183

198184
- name: Build wheel
199185
id: wheel
200-
# Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
201-
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
186+
if: "github.event_name == 'push'"
202187
run: |
203188
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
204189
winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
205190
shell: cmd
206191

207192
- uses: actions/upload-artifact@v2
208-
# Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
209-
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
193+
if: "github.event_name == 'push'"
210194
with:
211195
name: ${{ steps.wheel.outputs.dist }}
212196
path: dist\*.whl
@@ -251,8 +235,6 @@ jobs:
251235
${{ matrix.package }}-python3-olefile \
252236
${{ matrix.package }}-python3-pip \
253237
${{ matrix.package }}-python3-pyqt5 \
254-
${{ matrix.package }}-python3-pytest \
255-
${{ matrix.package }}-python3-pytest-cov \
256238
${{ matrix.package }}-python3-setuptools \
257239
${{ matrix.package }}-freetype \
258240
${{ matrix.package }}-ghostscript \
@@ -265,7 +247,7 @@ jobs:
265247
${{ matrix.package }}-openjpeg2 \
266248
subversion
267249
268-
python3 -m pip install pyroma
250+
python3 -m pip install pyroma pytest pytest-cov
269251
270252
pushd depends && ./install_extra_test_images.sh && popd
271253
@@ -275,6 +257,7 @@ jobs:
275257
- name: Test Pillow
276258
run: |
277259
python3 selftest.py --installed
260+
python3 -c "from PIL import Image"
278261
python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests
279262
280263
- name: Upload coverage

0 commit comments

Comments
 (0)