Skip to content

Commit

Permalink
Merge branch 'main' into progress
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored Oct 12, 2024
2 parents ebbdc6e + b0d79c8 commit fc5c096
Show file tree
Hide file tree
Showing 80 changed files with 816 additions and 448 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ environment:
TEST_OPTIONS:
DEPLOY: YES
matrix:
- PYTHON: C:/Python312
- PYTHON: C:/Python313
ARCHITECTURE: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- PYTHON: C:/Python39-x64
Expand Down
2 changes: 1 addition & 1 deletion .ci/requirements-cibw.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cibuildwheel==2.21.1
cibuildwheel==2.21.3
4 changes: 2 additions & 2 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
- "**"
paths:
- ".github/workflows/cifuzz.yml"
- ".github/workflows/wheels-dependencies.sh"
- "**.c"
- "**.h"
pull_request:
paths:
- ".github/workflows/cifuzz.yml"
- ".github/workflows/wheels-dependencies.sh"
- "**.c"
- "**.h"
workflow_dispatch:
Expand All @@ -24,8 +26,6 @@ concurrency:

jobs:
Fuzzing:
# Disabled until google/oss-fuzz#11419 upgrades Python to 3.9+
if: false
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
Expand Down
40 changes: 12 additions & 28 deletions .github/workflows/wheels-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ ARCHIVE_SDIR=pillow-depends-main

# Package versions for fresh source builds
FREETYPE_VERSION=2.13.2
if [[ "$MB_ML_VER" != 2014 ]]; then
HARFBUZZ_VERSION=10.0.1
else
HARFBUZZ_VERSION=8.5.0
fi
HARFBUZZ_VERSION=10.0.1
LIBPNG_VERSION=1.6.44
JPEGTURBO_VERSION=3.0.4
OPENJPEG_VERSION=2.5.2
XZ_VERSION=5.6.2
XZ_VERSION=5.6.3
TIFF_VERSION=4.6.0
LCMS2_VERSION=2.16
if [[ -n "$IS_MACOS" ]]; then
Expand Down Expand Up @@ -65,21 +61,15 @@ function build_brotli {
}

function build_harfbuzz {
if [[ "$HARFBUZZ_VERSION" == 8.5.0 ]]; then
export FREETYPE_LIBS=-lfreetype
export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/
build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no
export FREETYPE_LIBS=""
export FREETYPE_CFLAGS=""
else
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
(cd $out_dir \
&& meson setup build --buildtype=release -Dfreetype=enabled -Dglib=disabled)
(cd $out_dir/build \
&& meson install)
if [[ "$MB_ML_LIBC" == "manylinux" ]]; then
cp /usr/local/lib64/libharfbuzz* /usr/local/lib
fi
python3 -m pip install meson ninja

local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
(cd $out_dir \
&& meson setup build --buildtype=release -Dfreetype=enabled -Dglib=disabled)
(cd $out_dir/build \
&& meson install)
if [[ "$MB_ML_LIBC" == "manylinux" ]]; then
cp /usr/local/lib64/libharfbuzz* /usr/local/lib
fi
}

Expand Down Expand Up @@ -155,13 +145,7 @@ if [[ -n "$IS_MACOS" ]]; then
brew remove --ignore-dependencies webp
fi

brew install meson pkg-config
elif [[ "$MB_ML_LIBC" == "manylinux" ]]; then
if [[ "$HARFBUZZ_VERSION" != 8.5.0 ]]; then
yum install -y meson
fi
else
apk add meson
brew install pkg-config
fi

wrap_wheel_builder build
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ env:

jobs:
build-1-QEMU-emulated-wheels:
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
if: github.event_name != 'schedule'
name: aarch64 ${{ matrix.python-version }} ${{ matrix.spec }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
path: dist
merge-multiple: true
- name: Upload wheels to scientific-python-nightly-wheels
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
Expand All @@ -301,3 +301,5 @@ jobs:
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.6.9
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand All @@ -11,7 +11,7 @@ repos:
- id: black

- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
rev: 1.7.10
hooks:
- id: bandit
args: [--severity-level=high]
Expand All @@ -24,7 +24,7 @@ repos:
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.1
hooks:
- id: clang-format
types: [c]
Expand All @@ -36,7 +36,7 @@ repos:
- id: rst-backticks

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
Expand All @@ -50,29 +50,29 @@ repos:
exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
rev: 0.29.3
hooks:
- id: check-github-workflows
- id: check-readthedocs
- id: check-renovate

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
rev: v1.0.0
hooks:
- id: sphinx-lint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.1
rev: 2.2.4
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.19
rev: v0.20.2
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
rev: 1.4.1
hooks:
- id: tox-ini-fmt

Expand Down
34 changes: 32 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,42 @@ Changelog (Pillow)
11.0.0 (unreleased)
-------------------

- Fixed writing multiple StripOffsets to TIFF #8317
- Do not close provided file handles with libtiff when saving #8458
[radarhere]

- Support ImageFilter.BuiltinFilter for I;16* images #8438
[radarhere]

- Use ImagingCore.ptr instead of ImagingCore.id #8341
[homm, radarhere, hugovk]

- Updated EPS mode when opening images without transparency #8281
[Yay295, radarhere]

- Shared imagequant libraries may be located within usr/lib64 #8407
- Use transparency when combining P frames from APNGs #8443
[radarhere]

- Support all resampling filters when resizing I;16* images #8422
[radarhere]

- Free memory on early return #8413
[radarhere]

- Cast int before potentially exceeding INT_MAX #8402
[radarhere]

- Check image value before use #8400
[radarhere]

- Improved copying imagequant libraries #8420
[radarhere]

- Use Capsule for WebP saving #8386
[homm, radarhere]

- Fixed writing multiple StripOffsets to TIFF #8317
[Yay295, radarhere]

- Fix dereference before checking for NULL in ImagingTransformAffine #8398
[PavlNekrasov]

Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ coverage:
.PHONY: doc
.PHONY: html
doc html:
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
$(MAKE) -C docs html

.PHONY: htmlview
htmlview:
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
$(MAKE) -C docs htmlview

.PHONY: doccheck
Expand Down Expand Up @@ -117,7 +115,7 @@ lint-fix:
python3 -c "import black" > /dev/null 2>&1 || python3 -m pip install black
python3 -m black .
python3 -c "import ruff" > /dev/null 2>&1 || python3 -m pip install ruff
python3 -m ruff --fix .
python3 -m ruff check --fix .

.PHONY: mypy
mypy:
Expand Down
Binary file added Tests/images/eps/1.bmp
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file added Tests/images/eps/1_second_imagedata.eps
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
6 changes: 3 additions & 3 deletions Tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ def test(name: str, function: Callable[[str], str | None]) -> None:

def test_webp_transparency() -> None:
with pytest.warns(DeprecationWarning):
assert features.check("transp_webp") == features.check_module("webp")
assert (features.check("transp_webp") or False) == features.check_module("webp")


def test_webp_mux() -> None:
with pytest.warns(DeprecationWarning):
assert features.check("webp_mux") == features.check_module("webp")
assert (features.check("webp_mux") or False) == features.check_module("webp")


def test_webp_anim() -> None:
with pytest.warns(DeprecationWarning):
assert features.check("webp_anim") == features.check_module("webp")
assert (features.check("webp_anim") or False) == features.check_module("webp")


@skip_unless_feature("libjpeg_turbo")
Expand Down
4 changes: 2 additions & 2 deletions Tests/test_file_apng.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def test_apng_mode() -> None:
assert im.mode == "P"
im.seek(im.n_frames - 1)
im = im.convert("RGBA")
assert im.getpixel((0, 0)) == (255, 0, 0, 0)
assert im.getpixel((64, 32)) == (255, 0, 0, 0)
assert im.getpixel((0, 0)) == (0, 255, 0, 255)
assert im.getpixel((64, 32)) == (0, 255, 0, 255)

with Image.open("Tests/images/apng/mode_palette_1bit_alpha.png") as im:
assert im.mode == "P"
Expand Down
Loading

0 comments on commit fc5c096

Please sign in to comment.