From ea1b1019cae34f53aec37e02cb21a6cfd53fe741 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 12:37:39 +0000 Subject: [PATCH 1/6] Add Django 2.2 and 3.0 to the build matrix --- .travis.yml | 2 ++ setup.py | 2 ++ tox.ini | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6df6b36..9db7c78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,7 @@ python: - "3.4" - "3.5" - "3.6" + - "3.7" + - "3.8" install: pip install tox-travis script: tox diff --git a/setup.py b/setup.py index 4c1c435..96e7f99 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,8 @@ def read(*names, **kwargs): Framework :: Django :: 1.11 Framework :: Django :: 2.0 Framework :: Django :: 2.1 +Framework :: Django :: 2.2 +Framework :: Django :: 3.0 """ setup( diff --git a/tox.ini b/tox.ini index 58250ca..31061a9 100644 --- a/tox.ini +++ b/tox.ini @@ -16,9 +16,10 @@ envlist = py27-django{18,19,110,111,111tip}, py34-django{18,19,110,111,111tip,20}, - py35-django{18,19,110,111,111tip,20,21,tip}, - py36-django{18,19,110,111,111tip,20,21,tip}, - py37-django{20,21,tip}, + py35-django{18,19,110,111,111tip,20,21,22}, + py36-django{18,19,110,111,111tip,20,21,22,30,tip}, + py37-django{20,21,22,30,tip}, + py38-django{22,30,tip}, check,pkgcheck,doc [testenv] @@ -31,6 +32,8 @@ deps = django111tip: https://github.com/django/django/archive/stable/1.11.x.tar.gz django20: Django>=2.0,<2.1 django21: Django>=2.1,<2.2 + django22: Django>=2.2,<3.0 + django30: Django>=3.0,<3.1 djangotip: https://github.com/django/django/archive/master.tar.gz commands = From d6dc2fdd1fd433ce4e3e22a9840670867ad5d0cc Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 12:49:03 +0000 Subject: [PATCH 2/6] Restrict coverage version to be <5 for now --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 96e7f99..34a4d87 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ def read(*names, **kwargs): url='https://github.com/nedbat/django_coverage_plugin', packages=['django_coverage_plugin'], install_requires=[ - 'coverage >= 4.0', + 'coverage >= 4.0 , < 5', 'six >= 1.4.0', ], license='Apache 2.0', From bffef00053e5c9be129c516f16d17c588479a0ef Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 13:18:29 +0000 Subject: [PATCH 3/6] Remove use of FILE_CHARSET setting in Django 3.1 The FILE_CHARSET setting is removed. --- django_coverage_plugin/plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index 60c61df..ab3669e 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -134,7 +134,11 @@ def read_template_source(filename): settings.configure() with open(filename, "rb") as f: - text = f.read().decode(settings.FILE_CHARSET) + if django.VERSION >= (3, 1): + charset = 'utf-8' + else: + charset = settings.FILE_CHARSET + text = f.read().decode(charset) return text From 842c7e56e7d1802d312386857c34f05359d28f1b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 14:46:14 +0000 Subject: [PATCH 4/6] Update supported versions in README --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 1416fdd..8409149 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ .. |versions| image:: https://img.shields.io/pypi/pyversions/django_coverage_plugin.svg :target: https://pypi.python.org/pypi/django_coverage_plugin :alt: Supported Python Versions -.. |djversions| image:: https://img.shields.io/badge/Django-1.8%20%7C%201.11%20%7C%202.0%20%7C%202.1-44b78b.svg +.. |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 :target: https://pypi.python.org/pypi/django_coverage_plugin :alt: Supported Django Versions @@ -26,9 +26,9 @@ Django Template Coverage.py Plugin A `coverage.py`_ plugin to measure test coverage of Django templates. -Supported Python versions: 2.7, 3.4, 3.5 and 3.6. +Supported Python versions: 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8. -Supported Django versions: 1.8, 1.11, 2.0, and 2.1. +Supported Django versions: 1.8, 1.11, 2.0, 2.1, 2.2 and 3.0. Supported coverage.py versions are 4.0 and higher. From a3379a089c8ffbb583073a5013ad85830957bbe2 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 14:46:58 +0000 Subject: [PATCH 5/6] Update trove classifiers with newer Python --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 34a4d87..174fdac 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,8 @@ def read(*names, **kwargs): Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 +Programming Language :: Python :: 3.7 +Programming Language :: Python :: 3.8 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Quality Assurance From ab5fb5cbe7397586595956957ffdd42d92edd3cb Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 14 Jan 2020 14:49:07 +0000 Subject: [PATCH 6/6] Add a comment about removed setting in 3.1 --- django_coverage_plugin/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index ab3669e..e777f4f 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -134,6 +134,8 @@ def read_template_source(filename): settings.configure() with open(filename, "rb") as f: + # The FILE_CHARSET setting will be removed in 3.1: + # https://docs.djangoproject.com/en/3.0/ref/settings/#file-charset if django.VERSION >= (3, 1): charset = 'utf-8' else: