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:
1919 python : ' 3.7'
2020 - env : TOXENV=py38-django30
2121 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'
2230 - env : TOXENV=py36-django-master
2331 python : ' 3.6'
2432 - env : TOXENV=py37-django-master
Original file line number Diff line number Diff line change 33 History
44=======
55
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+
6172.0.4
718======
819
Original file line number Diff line number Diff line change 22
33from io import BytesIO
44
5- import django
5+ from django import get_version as django_version
66
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'
88
99if _CACHED_STATIC_FILES_STORAGE_AVAILABLE :
1010 from django .contrib .staticfiles .storage import CachedStaticFilesStorage
Original file line number Diff line number Diff line change 44from django .contrib .staticfiles .storage import staticfiles_storage
55
66from django import template
7- from django .template .context import Context
87from django .template .base import VariableDoesNotExist
98from django .template .loader import render_to_string
109from django .utils .safestring import mark_safe
Original file line number Diff line number Diff line change 66
77setup (
88 name = 'django-pipeline' ,
9- version = '2.0.4 ' ,
9+ version = '2.0.5 ' ,
1010 description = 'Pipeline is an asset packaging library for Django.' ,
1111 long_description = io .open ('README.rst' , encoding = 'utf-8' ).read () + '\n \n ' +
1212 io .open ('HISTORY.rst' , encoding = 'utf-8' ).read (),
2525 'Framework :: Django' ,
2626 'Framework :: Django :: 2.2' ,
2727 'Framework :: Django :: 3.0' ,
28+ 'Framework :: Django :: 3.1' ,
2829 'Intended Audience :: Developers' ,
2930 'License :: OSI Approved :: MIT License' ,
3031 'Operating System :: OS Independent' ,
Original file line number Diff line number Diff line change 1+ from django import get_version as django_version
12from django .forms import Media
23from django .test import TestCase
34
@@ -147,6 +148,7 @@ class MyMedia(PipelineFormMedia):
147148 js = ('extra1.js' , 'extra2.js' )
148149
149150 media = Media (MyMedia )
151+ script_tag = '<script type="text/javascript" src="%s"></script>' if django_version () < '3.1' else '<script src="%s"></script>'
150152
151153 self .assertEqual (
152154 MyMedia .js ,
@@ -160,7 +162,7 @@ class MyMedia(PipelineFormMedia):
160162 self .assertEqual (
161163 media .render_js (),
162164 [
163- '<script type="text/javascript" src="%s"></script>' % path
165+ script_tag % path
164166 for path in (
165167 '/static/extra1.js' ,
166168 '/static/extra2.js' ,
@@ -177,6 +179,7 @@ class MyMedia(PipelineFormMedia):
177179 js = ('extra1.js' , 'extra2.js' )
178180
179181 media = Media (MyMedia )
182+ script_tag = '<script type="text/javascript" src="%s"></script>' if django_version () < '3.1' else '<script src="%s"></script>'
180183
181184 self .assertEqual (
182185 MyMedia .js ,
@@ -191,7 +194,7 @@ class MyMedia(PipelineFormMedia):
191194 self .assertEqual (
192195 media .render_js (),
193196 [
194- '<script type="text/javascript" src="%s"></script>' % path
197+ script_tag % path
195198 for path in (
196199 '/static/extra1.js' ,
197200 '/static/extra2.js' ,
Original file line number Diff line number Diff line change 11[tox]
22envlist =
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}
77 docs
88
99[testenv]
1616 pypy3: mock
1717 django22: Django>=2.2.1,<2.3
1818 django30: Django>=3.0,<3.1
19+ django31: Django>=3.1,<3.2
1920 django-master: https://github.com/django/django/archive/master.tar.gz
2021 jinja2
2122 coverage
You can’t perform that action at this time.
0 commit comments