From ecdc3e918208245e4c3599a33eea357c87ee9d24 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Sun, 15 Oct 2023 09:05:48 +0200 Subject: [PATCH] Require Pillow >= 9.1.0 --- flask_admin/form/upload.py | 14 -------------- setup.py | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/flask_admin/form/upload.py b/flask_admin/form/upload.py index deb0e06ed..b900027a6 100644 --- a/flask_admin/form/upload.py +++ b/flask_admin/form/upload.py @@ -21,20 +21,6 @@ try: from PIL import Image, ImageOps - - # to support pillow < 9.1.0 - if not hasattr(Image, 'Resampling'): - from enum import IntEnum - - class Resampling(IntEnum): - NEAREST = 0 - BOX = 4 - BILINEAR = 2 - HAMMING = 5 - BICUBIC = 3 - LANCZOS = 1 - - Image.Resampling = Resampling except ImportError: Image = None ImageOps = None diff --git a/setup.py b/setup.py index a54df28cc..88a07eafe 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ # Fix for older setuptools import re import os -import sys from setuptools import setup, find_packages @@ -21,6 +20,7 @@ def desc(): except IOError: return info + # grep flask_admin/__init__.py since python 3.x cannot import it before using 2to3 file_text = read(fpath('flask_admin/__init__.py')) @@ -61,7 +61,7 @@ def grep(attrname): install_requires=install_requires, tests_require=[ 'pytest', - 'pillow>=3.3.2', + 'pillow>=9.1.0', 'mongoengine', 'pymongo', 'wtf-peewee',