diff --git a/.ci/install.sh b/.ci/install.sh index d21cae74e..622a36dab 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -37,7 +37,7 @@ python3 -m pip install -U pytest-cov python3 -m pip install -U pytest-timeout python3 -m pip install pyroma # optional test dependency, only install if there's a binary package. -# fails on beta 3.14 and pypy3.10 +# fails on beta 3.14 and PyPy python3 -m pip install --only-binary=:all: pyarrow || true if [[ $(uname) != CYGWIN* ]]; then diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index 1f90eb5de..5ba2aaba3 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -27,7 +27,7 @@ python3 -m pip install -U pytest-timeout python3 -m pip install pyroma python3 -m pip install numpy # optional test dependency, only install if there's a binary package. -# fails on beta 3.14 and pypy3.10 +# fails on beta 3.14 and PyPy python3 -m pip install --only-binary=:all: pyarrow || true # extra test images diff --git a/Tests/test_arrow.py b/Tests/test_arrow.py index a86757216..b86c77b9a 100644 --- a/Tests/test_arrow.py +++ b/Tests/test_arrow.py @@ -11,7 +11,7 @@ from .helper import hopper "mode, dest_modes", ( ("L", ["I", "F", "LA", "RGB", "RGBA", "RGBX", "CMYK", "YCbCr", "HSV"]), - ("I", ["L", "F"]), # Technically I32 can work for any 4x8bit storage. + ("I", ["L", "F"]), # Technically I;32 can work for any 4x8bit storage. ("F", ["I", "L", "LA", "RGB", "RGBA", "RGBX", "CMYK", "YCbCr", "HSV"]), ("LA", ["L", "F"]), ("RGB", ["L", "F"]), @@ -29,7 +29,7 @@ def test_invalid_array_type(mode: str, dest_modes: list[str]) -> None: Image.fromarrow(img, dest_mode, img.size) -def test_invalid_array_size(): +def test_invalid_array_size() -> None: img = hopper("RGB") assert img.size != (10, 10) @@ -37,14 +37,14 @@ def test_invalid_array_size(): Image.fromarrow(img, "RGB", (10, 10)) -def test_release_schema(): +def test_release_schema() -> None: # these should not error out, valgrind should be clean img = hopper("L") schema = img.__arrow_c_schema__() del schema -def test_release_array(): +def test_release_array() -> None: # these should not error out, valgrind should be clean img = hopper("L") array, schema = img.__arrow_c_array__() @@ -52,7 +52,7 @@ def test_release_array(): del schema -def test_readonly(): +def test_readonly() -> None: img = hopper("L") reloaded = Image.fromarrow(img, img.mode, img.size) assert reloaded.readonly == 1 @@ -60,7 +60,7 @@ def test_readonly(): assert reloaded.readonly == 1 -def test_multiblock_l_image(): +def test_multiblock_l_image() -> None: block_size = Image.core.get_block_size() # check a 2 block image in single channel mode @@ -71,7 +71,7 @@ def test_multiblock_l_image(): (schema, arr) = img.__arrow_c_array__() -def test_multiblock_rgba_image(): +def test_multiblock_rgba_image() -> None: block_size = Image.core.get_block_size() # check a 2 block image in 4 channel mode @@ -82,7 +82,7 @@ def test_multiblock_rgba_image(): (schema, arr) = img.__arrow_c_array__() -def test_multiblock_l_schema(): +def test_multiblock_l_schema() -> None: block_size = Image.core.get_block_size() # check a 2 block image in single channel mode @@ -93,7 +93,7 @@ def test_multiblock_l_schema(): img.__arrow_c_schema__() -def test_multiblock_rgba_schema(): +def test_multiblock_rgba_schema() -> None: block_size = Image.core.get_block_size() # check a 2 block image in 4 channel mode @@ -104,7 +104,7 @@ def test_multiblock_rgba_schema(): img.__arrow_c_schema__() -def test_singleblock_l_image(): +def test_singleblock_l_image() -> None: Image.core.set_use_block_allocator(1) block_size = Image.core.get_block_size() @@ -121,7 +121,7 @@ def test_singleblock_l_image(): Image.core.set_use_block_allocator(0) -def test_singleblock_rgba_image(): +def test_singleblock_rgba_image() -> None: Image.core.set_use_block_allocator(1) block_size = Image.core.get_block_size() @@ -136,7 +136,7 @@ def test_singleblock_rgba_image(): Image.core.set_use_block_allocator(0) -def test_singleblock_l_schema(): +def test_singleblock_l_schema() -> None: Image.core.set_use_block_allocator(1) block_size = Image.core.get_block_size() @@ -150,7 +150,7 @@ def test_singleblock_l_schema(): Image.core.set_use_block_allocator(0) -def test_singleblock_rgba_schema(): +def test_singleblock_rgba_schema() -> None: Image.core.set_use_block_allocator(1) block_size = Image.core.get_block_size() diff --git a/Tests/test_pyarrow.py b/Tests/test_pyarrow.py index 72c546c0d..1f0bdf6b5 100644 --- a/Tests/test_pyarrow.py +++ b/Tests/test_pyarrow.py @@ -71,7 +71,7 @@ def test_to_array(mode: str, dtype: Any, mask: Any) -> None: assert_image_equal(img, reloaded) -def test_lifetime(): +def test_lifetime() -> None: # valgrind shouldn't error out here. # arrays should be accessible after the image is deleted. @@ -89,7 +89,7 @@ def test_lifetime(): del arr_2 -def test_lifetime2(): +def test_lifetime2() -> None: # valgrind shouldn't error out here. # img should remain after the arrays are collected. diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 0dbb24d91..04a80fb9a 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -3325,7 +3325,7 @@ def fromarrow(obj: SupportsArrowArrayInterface, mode, size) -> Image: As with array support, when converting Pillow images to arrays, only pixel values are transferred. This means that P and PA mode - image will lose their palette. + images will lose their palette. :param obj: Object with an arrow_c_array interface :param mode: Image mode. diff --git a/src/_imaging.c b/src/_imaging.c index 9eee3c82c..e4a985a82 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -291,7 +291,6 @@ ExportArrowArrayPyCapsule(ImagingObject *self) { return PyCapsule_New(array, "arrow_array", ReleaseArrowArrayPyCapsule); } free(array); - // raise error here return ArrowError(err); } diff --git a/src/libImaging/Storage.c b/src/libImaging/Storage.c index 4ee1af436..fb2960231 100644 --- a/src/libImaging/Storage.c +++ b/src/libImaging/Storage.c @@ -572,7 +572,7 @@ ImagingAllocateBlock(Imaging im) { static void ImagingDestroyArrow(Imaging im) { - // Rely on the internal python destructor for the array capsule. + // Rely on the internal Python destructor for the array capsule. if (im->arrow_array_capsule) { Py_DECREF(im->arrow_array_capsule); im->arrow_array_capsule = NULL;