From 42288c4f43a7201800d6ec593b7d1cd6c3b24529 Mon Sep 17 00:00:00 2001 From: Isotr0py <2037008807@qq.com> Date: Sun, 12 Jan 2025 00:52:33 +0800 Subject: [PATCH] fix debug mode Signed-off-by: Isotr0py <2037008807@qq.com> --- .github/workflows/test.yml | 2 +- Cargo.toml | 2 +- test/test_plugin.py | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6452766..abf2458 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: matrix: # we only use macos for fast testing os: [macos-latest] - python-version: ['3.10', '3.11'] + python-version: ['3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index d58df3d..27ab796 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ name = "pillow_jxl" crate-type = ["cdylib"] [dependencies] -pyo3 = { version="0.23.1", features = ["extension-module"] } +pyo3 = { version="0.23.3", features = ["extension-module"] } jpegxl-rs = { version="0.11.0", default-features = false } [features] diff --git a/test/test_plugin.py b/test/test_plugin.py index 9ddba57..601b186 100644 --- a/test/test_plugin.py +++ b/test/test_plugin.py @@ -1,3 +1,4 @@ +import os import tempfile import pyexiv2 @@ -8,6 +9,11 @@ import pillow_jxl +def test_debug_mode(): + exit_code = os.system('python -Xdev -c "from pillow_jxl import JpegXLImagePlugin"') + assert exit_code == 0 + + def test_decode(): img_jxl = Image.open("test/images/sample.jxl") img_png = Image.open("test/images/sample.png") @@ -122,5 +128,5 @@ def test_metadata_encode_from_pil_exif(): jxl_exif = pyexiv2.Image(temp).read_exif() for key in ref_exif: # Skip UserComment and GPSAltitude as they are broken - if key not in ("Exif.Photo.UserComment", 'Exif.GPSInfo.GPSAltitude'): + if key not in ("Exif.Photo.UserComment", "Exif.GPSInfo.GPSAltitude"): assert ref_exif[key] == jxl_exif[key]