From ddd363f7df8374a06c00ebb44bcda746d2121264 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 2 Nov 2020 23:02:24 +0200 Subject: [PATCH 1/5] Remove excess Travis CI jobs --- .travis.yml | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2966cdf19fc..e239ed496e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,13 @@ dist: xenial language: python -cache: - pip: true - directories: - - $HOME/.cache/pre-commit +cache: pip notifications: irc: "chat.freenode.net#pil" -# Run fast lint first to get fast feedback. -# Run slower CPUs next, to give them a headstart and reduce waiting time. -# Then run the remainder. - matrix: fast_finish: true include: - - python: "3.6" - name: "Lint" - env: LINT="true" - - python: "3.6" arch: arm64 - python: "3.7" @@ -26,42 +15,15 @@ matrix: - python: "3.8" arch: s390x - - python: "pypy3.6-7.3.1" - name: "PyPy3 Xenial" - - python: "3.9" - name: "3.9 Xenial" - services: xvfb - - python: "3.8" - name: "3.8 Xenial" - services: xvfb - - python: '3.7' - name: "3.7 Xenial PYTHONOPTIMIZE=2" - env: PYTHONOPTIMIZE=2 - services: xvfb - - python: '3.6' - name: "3.6 Xenial PYTHONOPTIMIZE=1" - env: PYTHONOPTIMIZE=1 - services: xvfb - install: - | - if [ "$LINT" == "true" ]; then - python3 -m pip install tox - else - .ci/install.sh; - fi + .ci/install.sh; script: -- | - if [ "$LINT" == "true" ]; then - tox -e lint - else + - | .ci/build.sh .ci/test.sh - fi after_success: -- | - if [ "$LINT" == "" ]; then + - | .ci/after_success.sh - fi From b01567fb0b7ce9c5ffa6e2a50bbe993bac11109b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 3 Nov 2020 17:31:59 +0200 Subject: [PATCH 2/5] Fix setting PYTHONOPTIMIZE env var --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3da945f3988..8403e2ee52c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,9 +22,9 @@ jobs: ] include: - python-version: "3.6" - env: PYTHONOPTIMIZE=1 + PYTHONOPTIMIZE: 1 - python-version: "3.7" - env: PYTHONOPTIMIZE=2 + PYTHONOPTIMIZE: 2 # Include new variables for Codecov - os: ubuntu-latest codecov-flag: GHA_Ubuntu @@ -80,6 +80,8 @@ jobs: - name: Test run: | .ci/test.sh + env: + PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }} - name: Prepare to upload errors if: failure() From 8ec8d23af47e4f718d1b3a0c1f3cbf645c1be649 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 3 Nov 2020 18:49:16 +0200 Subject: [PATCH 3/5] Install Qt on GHA --- .ci/install.sh | 6 +++--- .github/workflows/test.yml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index 77dccaa4ab3..db259bdca12 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -39,13 +39,13 @@ if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptool if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi if [ "$TRAVIS_PYTHON_VERSION" == "pypy3.6-7.3.1" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi -if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then +# PyQt5 doesn't support PyPy3 +# Wheel doesn't yet support 3.10 +if [[ $GHA_PYTHON_VERSION == 3.* && $GHA_PYTHON_VERSION != "3.10-dev" ]]; then # arm64, ppc64le, s390x CPUs: # "ERROR: Could not find a version that satisfies the requirement pyqt5" - if [[ $TRAVIS_CPU_ARCH == "amd64" ]]; then sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools python3 -m pip install pyqt5 - fi fi # docs only on Python 3.9 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8403e2ee52c..b33b2195a48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,8 +78,9 @@ jobs: .ci/build.sh - name: Test - run: | - .ci/test.sh + uses: GabrielBB/xvfb-action@v1 + with: + run: .ci/test.sh env: PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }} From 85e991e5b6f99b97df612a1914ec5c42f6d16f5b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 4 Nov 2020 15:36:02 +0200 Subject: [PATCH 4/5] Don't include test-skipping 'except' in coverage --- Tests/test_image_quantize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/test_image_quantize.py b/Tests/test_image_quantize.py index 192617a5263..921c39e3f06 100644 --- a/Tests/test_image_quantize.py +++ b/Tests/test_image_quantize.py @@ -21,7 +21,7 @@ def test_libimagequant_quantize(): image = hopper() try: converted = image.quantize(100, Image.LIBIMAGEQUANT) - except ValueError as ex: + except ValueError as ex: # pragma: no cover if "dependency" in str(ex).lower(): pytest.skip("libimagequant support not available") else: From d8d8a2c74d6f9611d2b92313db01e711e51b8319 Mon Sep 17 00:00:00 2001 From: nulano Date: Wed, 4 Nov 2020 13:58:33 +0000 Subject: [PATCH 5/5] set xvfb bit depth --- .github/workflows/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b33b2195a48..51ce9d085c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,9 +78,12 @@ jobs: .ci/build.sh - name: Test - uses: GabrielBB/xvfb-action@v1 - with: - run: .ci/test.sh + run: | + if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then + xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh + else + .ci/test.sh + fi env: PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}