Skip to content

Commit 96f0b5d

Browse files
committed
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
2 parents b398c2c + 75763b8 commit 96f0b5d

File tree

8 files changed

+79
-11
lines changed

8 files changed

+79
-11
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class:
8888
8989
from django.db import models
9090
from imagekit.models import ProcessedImageField
91+
from imagekit.processors import ResizeToFill
9192
9293
class Profile(models.Model):
9394
avatar_thumbnail = ProcessedImageField(upload_to='avatars',

imagekit/cachefiles/backends.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def generate_now(self, file, force=False):
9696
self.set_state(file, CacheFileState.GENERATING)
9797
file._generate()
9898
self.set_state(file, CacheFileState.EXISTS)
99+
file.close()
99100

100101

101102
class Simple(CachedFileBackend):

imagekit/pkgmeta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'django-imagekit'
22
__author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll'
3-
__version__ = '3.2.6'
3+
__version__ = '3.2.7'
44
__license__ = 'BSD'
55
__all__ = ['__title__', '__author__', '__version__', '__license__']

imagekit/specs/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ def generate(self):
153153
self.source.open()
154154
img = open_image(self.source)
155155

156-
return process_image(img, processors=self.processors,
157-
format=self.format, autoconvert=self.autoconvert,
158-
options=self.options)
156+
new_image = process_image(img, processors=self.processors,
157+
format=self.format, autoconvert=self.autoconvert,
158+
options=self.options)
159+
self.source.close()
160+
return new_image
159161

160162

161163
def create_spec_class(class_attrs):

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def exec_file(filepath, globalz=None, localz=None):
4444
include_package_data=True,
4545
tests_require=[
4646
'beautifulsoup4==4.1.3',
47-
'nose==1.3.0',
48-
'nose-progressive==1.5',
49-
'django-nose==1.2',
47+
'nose>=1.3.6,<1.4',
48+
'nose-progressive==1.5.1',
49+
'django-nose>=1.2,<=1.4',
5050
'Pillow<3.0',
5151
'mock==1.0.1',
5252
],
@@ -67,10 +67,13 @@ def exec_file(filepath, globalz=None, localz=None):
6767
'Intended Audience :: Developers',
6868
'License :: OSI Approved :: BSD License',
6969
'Operating System :: OS Independent',
70+
'Programming Language :: Python :: 2',
7071
'Programming Language :: Python :: 2.6',
7172
'Programming Language :: Python :: 2.7',
73+
'Programming Language :: Python :: 3',
7274
'Programming Language :: Python :: 3.2',
7375
'Programming Language :: Python :: 3.3',
76+
'Programming Language :: Python :: 3.4',
7477
'Topic :: Utilities'
7578
],
7679
)

tests/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
3535
NOSE_ARGS = [
3636
'-s',
37-
'--with-progressive',
3837

3938
# When the tests are run --with-coverage, these args configure coverage
4039
# reporting (requires coverage to be installed).
@@ -45,6 +44,9 @@
4544
'--cover-html-dir=%s' % os.path.join(BASE_PATH, 'cover')
4645
]
4746

47+
if os.getenv('TERM'):
48+
NOSE_ARGS.append('--with-progressive')
49+
4850
DEBUG = True
4951
TEMPLATE_DEBUG = DEBUG
5052
CACHE_BACKEND = 'locmem://'

tests/test_fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TestForm(forms.ModelForm):
2626

2727
class Meta:
2828
model = ImageModel
29+
fields = 'image',
2930

3031
upload_file = get_image_file()
3132
file_dict = {'image': SimpleUploadedFile('abc.jpg', upload_file.read())}

tox.ini

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
[tox]
22
envlist =
3-
py33-django16, py33-django15,
4-
py32-django16, py32-django15,
5-
py27-django16, py27-django15, py27-django14, py27-django13, py27-django12,
3+
py34-django18, py34-django17, py34-django16,
4+
py33-django18, py33-django17, py33-django16, py33-django15,
5+
py32-django18, py32-django17, py32-django16, py32-django15,
6+
py27-django18, py27-django17, py27-django16, py27-django15, py27-django14, py27-django13, py27-django12,
67
py26-django15, py26-django14, py26-django13, py26-django12
78

89
[testenv]
910
commands = python setup.py test
1011

12+
[testenv:py34-django18]
13+
basepython = python3.4
14+
deps =
15+
Django>=1.8,<1.9
16+
django-nose==1.4
17+
18+
[testenv:py34-django17]
19+
basepython = python3.4
20+
deps =
21+
Django>=1.7,<1.8
22+
django-nose==1.4
23+
24+
[testenv:py34-django16]
25+
basepython = python3.4
26+
deps =
27+
Django>=1.6,<1.7
28+
29+
[testenv:py33-django18]
30+
basepython = python3.3
31+
deps =
32+
Django>=1.8,<1.9
33+
django-nose==1.4
34+
35+
[testenv:py33-django17]
36+
basepython = python3.3
37+
deps =
38+
Django>=1.7,<1.8
39+
django-nose==1.4
40+
1141
[testenv:py33-django16]
1242
basepython = python3.3
1343
deps =
@@ -18,6 +48,18 @@ basepython = python3.3
1848
deps =
1949
Django>=1.5,<1.6
2050

51+
[testenv:py32-django18]
52+
basepython = python3.4
53+
deps =
54+
Django>=1.8,<1.9
55+
django-nose==1.4
56+
57+
[testenv:py32-django17]
58+
basepython = python3.4
59+
deps =
60+
Django>=1.7,<1.8
61+
django-nose==1.4
62+
2163
[testenv:py32-django16]
2264
basepython = python3.2
2365
deps =
@@ -28,6 +70,18 @@ basepython = python3.2
2870
deps =
2971
Django>=1.5,<1.6
3072

73+
[testenv:py27-django18]
74+
basepython = python2.7
75+
deps =
76+
Django>=1.8,<1.9
77+
django-nose==1.4
78+
79+
[testenv:py27-django17]
80+
basepython = python2.7
81+
deps =
82+
Django>=1.7,<1.8
83+
django-nose==1.4
84+
3185
[testenv:py27-django16]
3286
basepython = python2.7
3387
deps =
@@ -47,11 +101,13 @@ deps =
47101
basepython = python2.7
48102
deps =
49103
Django>=1.3,<1.4
104+
django-nose==1.2
50105

51106
[testenv:py27-django12]
52107
basepython = python2.7
53108
deps =
54109
Django>=1.2,<1.3
110+
django-nose==1.2
55111

56112
[testenv:py26-django15]
57113
basepython = python2.6
@@ -67,8 +123,10 @@ deps =
67123
basepython = python2.6
68124
deps =
69125
Django>=1.3,<1.4
126+
django-nose==1.2
70127

71128
[testenv:py26-django12]
72129
basepython = python2.6
73130
deps =
74131
Django>=1.2,<1.3
132+
django-nose==1.2

0 commit comments

Comments
 (0)