Skip to content

Commit e0eec1e

Browse files
committed
Merge branch 'master' into rm-3.5
1 parent 1fe4070 commit e0eec1e

File tree

186 files changed

+1049
-525
lines changed

Some content is hidden

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

186 files changed

+1049
-525
lines changed

.ci/install.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ pip install -U pytest-cov
3030
pip install pyroma
3131
pip install test-image-results
3232
pip install numpy
33-
if [ "$TRAVIS_PYTHON_VERSION" == "3.9-dev" ]; then pip install setuptools==47.3.1 ; fi
33+
34+
# TODO Remove when 3.9-dev includes setuptools 49.3.2+:
35+
if [ "$GHA_PYTHON_VERSION" == "3.9-dev" ]; then pip install -U "setuptools>=49.3.2" ; fi
36+
3437
if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then
3538
# arm64, ppc64le, s390x CPUs:
3639
# "ERROR: Could not find a version that satisfies the requirement pyqt5"

.github/workflows/macos-install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ pip install test-image-results
1515
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
1616
pip install numpy
1717

18+
# TODO Remove when 3.9-dev includes setuptools 49.3.2+:
19+
if [ "$GHA_PYTHON_VERSION" == "3.9-dev" ]; then pip install -U "setuptools>=49.3.2" ; fi
20+
1821
# extra test images
1922
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/test-windows.yml

+54-18
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ jobs:
6363
- name: pip install wheel pytest pytest-cov
6464
run: python -m pip install wheel pytest pytest-cov
6565

66-
- name: Prepare dependencies
66+
# TODO Remove when 3.9-dev includes setuptools 49.3.2+:
67+
- name: Upgrade setuptools
68+
if: "contains(matrix.python-version, '3.9-dev')"
69+
run: python -m pip install -U "setuptools>=49.3.2"
70+
71+
- name: Install dependencies
6772
run: |
6873
7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\"
6974
Write-Host "::add-path::$env:RUNNER_WORKSPACE\nasm-2.14.02"
@@ -72,41 +77,71 @@ jobs:
7277
Write-Host "::add-path::C:\Program Files (x86)\gs\gs9.50\bin"
7378
7479
xcopy /s winbuild\depends\test_images\* Tests\images\
80+
shell: pwsh
7581

76-
& python.exe winbuild\build_prepare.py -v --python=$env:pythonLocation
82+
- name: Cache build
83+
id: build-cache
84+
uses: actions/cache@v2
85+
with:
86+
path: winbuild\build
87+
key:
88+
${{ hashFiles('winbuild\build_prepare.py') }}-${{ hashFiles('.github\workflows\test-windows.yml') }}-${{ env.pythonLocation }}
89+
90+
- name: Prepare build
91+
if: steps.build-cache.outputs.cache-hit != 'true'
92+
run: |
93+
& python.exe winbuild\build_prepare.py -v --python=$env:pythonLocation --srcdir
7794
shell: pwsh
7895

7996
- name: Build dependencies / libjpeg-turbo
97+
if: steps.build-cache.outputs.cache-hit != 'true'
8098
run: "& winbuild\\build\\build_dep_libjpeg.cmd"
8199
- name: Build dependencies / zlib
100+
if: steps.build-cache.outputs.cache-hit != 'true'
82101
run: "& winbuild\\build\\build_dep_zlib.cmd"
83102
- name: Build dependencies / LibTiff
103+
if: steps.build-cache.outputs.cache-hit != 'true'
84104
run: "& winbuild\\build\\build_dep_libtiff.cmd"
85105
- name: Build dependencies / WebP
106+
if: steps.build-cache.outputs.cache-hit != 'true'
86107
run: "& winbuild\\build\\build_dep_libwebp.cmd"
87108
- name: Build dependencies / FreeType
109+
if: steps.build-cache.outputs.cache-hit != 'true'
88110
run: "& winbuild\\build\\build_dep_freetype.cmd"
89111
- name: Build dependencies / LCMS2
112+
if: steps.build-cache.outputs.cache-hit != 'true'
90113
run: "& winbuild\\build\\build_dep_lcms2.cmd"
91114
- name: Build dependencies / OpenJPEG
115+
if: steps.build-cache.outputs.cache-hit != 'true'
92116
run: "& winbuild\\build\\build_dep_openjpeg.cmd"
93117

94-
# GPL licensed; skip if building wheels
118+
# GPL licensed
95119
- name: Build dependencies / libimagequant
96-
if: "github.event_name != 'push'"
120+
if: steps.build-cache.outputs.cache-hit != 'true'
97121
run: "& winbuild\\build\\build_dep_libimagequant.cmd"
98122

99123
# Raqm dependencies
100124
- name: Build dependencies / HarfBuzz
125+
if: steps.build-cache.outputs.cache-hit != 'true'
101126
run: "& winbuild\\build\\build_dep_harfbuzz.cmd"
102127
- name: Build dependencies / FriBidi
128+
if: steps.build-cache.outputs.cache-hit != 'true'
103129
run: "& winbuild\\build\\build_dep_fribidi.cmd"
104130
- name: Build dependencies / Raqm
131+
if: steps.build-cache.outputs.cache-hit != 'true'
105132
run: "& winbuild\\build\\build_dep_libraqm.cmd"
106133

134+
# trim ~150MB x 9
135+
- name: Optimize build cache
136+
if: steps.build-cache.outputs.cache-hit != 'true'
137+
run: rmdir /S /Q winbuild\build\src
138+
shell: cmd
139+
107140
- name: Build Pillow
108141
run: |
109-
& winbuild\build\build_pillow.cmd install
142+
$FLAGS=""
143+
if ('${{ github.event_name }}' -eq 'push') { $FLAGS="--disable-imagequant" }
144+
& winbuild\build\build_pillow.cmd $FLAGS install
110145
& $env:pythonLocation\python.exe selftest.py --installed
111146
shell: pwsh
112147

@@ -151,7 +186,7 @@ jobs:
151186
if: "github.event_name == 'push'"
152187
run: |
153188
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
154-
winbuild\\build\\build_pillow.cmd bdist_wheel"
189+
winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
155190
shell: cmd
156191

157192
- uses: actions/upload-artifact@v2
@@ -169,8 +204,10 @@ jobs:
169204
mingw: ["MINGW32", "MINGW64"]
170205
include:
171206
- mingw: "MINGW32"
207+
name: "MSYS2 MinGW 32-bit"
172208
package: "mingw-w64-i686"
173209
- mingw: "MINGW64"
210+
name: "MSYS2 MinGW 64-bit"
174211
package: "mingw-w64-x86_64"
175212

176213
defaults:
@@ -181,7 +218,7 @@ jobs:
181218
CHERE_INVOKING: 1
182219

183220
timeout-minutes: 30
184-
name: MSYS2 ${{ matrix.mingw }}
221+
name: ${{ matrix.name }}
185222

186223
steps:
187224
- uses: actions/checkout@v2
@@ -193,23 +230,22 @@ jobs:
193230
- name: Install Dependencies
194231
run: |
195232
pacman -S --noconfirm \
196-
${{ matrix.package }}-python3-pip \
197-
${{ matrix.package }}-python3-setuptools \
198-
${{ matrix.package }}-python3-pytest \
199-
${{ matrix.package }}-python3-pytest-cov \
200233
${{ matrix.package }}-python3-cffi \
201-
${{ matrix.package }}-python3-olefile \
202234
${{ matrix.package }}-python3-numpy \
235+
${{ matrix.package }}-python3-olefile \
236+
${{ matrix.package }}-python3-pip \
203237
${{ matrix.package }}-python3-pyqt5 \
204-
${{ matrix.package }}-python3-numpy \
238+
${{ matrix.package }}-python3-pytest \
239+
${{ matrix.package }}-python3-pytest-cov \
240+
${{ matrix.package }}-python3-setuptools \
205241
${{ matrix.package }}-freetype \
242+
${{ matrix.package }}-ghostscript \
206243
${{ matrix.package }}-lcms2 \
207-
${{ matrix.package }}-libwebp \
208-
${{ matrix.package }}-libjpeg-turbo \
209-
${{ matrix.package }}-openjpeg2 \
210244
${{ matrix.package }}-libimagequant \
245+
${{ matrix.package }}-libjpeg-turbo \
211246
${{ matrix.package }}-libraqm \
212-
${{ matrix.package }}-ghostscript \
247+
${{ matrix.package }}-libwebp \
248+
${{ matrix.package }}-openjpeg2 \
213249
subversion
214250
215251
python3 -m pip install pyroma
@@ -231,4 +267,4 @@ jobs:
231267
python3 -m pip install codecov
232268
bash <(curl -s https://codecov.io/bash) -F GHA_Windows
233269
env:
234-
CODECOV_NAME: MSYS2 ${{ matrix.mingw }}
270+
CODECOV_NAME: ${{ matrix.name }}

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ jobs:
6262
if: startsWith(matrix.os, 'ubuntu')
6363
run: |
6464
.ci/install.sh
65+
env:
66+
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
6567

6668
- name: Install macOS dependencies
6769
if: startsWith(matrix.os, 'macOS')
6870
run: |
6971
.github/workflows/macos-install.sh
72+
env:
73+
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
7074

7175
- name: Build
7276
run: |

.pre-commit-config.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 6bedb5c58a7d8c25aa9509f8217bc24e9797e90d # frozen: 19.10b0
3+
rev: e66be67b9b6811913470f70c28b4d50f94d05b22 # frozen: 20.8b1
44
hooks:
55
- id: black
66
args: ["--target-version", "py36"]
@@ -9,35 +9,35 @@ repos:
99
types: []
1010

1111
- repo: https://github.com/timothycrosley/isort
12-
rev: 7c29dd9d55161704cfc45998c6f5c2c43d39264b # frozen: 4.3.21
12+
rev: 377d260ffa6f746693f97b46d95025afc4bd8275 # frozen: 5.4.2
1313
hooks:
1414
- id: isort
1515

1616
- repo: https://github.com/asottile/yesqa
17-
rev: b13a51aa54142c59219c764e9f9362c049b439ed # frozen: v1.2.0
17+
rev: 7a009f3ee493c796827ee334f9058b110a0e0db8 # frozen: v1.2.1
1818
hooks:
1919
- id: yesqa
2020

2121
- repo: https://github.com/Lucas-C/pre-commit-hooks
22-
rev: ffbd448645bad2e7ca13f96fca5830058d27ccd5 # frozen: v1.1.7
22+
rev: f30f4974a08a6b2f6a1eeaf30a4d501cf909163a # frozen: v1.1.9
2323
hooks:
2424
- id: remove-tabs
2525
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.opt$)
2626

2727
- repo: https://gitlab.com/pycqa/flake8
28-
rev: 735cfe7e1c57a8e05f660ba75de72313005af54a # frozen: 3.8.2
28+
rev: 05f6544aef321e2fee03a1277ce2eef8880fb927 # frozen: 3.8.3
2929
hooks:
3030
- id: flake8
3131
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
3232

3333
- repo: https://github.com/pre-commit/pygrep-hooks
34-
rev: 0d7d077d6ed5624854f93ac601739c1804ebeb98 # frozen: v1.5.1
34+
rev: eae6397e4c259ed3d057511f6dd5330b92867e62 # frozen: v1.6.0
3535
hooks:
3636
- id: python-check-blanket-noqa
3737
- id: rst-backticks
3838

3939
- repo: https://github.com/pre-commit/pre-commit-hooks
40-
rev: ebc15addedad713c86ef18ae9632c88e187dd0af # frozen: v3.1.0
40+
rev: e1668fe86af3810fbca72b8653fe478e66a0afdc # frozen: v3.2.0
4141
hooks:
4242
- id: check-merge-conflict
4343
- id: check-yaml

CHANGES.rst

+24
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,33 @@ Changelog (Pillow)
55
8.0.0 (unreleased)
66
------------------
77

8+
- Fix IFDRational __eq__ bug #4888
9+
[luphord, radarhere]
10+
11+
- Fixed duplicate variable name #4885
12+
[liZe, radarhere]
13+
14+
- Added homebrew zlib include directory #4842
15+
[radarhere]
16+
17+
- Corrected inverted PDF CMYK colors #4866
18+
[radarhere]
19+
20+
- Do not try to close file pointer if file pointer is empty #4823
21+
[radarhere]
22+
23+
- ImageOps.autocontrast: add mask parameter #4843
24+
[navneeth, hugovk]
25+
26+
- Read EXIF data tEXt chunk into info as bytes instead of string #4828
27+
[radarhere]
28+
829
- Remove long-deprecated Image.py functions #4798
930
[hugovk, nulano, radarhere]
1031

32+
- Replaced most uses of distutils with setuptools #4797, #4809, #4814, #4817, #4829
33+
[hugovk, radarhere]
34+
1135
- Add MIME type to PsdImagePlugin #4788
1236
[samamorgan]
1337

Makefile

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
1-
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
2-
.PHONY: clean coverage doc docserve help inplace install install-req release-test sdist test upload upload-test
31
.DEFAULT_GOAL := release-test
42

3+
.PHONY: clean
54
clean:
65
python3 setup.py clean
76
rm src/PIL/*.so || true
87
rm -r build || true
98
find . -name __pycache__ | xargs rm -r || true
109

1110
BRANCHES=`git branch -a | grep -v HEAD | grep -v master | grep remote`
11+
.PHONY: co
1212
co:
1313
-for i in $(BRANCHES) ; do \
1414
git checkout -t $$i ; \
1515
done
1616

17+
.PHONY: coverage
1718
coverage:
1819
pytest -qq
1920
rm -r htmlcov || true
2021
coverage report
2122

23+
.PHONY: doc
2224
doc:
2325
$(MAKE) -C docs html
2426

27+
.PHONY: doccheck
2528
doccheck:
2629
$(MAKE) -C docs html
2730
# Don't make our tests rely on the links in the docs being up every single build.
2831
# We don't control them. But do check, and update them to the target of their redirects.
2932
$(MAKE) -C docs linkcheck || true
3033

34+
.PHONY: docserve
3135
docserve:
3236
cd docs/_build/html && python3 -mSimpleHTTPServer 2> /dev/null&
3337

38+
.PHONY: help
3439
help:
3540
@echo "Welcome to Pillow development. Please use \`make <target>\` where <target> is one of"
3641
@echo " clean remove build products"
@@ -48,31 +53,38 @@ help:
4853
@echo " upload build and upload sdists to PyPI"
4954
@echo " upload-test build and upload sdists to test.pythonpackages.com"
5055

56+
.PHONY: inplace
5157
inplace: clean
5258
python3 setup.py develop build_ext --inplace
5359

60+
.PHONY: install
5461
install:
5562
python3 setup.py install
5663
python3 selftest.py
5764

65+
.PHONY: install-coverage
5866
install-coverage:
5967
CFLAGS="-coverage" python3 setup.py build_ext install
6068
python3 selftest.py
6169

70+
.PHONY: debug
6271
debug:
6372
# make a debug version if we don't have a -dbg python. Leaves in symbols
6473
# for our stuff, kills optimization, and redirects to dev null so we
6574
# see any build failures.
6675
make clean > /dev/null
6776
CFLAGS='-g -O0' python3 setup.py build_ext install > /dev/null
6877

78+
.PHONY: install-req
6979
install-req:
7080
python3 -m pip install -r requirements.txt
7181

82+
.PHONY: install-venv
7283
install-venv:
7384
virtualenv .
7485
bin/pip install -r requirements.txt
7586

87+
.PHONY: release-test
7688
release-test:
7789
$(MAKE) install-req
7890
python3 setup.py develop
@@ -84,22 +96,14 @@ release-test:
8496
pyroma .
8597
viewdoc
8698

99+
.PHONY: sdist
87100
sdist:
88101
python3 setup.py sdist --format=gztar
89102

103+
.PHONY: test
90104
test:
91105
pytest -qq
92106

93-
# https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file
94-
upload-test:
95-
# [test]
96-
# username:
97-
# password:
98-
# repository = http://test.pythonpackages.com
99-
python3 setup.py sdist --format=gztar upload -r test
100-
101-
upload:
102-
python3 setup.py sdist --format=gztar upload
103-
107+
.PHONY: readme
104108
readme:
105109
viewdoc

0 commit comments

Comments
 (0)