From 561b5d7ab7e341d16396546499e956d8528def5a Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Sun, 10 May 2015 23:59:26 +0100 Subject: [PATCH 1/6] Fixes imports in README example for ProcessedImageField --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 80e0e75..bb3bb00 100644 --- a/README.rst +++ b/README.rst @@ -88,6 +88,7 @@ class: from django.db import models from imagekit.models import ProcessedImageField + from imagekit.processors import ResizeToFill class Profile(models.Model): avatar_thumbnail = ProcessedImageField(upload_to='avatars', From e455768352bca8de64c2857d8bae1239946f750e Mon Sep 17 00:00:00 2001 From: Venelin Stoykov Date: Wed, 13 May 2015 01:13:37 +0300 Subject: [PATCH 2/6] Add test environments for Python3.4 and Django1.7 and Django1.8 --- setup.py | 9 ++++--- tests/test_fields.py | 1 + tox.ini | 64 +++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 8f60701..4406e49 100644 --- a/setup.py +++ b/setup.py @@ -44,9 +44,9 @@ setup( include_package_data=True, tests_require=[ 'beautifulsoup4==4.1.3', - 'nose==1.3.0', - 'nose-progressive==1.5', - 'django-nose==1.2', + 'nose>=1.3.6,<1.4', + 'nose-progressive==1.5.1', + 'django-nose>=1.2,<=1.4', 'Pillow<3.0', 'mock==1.0.1', ], @@ -67,10 +67,13 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', 'Topic :: Utilities' ], ) diff --git a/tests/test_fields.py b/tests/test_fields.py index df513ee..6afb6cf 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -26,6 +26,7 @@ def test_form_processedimagefield(): class Meta: model = ImageModel + fields = 'image', upload_file = get_image_file() file_dict = {'image': SimpleUploadedFile('abc.jpg', upload_file.read())} diff --git a/tox.ini b/tox.ini index 13cb6e4..1c60ca2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,43 @@ [tox] envlist = - py33-django16, py33-django15, - py32-django16, py32-django15, - py27-django16, py27-django15, py27-django14, py27-django13, py27-django12, + py34-django18, py34-django17, py34-django16, + py33-django18, py33-django17, py33-django16, py33-django15, + py32-django18, py32-django17, py32-django16, py32-django15, + py27-django18, py27-django17, py27-django16, py27-django15, py27-django14, py27-django13, py27-django12, py26-django15, py26-django14, py26-django13, py26-django12 [testenv] commands = python setup.py test +[testenv:py34-django18] +basepython = python3.4 +deps = + Django>=1.8,<1.9 + django-nose==1.4 + +[testenv:py34-django17] +basepython = python3.4 +deps = + Django>=1.7,<1.8 + django-nose==1.4 + +[testenv:py34-django16] +basepython = python3.4 +deps = + Django>=1.6,<1.7 + +[testenv:py33-django18] +basepython = python3.3 +deps = + Django>=1.8,<1.9 + django-nose==1.4 + +[testenv:py33-django17] +basepython = python3.3 +deps = + Django>=1.7,<1.8 + django-nose==1.4 + [testenv:py33-django16] basepython = python3.3 deps = @@ -18,6 +48,18 @@ basepython = python3.3 deps = Django>=1.5,<1.6 +[testenv:py32-django18] +basepython = python3.4 +deps = + Django>=1.8,<1.9 + django-nose==1.4 + +[testenv:py32-django17] +basepython = python3.4 +deps = + Django>=1.7,<1.8 + django-nose==1.4 + [testenv:py32-django16] basepython = python3.2 deps = @@ -28,6 +70,18 @@ basepython = python3.2 deps = Django>=1.5,<1.6 +[testenv:py27-django18] +basepython = python2.7 +deps = + Django>=1.8,<1.9 + django-nose==1.4 + +[testenv:py27-django17] +basepython = python2.7 +deps = + Django>=1.7,<1.8 + django-nose==1.4 + [testenv:py27-django16] basepython = python2.7 deps = @@ -47,11 +101,13 @@ deps = basepython = python2.7 deps = Django>=1.3,<1.4 + django-nose==1.2 [testenv:py27-django12] basepython = python2.7 deps = Django>=1.2,<1.3 + django-nose==1.2 [testenv:py26-django15] basepython = python2.6 @@ -67,8 +123,10 @@ deps = basepython = python2.6 deps = Django>=1.3,<1.4 + django-nose==1.2 [testenv:py26-django12] basepython = python2.6 deps = Django>=1.2,<1.3 + django-nose==1.2 From 458f80050c715103b78f3535f34a76bb44954c97 Mon Sep 17 00:00:00 2001 From: Venelin Stoykov Date: Fri, 5 Jun 2015 03:01:07 +0300 Subject: [PATCH 3/6] Do not use progressive when we are not running in terminal --- tests/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/settings.py b/tests/settings.py index 01b93a2..0c51989 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -34,7 +34,6 @@ INSTALLED_APPS = [ TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' NOSE_ARGS = [ '-s', - '--with-progressive', # When the tests are run --with-coverage, these args configure coverage # reporting (requires coverage to be installed). @@ -45,6 +44,9 @@ NOSE_ARGS = [ '--cover-html-dir=%s' % os.path.join(BASE_PATH, 'cover') ] +if os.getenv('TERM'): + NOSE_ARGS.append('--with-progressive') + DEBUG = True TEMPLATE_DEBUG = DEBUG CACHE_BACKEND = 'locmem://' From eb81b9c88c0c44593fbc6322c13daaa00be3c2af Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 2 Aug 2015 00:01:30 -0700 Subject: [PATCH 4/6] Fixes open source file never getting closed In a processes that generates many images, you could run into a cituation with too man files being open. This results in: IOError: [Errno 24] Too many open files --- imagekit/specs/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/imagekit/specs/__init__.py b/imagekit/specs/__init__.py index 054f3fd..829dce1 100644 --- a/imagekit/specs/__init__.py +++ b/imagekit/specs/__init__.py @@ -153,9 +153,11 @@ class ImageSpec(BaseImageSpec): self.source.open() img = open_image(self.source) - return process_image(img, processors=self.processors, - format=self.format, autoconvert=self.autoconvert, - options=self.options) + new_image = process_image(img, processors=self.processors, + format=self.format, autoconvert=self.autoconvert, + options=self.options) + self.source.close() + return new_image def create_spec_class(class_attrs): From 7cdda460708ad520d2a6565b6d8fd5afe46a87d0 Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 2 Aug 2015 00:05:43 -0700 Subject: [PATCH 5/6] Fixes open cache file never getting closed In a processes that generates many images, you could run into a cituation with too man files being open. This results in: IOError: [Errno 24] Too many open files --- imagekit/cachefiles/backends.py | 1 + 1 file changed, 1 insertion(+) diff --git a/imagekit/cachefiles/backends.py b/imagekit/cachefiles/backends.py index 8949856..5e7025a 100644 --- a/imagekit/cachefiles/backends.py +++ b/imagekit/cachefiles/backends.py @@ -96,6 +96,7 @@ class CachedFileBackend(object): self.set_state(file, CacheFileState.GENERATING) file._generate() self.set_state(file, CacheFileState.EXISTS) + file.close() class Simple(CachedFileBackend): From 75763b80f80af284d536bb5c8d820203f45931cc Mon Sep 17 00:00:00 2001 From: Bryan Veloso Date: Sun, 23 Aug 2015 17:58:46 -0700 Subject: [PATCH 6/6] Bump the version to 3.2.7. --- imagekit/pkgmeta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagekit/pkgmeta.py b/imagekit/pkgmeta.py index a702f9c..a7e84c8 100644 --- a/imagekit/pkgmeta.py +++ b/imagekit/pkgmeta.py @@ -1,5 +1,5 @@ __title__ = 'django-imagekit' __author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll' -__version__ = '3.2.6' +__version__ = '3.2.7' __license__ = 'BSD' __all__ = ['__title__', '__author__', '__version__', '__license__']