Skip to content

Commit

Permalink
Merge branch 'python-pillow:main' into int_def
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Nov 20, 2022
2 parents 6c65d3f + df8e872 commit d98c634
Show file tree
Hide file tree
Showing 114 changed files with 1,579 additions and 745 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
TEST_OPTIONS:
DEPLOY: YES
matrix:
- PYTHON: C:/Python310
- PYTHON: C:/Python311
ARCHITECTURE: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- PYTHON: C:/Python37-x64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -30,7 +30,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.x"
cache: pip
cache-dependency-path: "setup.py"

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/macos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype openblas libraqm
brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype libraqm

PYTHONOPTIMIZE=0 python3 -m pip install cffi
python3 -m pip install coverage
Expand All @@ -13,7 +13,6 @@ python3 -m pip install -U pytest-cov
python3 -m pip install -U pytest-timeout
python3 -m pip install pyroma

echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
python3 -m pip install numpy

# extra test images
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -30,8 +30,8 @@ jobs:
centos-stream-9-amd64,
debian-10-buster-x86,
debian-11-bullseye-x86,
fedora-35-amd64,
fedora-36-amd64,
fedora-37-amd64,
gentoo,
ubuntu-18.04-bionic-amd64,
ubuntu-20.04-focal-amd64,
Expand Down
51 changes: 44 additions & 7 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
architecture: ["x86", "x64"]
include:
# PyPy 7.3.4+ only ships 64-bit binaries for Windows
Expand Down Expand Up @@ -65,7 +65,9 @@ jobs:
xcopy /S /Y winbuild\depends\test_images\* Tests\images\
# make cache key depend on VS version
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" | find """catalog_buildVersion""" | ForEach-Object { $a = $_.split(" ")[1]; echo "::set-output name=vs::$a" }
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" `
| find """catalog_buildVersion""" `
| ForEach-Object { $a = $_.split(" ")[1]; echo "vs=$a" >> $env:GITHUB_OUTPUT }
shell: pwsh

- name: Cache build
Expand All @@ -90,19 +92,28 @@ jobs:
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_zlib.cmd"

- name: Build dependencies / LibTiff
- name: Build dependencies / xz
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libtiff.cmd"
run: "& winbuild\\build\\build_dep_xz.cmd"

- name: Build dependencies / WebP
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libwebp.cmd"

- name: Build dependencies / LibTiff
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libtiff.cmd"

# for FreeType CBDT/SBIX font support
- name: Build dependencies / libpng
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libpng.cmd"

# for FreeType WOFF2 font support
- name: Build dependencies / brotli
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_brotli.cmd"

- name: Build dependencies / FreeType
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_freetype.cmd"
Expand Down Expand Up @@ -185,16 +196,42 @@ jobs:
id: wheel
if: "github.event_name != 'pull_request'"
run: |
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
mkdir fribidi\${{ matrix.architecture }}
copy winbuild\build\bin\fribidi* fribidi\${{ matrix.architecture }}
setlocal EnableDelayedExpansion
for %%f in (winbuild\build\license\*) do (
set x=%%~nf
rem Skip FriBiDi license, it is not included in the wheel.
set fribidi=!x:~0,7!
if NOT !fribidi!==fribidi (
rem Skip imagequant license, it is not included in the wheel.
set libimagequant=!x:~0,13!
if NOT !libimagequant!==libimagequant (
echo. >> LICENSE
echo ===== %%~nf ===== >> LICENSE
echo. >> LICENSE
type %%f >> LICENSE
)
)
)
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo dist=dist-%%a >> %GITHUB_OUTPUT%
winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
shell: cmd

- uses: actions/upload-artifact@v3
- name: Upload wheel
uses: actions/upload-artifact@v3
if: "github.event_name != 'pull_request'"
with:
name: ${{ steps.wheel.outputs.dist }}
path: dist\*.whl

- name: Upload fribidi.dll
if: "github.event_name != 'pull_request' && matrix.python-version == 3.11"
uses: actions/upload-artifact@v3
with:
name: fribidi
path: fribidi\*

success:
permissions:
contents: none
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -22,7 +22,7 @@ jobs:
python-version: [
"pypy-3.8",
"pypy-3.7",
"3.11-dev",
"3.11",
"3.10",
"3.9",
"3.8",
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
path: Tests/errors

- name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.10
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.11
run: |
make doccheck
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/tidelift.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
args: ["--target-version", "py37"]
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
- id: check-yaml

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.6.1
rev: v0.6.7
hooks:
- id: sphinx-lint

Expand Down
113 changes: 112 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,120 @@
Changelog (Pillow)
==================

9.3.0 (unreleased)
9.4.0 (unreleased)
------------------

- Use fractional coordinates when drawing text #6722
[radarhere]

- Fixed writing int as BYTE tag #6740
[radarhere]

- Added MP Format Version when saving MPO #6735
[radarhere]

- Added Interop to ExifTags #6724
[radarhere]

- CVE-2007-4559 patch when building on Windows #6704
[TrellixVulnTeam, nulano, radarhere]

- Fix compiler warning: accessing 64 bytes in a region of size 48 #6714
[wiredfool]

- Use verbose flag for pip install #6713
[wiredfool, radarhere]

9.3.0 (2022-10-29)
------------------

- Limit SAMPLESPERPIXEL to avoid runtime DOS #6700
[wiredfool]

- Initialize libtiff buffer when saving #6699
[radarhere]

- Inline fname2char to fix memory leak #6329
[nulano]

- Fix memory leaks related to text features #6330
[nulano]

- Use double quotes for version check on old CPython on Windows #6695
[hugovk]

- Remove backup implementation of Round for Windows platforms #6693
[cgohlke]

- Fixed set_variation_by_name offset #6445
[radarhere]

- Fix malloc in _imagingft.c:font_setvaraxes #6690
[cgohlke]

- Release Python GIL when converting images using matrix operations #6418
[hmaarrfk]

- Added ExifTags enums #6630
[radarhere]

- Do not modify previous frame when calculating delta in PNG #6683
[radarhere]

- Added support for reading BMP images with RLE4 compression #6674
[npjg, radarhere]

- Decode JPEG compressed BLP1 data in original mode #6678
[radarhere]

- Added GPS TIFF tag info #6661
[radarhere]

- Added conversion between RGB/RGBA/RGBX and LAB #6647
[radarhere]

- Do not attempt normalization if mode is already normal #6644
[radarhere]

- Fixed seeking to an L frame in a GIF #6576
[radarhere]

- Consider all frames when selecting mode for PNG save_all #6610
[radarhere]

- Don't reassign crc on ChunkStream close #6627
[wiredfool, radarhere]

- Raise a warning if NumPy failed to raise an error during conversion #6594
[radarhere]

- Show all frames in ImageShow #6611
[radarhere]

- Allow FLI palette chunk to not be first #6626
[radarhere]

- If first GIF frame has transparency for RGB_ALWAYS loading strategy, use RGBA mode #6592
[radarhere]

- Round box position to integer when pasting embedded color #6517
[radarhere, nulano]

- Removed EXIF prefix when saving WebP #6582
[radarhere]

- Pad IM palette to 768 bytes when saving #6579
[radarhere]

- Added DDS BC6H reading #6449
[ShadelessFox, REDxEYE, radarhere]

- Added support for opening WhiteIsZero 16-bit integer TIFF images #6642
[JayWiz, radarhere]

- Raise an error when allocating translucent color to RGB palette #6654
[jsbueno, radarhere]

- Added reading of TIFF child images #6569
[radarhere]

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ inplace: clean

.PHONY: install
install:
python3 -m pip install .
python3 -m pip -v install .
python3 selftest.py

.PHONY: install-coverage
install-coverage:
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install --global-option="build_ext" .
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip -v install --global-option="build_ext" .
python3 selftest.py

.PHONY: debug
Expand All @@ -67,7 +67,7 @@ debug:
# for our stuff, kills optimization, and redirects to dev null so we
# see any build failures.
make clean > /dev/null
CFLAGS='-g -O0' python3 -m pip install --global-option="build_ext" . > /dev/null
CFLAGS='-g -O0' python3 -m pip -v install --global-option="build_ext" . > /dev/null

.PHONY: release-test
release-test:
Expand Down
Loading

0 comments on commit d98c634

Please sign in to comment.