Skip to content

Commit 717f879

Browse files
browniebrokejambonrose
authored andcommitted
➕ Add support for Django 2.2 & 3.0
* Add Django 2.2 and 3.0 to the test matrix * Restrict coverage version <5 due to test failures * Remove use of FILE_CHARSET setting in Django 3.1 PR #65
1 parent 0072737 commit 717f879

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ python:
55
- "3.4"
66
- "3.5"
77
- "3.6"
8+
- "3.7"
9+
- "3.8"
810
install: pip install tox-travis
911
script: tox

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.. |versions| image:: https://img.shields.io/pypi/pyversions/django_coverage_plugin.svg
1515
:target: https://pypi.python.org/pypi/django_coverage_plugin
1616
:alt: Supported Python Versions
17-
.. |djversions| image:: https://img.shields.io/badge/Django-1.8%20%7C%201.11%20%7C%202.0%20%7C%202.1-44b78b.svg
17+
.. |djversions| image:: https://img.shields.io/badge/Django-1.8%20%7C%201.11%20%7C%202.0%20%7C%202.1%20%7C%202.2%20%7C%203.0-44b78b.svg
1818
:target: https://pypi.python.org/pypi/django_coverage_plugin
1919
:alt: Supported Django Versions
2020

@@ -26,9 +26,9 @@ Django Template Coverage.py Plugin
2626

2727
A `coverage.py`_ plugin to measure test coverage of Django templates.
2828

29-
Supported Python versions: 2.7, 3.4, 3.5 and 3.6.
29+
Supported Python versions: 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8.
3030

31-
Supported Django versions: 1.8, 1.11, 2.0, and 2.1.
31+
Supported Django versions: 1.8, 1.11, 2.0, 2.1, 2.2 and 3.0.
3232

3333
Supported coverage.py versions are 4.0 and higher.
3434

django_coverage_plugin/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ def read_template_source(filename):
134134
settings.configure()
135135

136136
with open(filename, "rb") as f:
137-
text = f.read().decode(settings.FILE_CHARSET)
137+
# The FILE_CHARSET setting will be removed in 3.1:
138+
# https://docs.djangoproject.com/en/3.0/ref/settings/#file-charset
139+
if django.VERSION >= (3, 1):
140+
charset = 'utf-8'
141+
else:
142+
charset = settings.FILE_CHARSET
143+
text = f.read().decode(charset)
138144

139145
return text
140146

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def read(*names, **kwargs):
3636
Programming Language :: Python :: 3.4
3737
Programming Language :: Python :: 3.5
3838
Programming Language :: Python :: 3.6
39+
Programming Language :: Python :: 3.7
40+
Programming Language :: Python :: 3.8
3941
Programming Language :: Python :: Implementation :: CPython
4042
Programming Language :: Python :: Implementation :: PyPy
4143
Topic :: Software Development :: Quality Assurance
@@ -46,6 +48,8 @@ def read(*names, **kwargs):
4648
Framework :: Django :: 1.11
4749
Framework :: Django :: 2.0
4850
Framework :: Django :: 2.1
51+
Framework :: Django :: 2.2
52+
Framework :: Django :: 3.0
4953
"""
5054

5155
setup(
@@ -63,7 +67,7 @@ def read(*names, **kwargs):
6367
url='https://github.com/nedbat/django_coverage_plugin',
6468
packages=['django_coverage_plugin'],
6569
install_requires=[
66-
'coverage >= 4.0',
70+
'coverage >= 4.0 , < 5',
6771
'six >= 1.4.0',
6872
],
6973
license='Apache 2.0',

tox.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
envlist =
1717
py27-django{18,19,110,111,111tip},
1818
py34-django{18,19,110,111,111tip,20},
19-
py35-django{18,19,110,111,111tip,20,21,tip},
20-
py36-django{18,19,110,111,111tip,20,21,tip},
21-
py37-django{20,21,tip},
19+
py35-django{18,19,110,111,111tip,20,21,22},
20+
py36-django{18,19,110,111,111tip,20,21,22,30,tip},
21+
py37-django{20,21,22,30,tip},
22+
py38-django{22,30,tip},
2223
check,pkgcheck,doc
2324

2425
[testenv]
@@ -31,6 +32,8 @@ deps =
3132
django111tip: https://github.com/django/django/archive/stable/1.11.x.tar.gz
3233
django20: Django>=2.0,<2.1
3334
django21: Django>=2.1,<2.2
35+
django22: Django>=2.2,<3.0
36+
django30: Django>=3.0,<3.1
3437
djangotip: https://github.com/django/django/archive/master.tar.gz
3538

3639
commands =

0 commit comments

Comments
 (0)