From 50cc76b34f04632166fd249fe338f51a8de68833 Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 16:39:47 +0200 Subject: [PATCH 1/7] Update tox.ini remove python 3.6 from tox.ini, it's not supported any more --- tox.ini | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 6708bab7..3d0318fc 100644 --- a/tox.ini +++ b/tox.ini @@ -5,15 +5,14 @@ [tox] envlist = - py{36,37,38,39}-django22 - py{36,37,38,39}-django30 - py{36,37,38,39}-django31 - py{36,37,38,39}-django32 + py{37,38,39}-django22 + py{37,38,39}-django30 + py{37,38,39}-django31 + py{37,38,39}-django32 py{38,39}-django40 [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 From 2f2235036bff8eee9866afba10e09842d26f2c7b Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 16:43:00 +0200 Subject: [PATCH 2/7] Update test_and_coverage.yml remove python 3.6 from github workflows --- .github/workflows/test_and_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 9a477727..72610e85 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -11,7 +11,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From ed1ff46032f64155be337916a86d44d75db9145f Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 15:14:13 +0000 Subject: [PATCH 3/7] update easy_thumbnails in example project, add tests for Python 3.10 --- .github/workflows/test_and_coverage.yml | 2 +- example/requirements.txt | 2 +- tox.ini | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 72610e85..7c2b6946 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -11,7 +11,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v2 diff --git a/example/requirements.txt b/example/requirements.txt index b91ae317..2323351f 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,5 +1,5 @@ -e . -easy_thumbnails==2.8.1 +easy_thumbnails==2.9 WebTest==3.0.0 django-webtest==1.9.9 coverage==5.5 diff --git a/tox.ini b/tox.ini index 3d0318fc..6220f325 100644 --- a/tox.ini +++ b/tox.ini @@ -8,14 +8,15 @@ envlist = py{37,38,39}-django22 py{37,38,39}-django30 py{37,38,39}-django31 - py{37,38,39}-django32 - py{38,39}-django40 + py{37,38,39,310}-django32 + py{38,39,310}-django40 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [testenv] commands = From bddd5b2b64171f1f0cf07965959c8214be4be1b3 Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 15:30:59 +0000 Subject: [PATCH 4/7] 3.10 must be quoted --- .github/workflows/test_and_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 7c2b6946..f8c6378d 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -11,7 +11,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 From 36089250a1ecccc941813971a8624ba50df8fa77 Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 15:35:14 +0000 Subject: [PATCH 5/7] easy_thumbnails 2.9 does not support Django 3.2 --- example/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/requirements.txt b/example/requirements.txt index 2323351f..86c4f949 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,5 +1,5 @@ -e . -easy_thumbnails==2.9 +easy_thumbnails==2.8.5 WebTest==3.0.0 django-webtest==1.9.9 coverage==5.5 From f721f9beb8bf96f1dfb0e16c65d9823ccefb402e Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 15:42:26 +0000 Subject: [PATCH 6/7] don't run coverall in forks --- .github/workflows/test_and_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index f8c6378d..43ff36fa 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -32,7 +32,7 @@ jobs: isort . black . - name: Report to coverall # by the package as the action is broken, but won't work on external forks! - if: matrix.python-version == 3.7 + if: matrix.python-version == 3.7 && github.repository == 'jonasundderwolf/django-image-cropping' env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | From 53efeccc10fea5810b2ffe5d12ca3078aad62032 Mon Sep 17 00:00:00 2001 From: Chris Vigelius Date: Wed, 9 Oct 2024 21:08:01 +0200 Subject: [PATCH 7/7] handle BaseException instead of AttributeError, and log the result --- image_cropping/widgets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/image_cropping/widgets.py b/image_cropping/widgets.py index cce88f05..98f5b9e5 100644 --- a/image_cropping/widgets.py +++ b/image_cropping/widgets.py @@ -38,8 +38,9 @@ def get_attrs(image, name): try: # open image and rotate according to its exif.orientation width, height = get_backend().get_size(image) - except AttributeError: - # invalid image -> AttributeError + except BaseException: + # invalid image -> AttributeError or DecompressionBombError + logger.warning("Error while getting image size", exc_info=True) width = image.width height = image.height return {