Merge branch 'release/3.2.7'

* release/3.2.7:
  Bump the version to 3.2.7.
  Fixes open cache file never getting closed
  Fixes open source file never getting closed
  Do not use progressive when we are not running in terminal
  Add test environments for Python3.4 and Django1.7 and Django1.8
  Fixes imports in README example for ProcessedImageField
This commit is contained in:
Bryan Veloso 2015-08-23 18:02:32 -07:00
commit 96f0b5da4d
8 changed files with 79 additions and 11 deletions

View file

@ -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',

View file

@ -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):

View file

@ -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__']

View file

@ -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):

View file

@ -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'
],
)

View file

@ -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://'

View file

@ -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())}

64
tox.ini
View file

@ -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