File tree Expand file tree Collapse file tree 7 files changed +33
-10
lines changed Expand file tree Collapse file tree 7 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ matrix:
19
19
python : ' 3.7'
20
20
- env : TOXENV=py38-django30
21
21
python : ' 3.8'
22
+ - env : TOXENV=pypy3-django31
23
+ python : pypy3
24
+ - env : TOXENV=py36-django31
25
+ python : ' 3.6'
26
+ - env : TOXENV=py37-django31
27
+ python : ' 3.7'
28
+ - env : TOXENV=py38-django31
29
+ python : ' 3.8'
22
30
- env : TOXENV=py36-django-master
23
31
python : ' 3.6'
24
32
- env : TOXENV=py37-django-master
Original file line number Diff line number Diff line change 3
3
History
4
4
=======
5
5
6
+ 2.0.5
7
+ ======
8
+
9
+ * Adding **Django 3.1 ** compatibility.
10
+ * CachedStaticFilesStorage is removed from Django. Add a check
11
+ of the current version to prevent error while importing. Thank to @vmsp
12
+ * Context in django.template.base is removed from Django and
13
+ not used anymore in django-pipeline.
14
+ * Fixing widgets tests of django-pipeline due to Media.render_js change in
15
+ Django. More information in Django ticket #31892
16
+
6
17
2.0.4
7
18
======
8
19
Original file line number Diff line number Diff line change 2
2
3
3
from io import BytesIO
4
4
5
- import django
5
+ from django import get_version as django_version
6
6
7
- _CACHED_STATIC_FILES_STORAGE_AVAILABLE = django . VERSION [ 0 ] <= 3 and django . VERSION [ 1 ] < 1
7
+ _CACHED_STATIC_FILES_STORAGE_AVAILABLE = django_version () < '3.1'
8
8
9
9
if _CACHED_STATIC_FILES_STORAGE_AVAILABLE :
10
10
from django .contrib .staticfiles .storage import CachedStaticFilesStorage
Original file line number Diff line number Diff line change 4
4
from django .contrib .staticfiles .storage import staticfiles_storage
5
5
6
6
from django import template
7
- from django .template .context import Context
8
7
from django .template .base import VariableDoesNotExist
9
8
from django .template .loader import render_to_string
10
9
from django .utils .safestring import mark_safe
Original file line number Diff line number Diff line change 6
6
7
7
setup (
8
8
name = 'django-pipeline' ,
9
- version = '2.0.4 ' ,
9
+ version = '2.0.5 ' ,
10
10
description = 'Pipeline is an asset packaging library for Django.' ,
11
11
long_description = io .open ('README.rst' , encoding = 'utf-8' ).read () + '\n \n ' +
12
12
io .open ('HISTORY.rst' , encoding = 'utf-8' ).read (),
25
25
'Framework :: Django' ,
26
26
'Framework :: Django :: 2.2' ,
27
27
'Framework :: Django :: 3.0' ,
28
+ 'Framework :: Django :: 3.1' ,
28
29
'Intended Audience :: Developers' ,
29
30
'License :: OSI Approved :: MIT License' ,
30
31
'Operating System :: OS Independent' ,
Original file line number Diff line number Diff line change
1
+ from django import get_version as django_version
1
2
from django .forms import Media
2
3
from django .test import TestCase
3
4
@@ -147,6 +148,7 @@ class MyMedia(PipelineFormMedia):
147
148
js = ('extra1.js' , 'extra2.js' )
148
149
149
150
media = Media (MyMedia )
151
+ script_tag = '<script type="text/javascript" src="%s"></script>' if django_version () < '3.1' else '<script src="%s"></script>'
150
152
151
153
self .assertEqual (
152
154
MyMedia .js ,
@@ -160,7 +162,7 @@ class MyMedia(PipelineFormMedia):
160
162
self .assertEqual (
161
163
media .render_js (),
162
164
[
163
- '<script type="text/javascript" src="%s"></script>' % path
165
+ script_tag % path
164
166
for path in (
165
167
'/static/extra1.js' ,
166
168
'/static/extra2.js' ,
@@ -177,6 +179,7 @@ class MyMedia(PipelineFormMedia):
177
179
js = ('extra1.js' , 'extra2.js' )
178
180
179
181
media = Media (MyMedia )
182
+ script_tag = '<script type="text/javascript" src="%s"></script>' if django_version () < '3.1' else '<script src="%s"></script>'
180
183
181
184
self .assertEqual (
182
185
MyMedia .js ,
@@ -191,7 +194,7 @@ class MyMedia(PipelineFormMedia):
191
194
self .assertEqual (
192
195
media .render_js (),
193
196
[
194
- '<script type="text/javascript" src="%s"></script>' % path
197
+ script_tag % path
195
198
for path in (
196
199
'/static/extra1.js' ,
197
200
'/static/extra2.js' ,
Original file line number Diff line number Diff line change 1
1
[tox]
2
2
envlist =
3
- pypy3-django{22,30}
4
- py36-django{22,30,-master}
5
- py37-django{22,30,-master}
6
- py38-django{22,30,-master}
3
+ pypy3-django{22,30,31 }
4
+ py36-django{22,30,31, -master}
5
+ py37-django{22,30,31, -master}
6
+ py38-django{22,30,31, -master}
7
7
docs
8
8
9
9
[testenv]
16
16
pypy3: mock
17
17
django22: Django>=2.2.1,<2.3
18
18
django30: Django>=3.0,<3.1
19
+ django31: Django>=3.1,<3.2
19
20
django-master: https://github.com/django/django/archive/master.tar.gz
20
21
jinja2
21
22
coverage
You can’t perform that action at this time.
0 commit comments