From 50f29644b84849ebfd74855fa85a2f8167fe829b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 1 Jan 2022 23:03:49 +1100 Subject: [PATCH] Test test_save_p_transparent_black on big endian with Pillow 5.1.0 --- .github/workflows/build.yml | 21 --------------------- Makefile.sub | 1 + ubuntu-20.04-focal-s390x/script.py | 11 +++++++++++ ubuntu-20.04-focal-s390x/test.sh | 7 +++---- 4 files changed, 15 insertions(+), 25 deletions(-) create mode 100755 ubuntu-20.04-focal-s390x/script.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1072b6f5..8af3b0bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,29 +13,8 @@ jobs: target: - "latest" image: - # Run slower jobs first to give them a headstart and reduce waiting time - - "ubuntu-20.04-focal-arm64v8" - - "ubuntu-20.04-focal-ppc64le" - "ubuntu-20.04-focal-s390x" - # Then run the remainder - - "alpine" - - "amazon-2-amd64" - - "arch" - - "centos-7-amd64" - - "centos-8-amd64" - - "centos-stream-8-amd64" - - "debian-10-buster-x86" - - "fedora-34-amd64" - - "fedora-35-amd64" - - "manylinux2014-wheel-build" - - "ubuntu-18.04-bionic-amd64" - - "ubuntu-20.04-focal-amd64" - - "ubuntu-20.04-focal-amd64-valgrind" include: - - image: "ubuntu-20.04-focal-arm64v8" - qemu-arch: "aarch64" - - image: "ubuntu-20.04-focal-ppc64le" - qemu-arch: "ppc64le" - image: "ubuntu-20.04-focal-s390x" qemu-arch: "s390x" diff --git a/Makefile.sub b/Makefile.sub index e0d362dd..33325381 100644 --- a/Makefile.sub +++ b/Makefile.sub @@ -9,6 +9,7 @@ BRANCH := $(shell git rev-parse --abbrev-ref HEAD) build: cp -r ../Pillow/depends . cp test.sh depends + cp script.py depends docker build -t $(IMAGENAME):$(BRANCH) . .PHONY: update diff --git a/ubuntu-20.04-focal-s390x/script.py b/ubuntu-20.04-focal-s390x/script.py new file mode 100755 index 00000000..68ba1092 --- /dev/null +++ b/ubuntu-20.04-focal-s390x/script.py @@ -0,0 +1,11 @@ +from PIL import Image +im = Image.new("RGBA", (10, 10), (0, 0, 0, 0)) +assert im.getcolors() == [(100, (0, 0, 0, 0))] + +im = im.convert("P") +test_file = "/tmp/temp.png" +im.save(test_file) + +# check if saved image contains same transparency +with Image.open(test_file) as im: + assert len(im.info["transparency"]) == 256 diff --git a/ubuntu-20.04-focal-s390x/test.sh b/ubuntu-20.04-focal-s390x/test.sh index 815f05fe..5c9f2875 100755 --- a/ubuntu-20.04-focal-s390x/test.sh +++ b/ubuntu-20.04-focal-s390x/test.sh @@ -1,6 +1,5 @@ #!/bin/bash source /vpy3/bin/activate -cd /Pillow -make clean -make install-coverage -/usr/bin/xvfb-run -a pytest -vx --cov PIL --cov-report term Tests +python3 -m pip install Pillow==5.1.0 +python3 -m pip show Pillow +python3 depends/script.py