From 003b6d055ad362a84480ef24ddc71e6e4350514f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 31 Oct 2022 07:03:29 -0400 Subject: [PATCH 01/43] docs: move a url so ghrelease will work --- README.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9cb12c1..4d08b53 100644 --- a/README.rst +++ b/README.rst @@ -234,6 +234,7 @@ v1.4.2 — 2017-02-06 Fixes another instance of `issue 32`_, which was the result of an initialization order problem. +.. _issue 32: https://github.com/nedbat/django_coverage_plugin/issues/32 v1.4.1 — 2017-01-25 @@ -242,9 +243,6 @@ v1.4.1 — 2017-01-25 Fixes `issue 32`_, which was the result of an initialization order problem. -.. _issue 32: https://github.com/nedbat/django_coverage_plugin/issues/32 - - v1.4 — 2017-01-16 ----------------- From 739306f6a129d148a81fb81b612dcb8807fcecec Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 06:05:36 -0500 Subject: [PATCH 02/43] refactor: drop support for py<3.7 and django<1.11 --- .github/workflows/tests.yml | 8 +----- README.rst | 10 +++++-- django_coverage_plugin/plugin.py | 45 ++++++++++++-------------------- setup.py | 5 ---- tests/banner.py | 2 -- tests/plugin_test.py | 4 --- tests/test_extends.py | 42 +---------------------------- tox.ini | 9 ++----- 8 files changed, 28 insertions(+), 97 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 04f3058..14bf40d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,17 +31,11 @@ jobs: python-version: # When changing this list, be sure to check the [gh-actions] list in # tox.ini so that tox will run properly. - - "2.7" - - "3.6" - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - exclude: - # Windows 2.7 doesn't work because Microsoft removed stuff we needed. - - os: windows-latest - python-version: "2.7" fail-fast: false steps: @@ -85,7 +79,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v2" with: - python-version: "3.8" + python-version: "3.7" - name: "Install dependencies" run: | diff --git a/README.rst b/README.rst index 4d08b53..ce3a935 100644 --- a/README.rst +++ b/README.rst @@ -31,9 +31,9 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. Supported on: -- Python: 2.7, and 3.6 through 3.11. +- Python: 3.7 through 3.11. -- Django: 1.8, 1.11, 2.x, 3.x and 4.x. +- Django: 1.11, 2.x, 3.x and 4.x. - Coverage.py: 4.x or higher. @@ -137,6 +137,12 @@ History .. scriv-insert-here +Next +---- + +Dropped support for Python 2.7, Python 3.6, and Django 1.8. + + v2.0.4 — 2022-10-31 ------------------- diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index 72b48e6..df07f2f 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -3,8 +3,6 @@ """The Django template coverage plugin.""" -from __future__ import print_function - import os.path import re @@ -99,39 +97,28 @@ def check_debug(): return True -if django.VERSION < (1, 8): - raise RuntimeError("Django Coverage Plugin requires Django 1.8 or higher") +if django.VERSION < (1, 11): + raise RuntimeError("Django Coverage Plugin requires Django 1.11 or higher") -if django.VERSION >= (1, 9): - # Since we are grabbing at internal details, we have to adapt as they - # change over versions. - def filename_for_frame(frame): - try: - return frame.f_locals["self"].origin.name - except (KeyError, AttributeError): - return None +# Since we are grabbing at internal details, we have to adapt as they +# change over versions. +def filename_for_frame(frame): + try: + return frame.f_locals["self"].origin.name + except (KeyError, AttributeError): + return None - def position_for_node(node): - try: - return node.token.position - except AttributeError: - return None - def position_for_token(token): - return token.position -else: - def filename_for_frame(frame): - try: - return frame.f_locals["self"].source[0].name - except (KeyError, AttributeError, IndexError): - return None +def position_for_node(node): + try: + return node.token.position + except AttributeError: + return None - def position_for_node(node): - return node.source[1] - def position_for_token(token): - return token.source[1] +def position_for_token(token): + return token.position def read_template_source(filename): diff --git a/setup.py b/setup.py index c2c7a8a..3e8ca40 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- encoding: utf-8 -*- """Setup for Django Coverage Plugin Licensed under the Apache 2.0 License @@ -7,7 +6,6 @@ - https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt """ -from __future__ import absolute_import, print_function import io import re @@ -32,8 +30,6 @@ def read(*names, **kwargs): Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: OS Independent -Programming Language :: Python :: 2.7 -Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -45,7 +41,6 @@ def read(*names, **kwargs): Topic :: Software Development :: Testing Development Status :: 5 - Production/Stable Framework :: Django -Framework :: Django :: 1.8 Framework :: Django :: 1.11 Framework :: Django :: 2.2 Framework :: Django :: 3.2 diff --git a/tests/banner.py b/tests/banner.py index 2febc6e..9c2fb58 100644 --- a/tests/banner.py +++ b/tests/banner.py @@ -3,8 +3,6 @@ """For printing the versions from tox.ini.""" -from __future__ import print_function - import platform import django diff --git a/tests/plugin_test.py b/tests/plugin_test.py index 1798971..ceef099 100644 --- a/tests/plugin_test.py +++ b/tests/plugin_test.py @@ -53,10 +53,6 @@ def test_settings(): ], }) - if django.VERSION < (1, 10): - # for {% ssi %} - the_settings['TEMPLATES'][0]['OPTIONS']['allowed_include_roots'] = [""] - return the_settings diff --git a/tests/test_extends.py b/tests/test_extends.py index a4922db..4b3df69 100644 --- a/tests/test_extends.py +++ b/tests/test_extends.py @@ -3,7 +3,7 @@ """Tests of template inheritance for django_coverage_plugin.""" -from .plugin_test import DjangoPluginTestCase, django_stop_before +from .plugin_test import DjangoPluginTestCase class BlockTest(DjangoPluginTestCase): @@ -146,43 +146,3 @@ def test_include(self): self.assertEqual(text, "First\nInside\nJob\n\nLast\n") self.assert_analysis([1, 2, 3], name="outer.html") self.assert_analysis([1, 2], name="nested.html") - - -# {% ssi %} is in earlier Djangos than 1.9, but doesn't trace properly. -@django_stop_before(1, 10) -class SsiTest(DjangoPluginTestCase): - """Test {% ssi %}, which does not trace the included file.""" - - def test_ssi_unparsed(self): - nested = self.make_template(name="nested.html", text="""\ - Inside {{ a }} - Job - """) - - self.make_template(name="outer.html", text="""\ - First - {% ssi "NESTED" %} - Last - """.replace("NESTED", nested)) - - text = self.run_django_coverage(name="outer.html", context={'a': 17}) - self.assertEqual(text, "First\nInside {{ a }}\nJob\n\nLast\n") - self.assert_analysis([1, 2, 3], name="outer.html") - self.assert_measured_files("outer.html", "nested.html") - - def test_ssi_parsed(self): - nested = self.make_template(name="nested.html", text="""\ - Inside {{ a }} - Job - """) - - self.make_template(name="outer.html", text="""\ - First - {% ssi "NESTED" parsed %} - Last - """.replace("NESTED", nested)) - - text = self.run_django_coverage(name="outer.html", context={'a': 17}) - self.assertEqual(text, "First\nInside 17\nJob\n\nLast\n") - self.assert_analysis([1, 2, 3], name="outer.html") - self.assert_measured_files("outer.html", "nested.html") diff --git a/tox.ini b/tox.ini index 63368b1..5a8304f 100644 --- a/tox.ini +++ b/tox.ini @@ -14,20 +14,17 @@ [tox] envlist = - py27-django{18,111}, - py36-django{18,111,22,32}, - py37-django{22,32}, + py37-django{111,22,32}, py38-django{22,32,40,41,tip}, py39-django{22,32,40,41,tip}, py310-django{32,40,41,tip}, - py311-django{tip}, + py311-django{41,tip}, check,pkgcheck,doc [testenv] deps = pytest unittest-mixins==1.6 - django18: Django>=1.8,<1.9 django111: Django>=1.11,<2.0 django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 @@ -75,8 +72,6 @@ commands = [gh-actions] python = - 2.7: py27 - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 From 68c74080f5ca93c3469d54528d302d4cfc87e4d5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 06:10:18 -0500 Subject: [PATCH 03/43] refactor(test): oops, this function looked like a test, but is not --- tests/plugin_test.py | 4 ++-- tests/test_settings.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/plugin_test.py b/tests/plugin_test.py index ceef099..d0a1892 100644 --- a/tests/plugin_test.py +++ b/tests/plugin_test.py @@ -21,7 +21,7 @@ from django_coverage_plugin.plugin import DjangoTemplatePlugin -def test_settings(): +def get_test_settings(): """Create a dict full of default Django settings for the tests.""" the_settings = { 'CACHES': { @@ -56,7 +56,7 @@ def test_settings(): return the_settings -settings.configure(**test_settings()) +settings.configure(**get_test_settings()) if hasattr(django, "setup"): django.setup() diff --git a/tests/test_settings.py b/tests/test_settings.py index c3ef4d5..4be1636 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -5,18 +5,18 @@ from django.test.utils import override_settings -from .plugin_test import DjangoPluginTestCase, test_settings +from .plugin_test import DjangoPluginTestCase, get_test_settings # Make settings overrides for tests below. NON_DJANGO_BACKEND = 'django.template.backends.dummy.TemplateStrings' -DEBUG_FALSE_OVERRIDES = test_settings() +DEBUG_FALSE_OVERRIDES = get_test_settings() DEBUG_FALSE_OVERRIDES['TEMPLATES'][0]['OPTIONS']['debug'] = False -NO_OPTIONS_OVERRIDES = test_settings() +NO_OPTIONS_OVERRIDES = get_test_settings() del NO_OPTIONS_OVERRIDES['TEMPLATES'][0]['OPTIONS'] -OTHER_ENGINE_OVERRIDES = test_settings() +OTHER_ENGINE_OVERRIDES = get_test_settings() OTHER_ENGINE_OVERRIDES['TEMPLATES'][0]['BACKEND'] = NON_DJANGO_BACKEND OTHER_ENGINE_OVERRIDES['TEMPLATES'][0]['OPTIONS'] = {} From 4ebb2e491908ccc7fb284d52e0af44e6156095d6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 06:27:41 -0500 Subject: [PATCH 04/43] refactor(test): avoid deprecated method --- tests/test_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_source.py b/tests/test_source.py index 80b53d4..d78449b 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -90,7 +90,7 @@ def test_non_utf8_error(self): self.assert_measured_files("main.html", "static{}changelog.txt".format(os.sep)) self.assert_analysis([1], name="main.html") - with self.assertRaisesRegexp(NoSource, r"changelog.txt.*invalid start byte"): + with self.assertRaisesRegex(NoSource, r"changelog.txt.*invalid start byte"): self.cov.html_report() def test_non_utf8_omitted(self): From 5b19217ff725fb6c32faf7315d53b5da1f001465 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 06:28:03 -0500 Subject: [PATCH 05/43] test: also test on versions of coverage --- tests/banner.py | 6 ++++-- tox.ini | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/banner.py b/tests/banner.py index 9c2fb58..ff6e7aa 100644 --- a/tests/banner.py +++ b/tests/banner.py @@ -5,12 +5,14 @@ import platform +import coverage import django print( - "{} {}; Django {}".format( + "{} {}; Django {}; Coverage {}".format( platform.python_implementation(), platform.python_version(), - django.get_version() + django.get_version(), + coverage.__version__, ) ) diff --git a/tox.ini b/tox.ini index 5a8304f..5a087ef 100644 --- a/tox.ini +++ b/tox.ini @@ -14,23 +14,26 @@ [tox] envlist = - py37-django{111,22,32}, - py38-django{22,32,40,41,tip}, - py39-django{22,32,40,41,tip}, - py310-django{32,40,41,tip}, - py311-django{41,tip}, + py37-django{111,22,32}-cov{5,6,tip}, + py38-django{22,32,40,41,tip}-cov{5,6,tip}, + py39-django{22,32,40,41,tip}-cov{5,6,tip}, + py310-django{32,40,41,tip}-cov{5,6,tip}, + py311-django{41,tip}-cov{6,tip}, check,pkgcheck,doc [testenv] deps = - pytest - unittest-mixins==1.6 + cov5: coverage>=5.0,<6.0 + cov6: coverage>=6.0,<7.0 + covtip: git+https://github.com/nedbat/coveragepy.git django111: Django>=1.11,<2.0 django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django40: Django>=4.0,<4.1 django41: Django>=4.1,<4.2 - djangotip: https://github.com/django/django/archive/main.tar.gz + djangotip: git+https://github.com/django/django.git + pytest + unittest-mixins==1.6 commands = python -c "import tests.banner" From aa02ed7833abb68fe6b434fb17a4dadf251ef897 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 08:40:34 -0500 Subject: [PATCH 06/43] test: more checks of coverage warnings --- tests/plugin_test.py | 55 +++++++++++++++++++++++++++---------------- tests/test_engines.py | 3 ++- tests/test_simple.py | 13 ++++++---- tests/test_source.py | 7 +++++- 4 files changed, 51 insertions(+), 27 deletions(-) diff --git a/tests/plugin_test.py b/tests/plugin_test.py index d0a1892..08d152f 100644 --- a/tests/plugin_test.py +++ b/tests/plugin_test.py @@ -226,31 +226,52 @@ def get_xml_report(self, name=None): return xml_coverage @contextlib.contextmanager - def assert_plugin_disabled(self, msg): - """Assert that our plugin was disabled during an operation.""" - # self.run_django_coverage will raise PluginDisabled if the plugin - # was disabled. + def assert_coverage_warnings(self, *msgs, min_cov=None): + """Assert that coverage.py warnings are raised that contain all msgs. + + If coverage version isn't at least min_cov, then no warnings are expected. + + """ # Coverage.py 6.0 made the warnings real warnings, so we have to adapt # how we test the warnings based on the version. - if coverage.version.version_info >= (6, 0): + if min_cov is not None and coverage.version_info < min_cov: + # Don't check for warnings on lower versions of coverage + yield + return + elif coverage.version_info >= (6, 0): import coverage.exceptions as cov_exc ctxmgr = self.assertWarns(cov_exc.CoverageWarning) else: - ctxmgr = nullcontext() + ctxmgr = contextlib.nullcontext() with ctxmgr as cw: - with self.assertRaises(PluginDisabled): - yield + yield if cw is not None: warn_text = "\n".join(str(w.message) for w in cw.warnings) else: warn_text = self.stderr() - self.assertIn( - "Disabling plug-in 'django_coverage_plugin.DjangoTemplatePlugin' " - "due to an exception:", - warn_text - ) - self.assertIn("DjangoTemplatePluginException: " + msg, warn_text) + for msg in msgs: + self.assertIn(msg, warn_text) + + @contextlib.contextmanager + def assert_plugin_disabled(self, msg): + """Assert that our plugin was disabled during an operation.""" + # self.run_django_coverage will raise PluginDisabled if the plugin + # was disabled. + msgs = [ + "Disabling plug-in 'django_coverage_plugin.DjangoTemplatePlugin' due to an exception:", + "DjangoTemplatePluginException: " + msg, + ] + with self.assert_coverage_warnings(*msgs): + with self.assertRaises(PluginDisabled): + yield + + @contextlib.contextmanager + def assert_no_data(self, min_cov=None): + """Assert that coverage warns no data was collected.""" + warn_msg = "No data was collected. (no-data-collected)" + with self.assert_coverage_warnings(warn_msg, min_cov=min_cov): + yield def squashed(s): @@ -289,9 +310,3 @@ def test_thing(self): class PluginDisabled(Exception): """Raised if we find that our plugin has been disabled.""" pass - - -@contextlib.contextmanager -def nullcontext(): - """For when we need a context manager to do nothing.""" - yield None diff --git a/tests/test_engines.py b/tests/test_engines.py index 76c713f..213d59e 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -33,7 +33,8 @@ def test_file_template(self): self.assert_analysis([1]) def test_string_template(self): - text = self.run_django_coverage(text='Hello', using='other') + with self.assert_no_data(): + text = self.run_django_coverage(text='Hello', using='other') self.assertEqual(text, 'Hello') def test_third_engine_not_debug(self): diff --git a/tests/test_simple.py b/tests/test_simple.py index 7ca9188..225a095 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -245,11 +245,14 @@ class StringTemplateTest(DjangoPluginTestCase): run_in_temp_dir = False def test_string_template(self): - text = self.run_django_coverage( - text="Hello, {{name}}!", - context={'name': 'World'}, - options={}, - ) + # I don't understand why coverage 6 warns about no data, + # but coverage 5 does not. + with self.assert_no_data(min_cov=(6, 0)): + text = self.run_django_coverage( + text="Hello, {{name}}!", + context={'name': 'World'}, + options={}, + ) self.assertEqual(text, "Hello, World!") diff --git a/tests/test_source.py b/tests/test_source.py index d78449b..229a9b8 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -133,7 +133,12 @@ def test_non_utf8_ignored(self): self.assert_measured_files("main.html", "static{}changelog.txt".format(os.sep)) self.assert_analysis([1], name="main.html") - self.cov.html_report() + warn_msg = ( + "'utf-8' codec can't decode byte 0xf6 in position 2: " + + "invalid start byte (couldnt-parse)" + ) + with self.assert_coverage_warnings(warn_msg, min_cov=(6, 0)): + self.cov.html_report() def test_htmlcov_isnt_measured(self): # We used to find the HTML report and think it was template files. From 7c2f9fc2f9baf6d7df372ba1f50cd60e299514c4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 11:37:12 -0500 Subject: [PATCH 07/43] refactor: pyupgrade --py37-plus --- django_coverage_plugin/plugin.py | 15 +++++++-------- setup.py | 3 +-- tests/plugin_test.py | 8 ++++---- tests/test_engines.py | 2 +- tests/test_html.py | 1 - tests/test_simple.py | 11 +++++------ tests/test_source.py | 6 +++--- 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index df07f2f..6a0a720 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -17,7 +17,6 @@ from django.template.base import Lexer, NodeList, Template, TextNode from django.template.defaulttags import VerbatimNode from django.templatetags.i18n import BlockTranslateNode -from six.moves import range try: from django.template.base import TokenType @@ -165,7 +164,7 @@ def sys_info(self): return [ ("django_template_dir", self.django_template_dir), ("environment", sorted( - ("%s = %s" % (k, v)) + ("{} = {}".format(k, v)) for k, v in os.environ.items() if "DJANGO" in k )), @@ -239,7 +238,7 @@ def line_number_range(self, frame): return -1, -1 if SHOW_TRACING: - print("{!r}: {}".format(render_self, position)) + print(f"{render_self!r}: {position}") s_start, s_end = position if isinstance(render_self, TextNode): first_line = render_self.s.splitlines(True)[0] @@ -294,7 +293,7 @@ def get_line_map(self, filename): class FileReporter(coverage.plugin.FileReporter): def __init__(self, filename): - super(FileReporter, self).__init__(filename) + super().__init__(filename) # TODO: html filenames are absolute. self._source = None @@ -303,15 +302,15 @@ def source(self): if self._source is None: try: self._source = read_template_source(self.filename) - except (IOError, UnicodeError) as exc: - raise NoSource("Couldn't read {}: {}".format(self.filename, exc)) + except (OSError, UnicodeError) as exc: + raise NoSource(f"Couldn't read {self.filename}: {exc}") return self._source def lines(self): source_lines = set() if SHOW_PARSING: - print("-------------- {}".format(self.filename)) + print(f"-------------- {self.filename}") if django.VERSION >= (1, 9): lexer = Lexer(self.source()) @@ -389,7 +388,7 @@ def lines(self): source_lines.update(range(lineno, lineno+num_lines)) if SHOW_PARSING: - print("\t\t\tNow source_lines is: {!r}".format(source_lines)) + print(f"\t\t\tNow source_lines is: {source_lines!r}") return source_lines diff --git a/setup.py b/setup.py index 3e8ca40..ed86f29 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ """ -import io import re from os.path import dirname, join @@ -19,7 +18,7 @@ def read(*names, **kwargs): Parameter: encoding kwarg may be set """ - return io.open( + return open( join(dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8') ).read() diff --git a/tests/plugin_test.py b/tests/plugin_test.py index 08d152f..cc90be8 100644 --- a/tests/plugin_test.py +++ b/tests/plugin_test.py @@ -66,11 +66,11 @@ class DjangoPluginTestCase(StdStreamCapturingMixin, TempDirMixin, TestCase): """A base class for all our tests.""" def setUp(self): - super(DjangoPluginTestCase, self).setUp() + super().setUp() self.template_directory = "templates" def _path(self, name=None): - return "{}/{}".format(self.template_directory, name or self.template_file) + return f"{self.template_directory}/{name or self.template_file}" def make_template(self, text, name=None): """Make a template with `text`. @@ -191,14 +191,14 @@ def assert_analysis(self, executable, missing=None, name=None): self.assertEqual( executable, actual_executable, - "Executable lines aren't as expected: %r != %r" % ( + "Executable lines aren't as expected: {!r} != {!r}".format( executable, actual_executable, ), ) self.assertEqual( missing or [], actual_missing, - "Missing lines aren't as expected: %r != %r" % ( + "Missing lines aren't as expected: {!r} != {!r}".format( missing, actual_missing, ), ) diff --git a/tests/test_engines.py b/tests/test_engines.py index 213d59e..fdaa2ca 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -10,7 +10,7 @@ class MultipleEngineTests(DjangoPluginTestCase): def setUp(self): - super(MultipleEngineTests, self).setUp() + super().setUp() engine = { 'NAME': 'other', diff --git a/tests/test_html.py b/tests/test_html.py index c22ac00..5038468 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -1,4 +1,3 @@ -# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt diff --git a/tests/test_simple.py b/tests/test_simple.py index 225a095..a09ecb7 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -1,4 +1,3 @@ -# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt @@ -7,7 +6,7 @@ from .plugin_test import DjangoPluginTestCase # 200 Unicode chars: snowman + poo. -UNIUNI = u"\u26C4\U0001F4A9"*100 +UNIUNI = "\u26C4\U0001F4A9"*100 if isinstance(UNIUNI, str): UNISTR = UNIUNI else: @@ -64,8 +63,8 @@ def test_non_ascii(self): υηιcσɗє ιѕ тяιcку {{more}}! """) - text = self.run_django_coverage(context={'more': u'ɘboɔinU'}) - self.assertEqual(text, u'υηιcσɗє ιѕ тяιcку\nɘboɔinU!\n') + text = self.run_django_coverage(context={'more': 'ɘboɔinU'}) + self.assertEqual(text, 'υηιcσɗє ιѕ тяιcку\nɘboɔinU!\n') self.assert_analysis([1, 2]) self.assertEqual(self.get_html_report(), 100) self.assertEqual(self.get_xml_report(), 100) @@ -215,8 +214,8 @@ def test_verbatim(self): text = self.run_django_coverage() self.assertEqual( text, - u"1\n\n{{if dying}}Alive.{{/if}}\nsecond.\n" - u"{%third%}.UNIUNI\n\n7\n".replace(u"UNIUNI", UNIUNI) + "1\n\n{{if dying}}Alive.{{/if}}\nsecond.\n" + "{%third%}.UNIUNI\n\n7\n".replace("UNIUNI", UNIUNI) ) self.assert_analysis([1, 2, 3, 4, 5, 7]) diff --git a/tests/test_source.py b/tests/test_source.py index 229a9b8..6313504 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -88,7 +88,7 @@ def test_non_utf8_error(self): text = self.run_django_coverage(name="main.html") self.assertEqual(text, "Hello") - self.assert_measured_files("main.html", "static{}changelog.txt".format(os.sep)) + self.assert_measured_files("main.html", f"static{os.sep}changelog.txt") self.assert_analysis([1], name="main.html") with self.assertRaisesRegex(NoSource, r"changelog.txt.*invalid start byte"): self.cov.html_report() @@ -110,7 +110,7 @@ def test_non_utf8_omitted(self): text = self.run_django_coverage(name="main.html") self.assertEqual(text, "Hello") - self.assert_measured_files("main.html", "static{}changelog.txt".format(os.sep)) + self.assert_measured_files("main.html", f"static{os.sep}changelog.txt") self.assert_analysis([1], name="main.html") self.cov.html_report() @@ -131,7 +131,7 @@ def test_non_utf8_ignored(self): text = self.run_django_coverage(name="main.html") self.assertEqual(text, "Hello") - self.assert_measured_files("main.html", "static{}changelog.txt".format(os.sep)) + self.assert_measured_files("main.html", f"static{os.sep}changelog.txt") self.assert_analysis([1], name="main.html") warn_msg = ( "'utf-8' codec can't decode byte 0xf6 in position 2: " + From 09ed8b4d8ab2c6e29fa8b3fce41290f6750ac5fc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Dec 2022 11:47:27 -0500 Subject: [PATCH 08/43] test: ci should cancel older jobs --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 14bf40d..24cb6a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,11 +12,18 @@ on: # week, Sundays at 6:00 UTC. - cron: "0 6 * * 0" +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true defaults: run: shell: bash +env: + PIP_DISABLE_PIP_VERSION_CHECK: 1 + FORCE_COLOR: 1 # Get colored pytest output + jobs: tests: name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" From c35d4b694d1f1e039612fdd2d00a719aa2a899ea Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 6 Dec 2022 04:51:01 -0500 Subject: [PATCH 09/43] refactor: no need for six anymore --- .isort.cfg | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index ed14f2e..cd31999 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -4,4 +4,4 @@ force_grid_wrap=0 include_trailing_comma=True line_length=79 multi_line_output=3 -known_third_party = coverage,django,setuptools,six,unittest_mixins +known_third_party = coverage,django,setuptools,unittest_mixins diff --git a/setup.py b/setup.py index ed86f29..49d29a6 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,6 @@ def read(*names, **kwargs): packages=['django_coverage_plugin'], install_requires=[ 'coverage', - 'six >= 1.4.0', ], license='Apache-2.0', classifiers=classifiers.splitlines(), From 733514a5caf03bc152f52057f41a9528c8232f64 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 6 Dec 2022 04:56:26 -0500 Subject: [PATCH 10/43] build: 3.0.0 --- README.rst | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ce3a935..13f091c 100644 --- a/README.rst +++ b/README.rst @@ -137,8 +137,8 @@ History .. scriv-insert-here -Next ----- +v3.0.0 — 2022-12-06 +------------------- Dropped support for Python 2.7, Python 3.6, and Django 1.8. diff --git a/setup.py b/setup.py index 49d29a6..579114f 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def read(*names, **kwargs): setup( name='django_coverage_plugin', - version='2.0.4', + version='3.0.0', description='Django template coverage.py plugin', long_description=( re.sub( From bc067032dd675a705ead621afaea0c34fde1247f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 22 Jan 2023 09:10:16 -0500 Subject: [PATCH 11/43] test: django tip dropped support for 3.8 and 3.9 I'm not sure why they did, but they did. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 5a087ef..70494ec 100644 --- a/tox.ini +++ b/tox.ini @@ -15,8 +15,8 @@ [tox] envlist = py37-django{111,22,32}-cov{5,6,tip}, - py38-django{22,32,40,41,tip}-cov{5,6,tip}, - py39-django{22,32,40,41,tip}-cov{5,6,tip}, + py38-django{22,32,40,41}-cov{5,6,tip}, + py39-django{22,32,40,41}-cov{5,6,tip}, py310-django{32,40,41,tip}-cov{5,6,tip}, py311-django{41,tip}-cov{6,tip}, check,pkgcheck,doc From b821fc670d8b4ebb03080aa869bccb1cb1157bb3 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 30 Apr 2023 06:35:51 -0400 Subject: [PATCH 12/43] build: update the tox envs for Django 4.2 and coverage 7.x --- tox.ini | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tox.ini b/tox.ini index 70494ec..2451ca4 100644 --- a/tox.ini +++ b/tox.ini @@ -14,23 +14,22 @@ [tox] envlist = - py37-django{111,22,32}-cov{5,6,tip}, - py38-django{22,32,40,41}-cov{5,6,tip}, - py39-django{22,32,40,41}-cov{5,6,tip}, - py310-django{32,40,41,tip}-cov{5,6,tip}, - py311-django{41,tip}-cov{6,tip}, + py37-django{111,22,32}-cov{6,7,tip}, + py38-django{22,32,42}-cov{6,7,tip}, + py39-django{22,32,42}-cov{6,7,tip}, + py310-django{32,42,tip}-cov{6,7,tip}, + py311-django{42,tip}-cov{6,7,tip}, check,pkgcheck,doc [testenv] deps = - cov5: coverage>=5.0,<6.0 cov6: coverage>=6.0,<7.0 + cov7: coverage>=7.0,<8.0 covtip: git+https://github.com/nedbat/coveragepy.git django111: Django>=1.11,<2.0 django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 - django40: Django>=4.0,<4.1 - django41: Django>=4.1,<4.2 + django42: Django>=4.2,<5.0 djangotip: git+https://github.com/django/django.git pytest unittest-mixins==1.6 From 8d6c1032b443b3d48a57d77e9690d18d430d5974 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Jul 2023 07:18:04 -0400 Subject: [PATCH 13/43] build: drop support for 3.7 and Django 1.x --- .github/workflows/tests.yml | 3 +-- README.rst | 6 +++--- django_coverage_plugin/plugin.py | 9 +++------ setup.py | 3 +-- tox.ini | 3 --- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 24cb6a1..a3bbb7a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,6 @@ jobs: python-version: # When changing this list, be sure to check the [gh-actions] list in # tox.ini so that tox will run properly. - - "3.7" - "3.8" - "3.9" - "3.10" @@ -86,7 +85,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v2" with: - python-version: "3.7" + python-version: "3.8" - name: "Install dependencies" run: | diff --git a/README.rst b/README.rst index 13f091c..5a68ce0 100644 --- a/README.rst +++ b/README.rst @@ -31,11 +31,11 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. Supported on: -- Python: 3.7 through 3.11. +- Python: 3.8 through 3.11. -- Django: 1.11, 2.x, 3.x and 4.x. +- Django: 2.x, 3.x and 4.x. -- Coverage.py: 4.x or higher. +- Coverage.py: 6.x or higher. The plugin is pip installable:: diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index 6a0a720..158ee9a 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -96,8 +96,8 @@ def check_debug(): return True -if django.VERSION < (1, 11): - raise RuntimeError("Django Coverage Plugin requires Django 1.11 or higher") +if django.VERSION < (2, 0): + raise RuntimeError("Django Coverage Plugin requires Django 2.x or higher") # Since we are grabbing at internal details, we have to adapt as they @@ -312,10 +312,7 @@ def lines(self): if SHOW_PARSING: print(f"-------------- {self.filename}") - if django.VERSION >= (1, 9): - lexer = Lexer(self.source()) - else: - lexer = Lexer(self.source(), self.filename) + lexer = Lexer(self.source()) tokens = lexer.tokenize() # Are we inside a comment? diff --git a/setup.py b/setup.py index 579114f..99d3863 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ def read(*names, **kwargs): Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: OS Independent -Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -43,7 +42,7 @@ def read(*names, **kwargs): Framework :: Django :: 1.11 Framework :: Django :: 2.2 Framework :: Django :: 3.2 -Framework :: Django :: 4.1 +Framework :: Django :: 4.2 """ setup( diff --git a/tox.ini b/tox.ini index 2451ca4..7be8aeb 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,6 @@ [tox] envlist = - py37-django{111,22,32}-cov{6,7,tip}, py38-django{22,32,42}-cov{6,7,tip}, py39-django{22,32,42}-cov{6,7,tip}, py310-django{32,42,tip}-cov{6,7,tip}, @@ -26,7 +25,6 @@ deps = cov6: coverage>=6.0,<7.0 cov7: coverage>=7.0,<8.0 covtip: git+https://github.com/nedbat/coveragepy.git - django111: Django>=1.11,<2.0 django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django42: Django>=4.2,<5.0 @@ -74,7 +72,6 @@ commands = [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 From f829489edd5cfb59ca0e1449065778466239de10 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Jul 2023 07:47:30 -0400 Subject: [PATCH 14/43] test: modernize some workflow stuff --- .github/workflows/tests.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3bbb7a..ee74070 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,9 @@ on: # week, Sundays at 6:00 UTC. - cron: "0 6 * * 0" +permissions: + contents: read + concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true @@ -26,15 +29,15 @@ env: jobs: tests: - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" + name: "${{ matrix.python-version }} on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}-latest" strategy: matrix: os: - - ubuntu-latest - - macos-latest - - windows-latest + - ubuntu + - macos + - windows python-version: # When changing this list, be sure to check the [gh-actions] list in # tox.ini so that tox will run properly. @@ -46,12 +49,13 @@ jobs: steps: - name: "Check out the repo" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Set up Python" - uses: "actions/setup-python@v2" + uses: "actions/setup-python@v4" with: python-version: "${{ matrix.python-version }}" + allow-prereleases: true - name: "Install dependencies" run: | From e0bce92fa394c7c398ab20a4d0a2cffe8caaac02 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Jul 2023 07:42:57 -0400 Subject: [PATCH 15/43] build: test on 3.12 --- .github/workflows/tests.yml | 1 + README.rst | 6 +++--- setup.py | 1 + tox.ini | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee74070..e7f50b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,7 @@ jobs: - "3.9" - "3.10" - "3.11" + - "3.12" fail-fast: false steps: diff --git a/README.rst b/README.rst index 5a68ce0..59bd59f 100644 --- a/README.rst +++ b/README.rst @@ -31,7 +31,7 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. Supported on: -- Python: 3.8 through 3.11. +- Python: 3.8 through 3.12. - Django: 2.x, 3.x and 4.x. @@ -39,7 +39,7 @@ Supported on: The plugin is pip installable:: - $ pip install django_coverage_plugin + $ python3 -m pip install django_coverage_plugin To run it, add this setting to your ``.coveragerc`` file:: @@ -128,7 +128,7 @@ Tests To run the tests:: - $ pip install -r requirements.txt + $ python3 -m pip install -r requirements.txt $ tox diff --git a/setup.py b/setup.py index 99d3863..f4367ae 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ def read(*names, **kwargs): Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 +Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Quality Assurance diff --git a/tox.ini b/tox.ini index 7be8aeb..5c01601 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,7 @@ envlist = py39-django{22,32,42}-cov{6,7,tip}, py310-django{32,42,tip}-cov{6,7,tip}, py311-django{42,tip}-cov{6,7,tip}, + py312-django{tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -76,3 +77,4 @@ python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 From 3e09c0daf3ed70558773baa519c4bf8dc7249a11 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 10 Jul 2023 09:13:51 -0400 Subject: [PATCH 16/43] build: 3.1.0 --- README.rst | 8 ++++++++ setup.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 59bd59f..7ce3fd4 100644 --- a/README.rst +++ b/README.rst @@ -137,6 +137,13 @@ History .. scriv-insert-here +v3.1.0 — 2023-07-10 +------------------- + +Dropped support for Python 3.7 and Django 1.x. Declared support for Python +3.12. + + v3.0.0 — 2022-12-06 ------------------- @@ -148,6 +155,7 @@ v2.0.4 — 2022-10-31 Declare our support for Python 3.11 and Django 4.1. + v2.0.3 — 2022-05-04 ------------------- diff --git a/setup.py b/setup.py index f4367ae..0132d17 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def read(*names, **kwargs): setup( name='django_coverage_plugin', - version='3.0.0', + version='3.1.0', description='Django template coverage.py plugin', long_description=( re.sub( From ca45852f7168d36b69e6a64f01d804b572775680 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 27 Jan 2024 06:33:00 -0500 Subject: [PATCH 17/43] build: ensure tags are signed even if commits are not --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 39992d8..85fc6c6 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ kit_upload: ## Upload the built distributions to PyPI. python -m twine upload --verbose dist/* tag: ## Make a git tag with the version number. - git tag -a -m "Version v$$(python setup.py --version)" v$$(python setup.py --version) + git tag -s -m "Version v$$(python setup.py --version)" v$$(python setup.py --version) git push --all ghrelease: ## Make a GitHub release for the latest version. From b792d7d4102e45d1f31548ef4b0a826ea0d2155e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 28 Oct 2024 10:53:47 -0400 Subject: [PATCH 18/43] update workflow action versions --- .github/workflows/tests.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7f50b7..859e16e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,10 +50,12 @@ jobs: steps: - name: "Check out the repo" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" + with: + persist-credentials: false - name: "Set up Python" - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "${{ matrix.python-version }}" allow-prereleases: true @@ -85,10 +87,12 @@ jobs: steps: - name: "Check out the repo" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" + with: + persist-credentials: false - name: "Set up Python" - uses: "actions/setup-python@v2" + uses: "actions/setup-python@v5" with: python-version: "3.8" From e6bdc06d8993161a55341454bec19623bc836594 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 28 Oct 2024 10:59:33 -0400 Subject: [PATCH 19/43] test: adjust versions tox runs --- tox.ini | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 5c01601..a9217e2 100644 --- a/tox.ini +++ b/tox.ini @@ -14,21 +14,23 @@ [tox] envlist = - py38-django{22,32,42}-cov{6,7,tip}, + py38-django{22,32,42}-cov{6,761}, py39-django{22,32,42}-cov{6,7,tip}, - py310-django{32,42,tip}-cov{6,7,tip}, - py311-django{42,tip}-cov{6,7,tip}, - py312-django{tip}-cov{7,tip}, + py310-django{32,42,51,tip}-cov{6,7,tip}, + py311-django{42,51,tip}-cov{6,7,tip}, + py312-django{51,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] deps = cov6: coverage>=6.0,<7.0 cov7: coverage>=7.0,<8.0 + cov761: coverage==7.6.1 covtip: git+https://github.com/nedbat/coveragepy.git django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django42: Django>=4.2,<5.0 + django51: Django>=5.1,<6.0 djangotip: git+https://github.com/django/django.git pytest unittest-mixins==1.6 From 877b0420a0a0bcfb2a006cc8f409005bd03a10fb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 10 Nov 2024 15:53:41 -0500 Subject: [PATCH 20/43] build: declare django 5.1 compatibility --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 0132d17..f9d3400 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ def read(*names, **kwargs): Framework :: Django :: 2.2 Framework :: Django :: 3.2 Framework :: Django :: 4.2 +Framework :: Django :: 5.1 """ setup( From f4a3aa066b6a14172e9e4239caa3f3f0358a3e45 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 27 Jan 2025 17:05:42 -0500 Subject: [PATCH 21/43] build: django 5.tip dropped 3.10 and 3.11, also test on 3.13 --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index a9217e2..d76449b 100644 --- a/tox.ini +++ b/tox.ini @@ -16,9 +16,10 @@ envlist = py38-django{22,32,42}-cov{6,761}, py39-django{22,32,42}-cov{6,7,tip}, - py310-django{32,42,51,tip}-cov{6,7,tip}, - py311-django{42,51,tip}-cov{6,7,tip}, + py310-django{32,42,51}-cov{6,7,tip}, + py311-django{42,51}-cov{6,7,tip}, py312-django{51,tip}-cov{7,tip}, + py313-django{51,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -80,3 +81,4 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 From 8bf14bcc59303c52898b23ad9b551d29124463ee Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 27 Jan 2025 18:59:11 -0500 Subject: [PATCH 22/43] add 3.13 classifier, and tweak setup.py --- setup.py | 7 ++++--- tox.ini | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index f9d3400..800fbb8 100644 --- a/setup.py +++ b/setup.py @@ -18,10 +18,11 @@ def read(*names, **kwargs): Parameter: encoding kwarg may be set """ - return open( + with open( join(dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8') - ).read() + ) as f: + return f.read() classifiers = """\ @@ -34,13 +35,13 @@ def read(*names, **kwargs): Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 +Programming Language :: Python :: 3.13 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Quality Assurance Topic :: Software Development :: Testing Development Status :: 5 - Production/Stable Framework :: Django -Framework :: Django :: 1.11 Framework :: Django :: 2.2 Framework :: Django :: 3.2 Framework :: Django :: 4.2 diff --git a/tox.ini b/tox.ini index d76449b..f95612c 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ # [tox] +# When changing this, also update the classifiers in setup.py: envlist = py38-django{22,32,42}-cov{6,761}, py39-django{22,32,42}-cov{6,7,tip}, From a1f1d93bccbd495e0d019052a6e411f88f5cbc6f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 27 Jan 2025 19:18:51 -0500 Subject: [PATCH 23/43] drop Python 3.8 --- setup.py | 1 - tox.ini | 3 --- 2 files changed, 4 deletions(-) diff --git a/setup.py b/setup.py index 800fbb8..26e19d3 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ def read(*names, **kwargs): Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: OS Independent -Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 diff --git a/tox.ini b/tox.ini index f95612c..31e67dd 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,6 @@ [tox] # When changing this, also update the classifiers in setup.py: envlist = - py38-django{22,32,42}-cov{6,761}, py39-django{22,32,42}-cov{6,7,tip}, py310-django{32,42,51}-cov{6,7,tip}, py311-django{42,51}-cov{6,7,tip}, @@ -27,7 +26,6 @@ envlist = deps = cov6: coverage>=6.0,<7.0 cov7: coverage>=7.0,<8.0 - cov761: coverage==7.6.1 covtip: git+https://github.com/nedbat/coveragepy.git django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 @@ -77,7 +75,6 @@ commands = [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 From 401654a016a9c8e253b4b72bdd021544b4c714e2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 27 Jan 2025 21:20:47 -0500 Subject: [PATCH 24/43] a few more version fixups --- .github/workflows/tests.yml | 4 ++-- README.rst | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 859e16e..26e2d69 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: python-version: # When changing this list, be sure to check the [gh-actions] list in # tox.ini so that tox will run properly. - - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" fail-fast: false steps: @@ -94,7 +94,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.8" + python-version: "3.9" - name: "Install dependencies" run: | diff --git a/README.rst b/README.rst index 7ce3fd4..7a73396 100644 --- a/README.rst +++ b/README.rst @@ -31,13 +31,13 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. Supported on: -- Python: 3.8 through 3.12. +- Python: 3.9 through 3.13. -- Django: 2.x, 3.x and 4.x. +- Django: 2.x, 3.x, 4.x and 5.x. - Coverage.py: 6.x or higher. -The plugin is pip installable:: +The plugin is pip-installable:: $ python3 -m pip install django_coverage_plugin From 464ff86b0a41abef0629d9a463378fcae08031d2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 27 Jan 2025 21:27:38 -0500 Subject: [PATCH 25/43] build: not sure when rst2html.py became rst2html --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 31e67dd..e8f5b22 100644 --- a/tox.ini +++ b/tox.ini @@ -71,7 +71,7 @@ deps = sphinx commands = - rst2html.py --strict README.rst /tmp/django_coverage_plugin_README.html + rst2html --strict README.rst /tmp/django_coverage_plugin_README.html [gh-actions] python = From 89373eb8b7ffee0110cba1b7314c46789da578d5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 15 Jun 2025 12:31:39 +0100 Subject: [PATCH 26/43] declare official support for Django 5.2 (#103) * test: fix Django 5.1 tox env to not install 5.2 * test: add Django 5.2 to tox runs * build: declare django 5.2 compatibility --- setup.py | 1 + tox.ini | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 26e19d3..ad31d9b 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ def read(*names, **kwargs): Framework :: Django :: 3.2 Framework :: Django :: 4.2 Framework :: Django :: 5.1 +Framework :: Django :: 5.2 """ setup( diff --git a/tox.ini b/tox.ini index e8f5b22..25d6da1 100644 --- a/tox.ini +++ b/tox.ini @@ -16,10 +16,10 @@ # When changing this, also update the classifiers in setup.py: envlist = py39-django{22,32,42}-cov{6,7,tip}, - py310-django{32,42,51}-cov{6,7,tip}, - py311-django{42,51}-cov{6,7,tip}, - py312-django{51,tip}-cov{7,tip}, - py313-django{51,tip}-cov{7,tip}, + py310-django{32,42,51,52}-cov{6,7,tip}, + py311-django{42,51,52}-cov{6,7,tip}, + py312-django{51,52,tip}-cov{7,tip}, + py313-django{51,52,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -30,7 +30,8 @@ deps = django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django42: Django>=4.2,<5.0 - django51: Django>=5.1,<6.0 + django51: Django>=5.1,<5.2 + django52: Django>=5.2,<6.0 djangotip: git+https://github.com/django/django.git pytest unittest-mixins==1.6 From b1c63409590c2688e9ef190896c8bec26f88ac8c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:03:10 -0400 Subject: [PATCH 27/43] no need to mention django 5.1 specifically --- README.rst | 8 ++++---- setup.py | 1 - tox.ini | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 7a73396..10a6c9a 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,8 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. .. |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.2%20%7C%203.2%20%7C%204.1-44b78b.svg +.. the Django badge says: `2.2 | 3.2 | 4.2 | 5.2` +.. |djversions| image:: https://img.shields.io/badge/Django-2.2%20%7C%203.2%20%7C%204.2%20%7C%205.2-44b78b.svg :target: https://pypi.python.org/pypi/django_coverage_plugin :alt: Supported Django Versions @@ -33,7 +34,7 @@ Supported on: - Python: 3.9 through 3.13. -- Django: 2.x, 3.x, 4.x and 5.x. +- Django: 2.2 through 5.2. - Coverage.py: 6.x or higher. @@ -49,8 +50,7 @@ To run it, add this setting to your ``.coveragerc`` file:: Then run your tests under `coverage.py`_. You will see your templates listed in your coverage report along with -your Python modules. Please use `coverage.py`_ v4.4 or greater to allow -the plugin to identify untested templates. +your Python modules. If you get a :code:`django.core.exceptions.ImproperlyConfigured` error, you need to set the :code:`DJANGO_SETTINGS_MODULE` environment variable. diff --git a/setup.py b/setup.py index ad31d9b..aada28d 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,6 @@ def read(*names, **kwargs): Framework :: Django :: 2.2 Framework :: Django :: 3.2 Framework :: Django :: 4.2 -Framework :: Django :: 5.1 Framework :: Django :: 5.2 """ diff --git a/tox.ini b/tox.ini index 25d6da1..ac3f910 100644 --- a/tox.ini +++ b/tox.ini @@ -16,10 +16,10 @@ # When changing this, also update the classifiers in setup.py: envlist = py39-django{22,32,42}-cov{6,7,tip}, - py310-django{32,42,51,52}-cov{6,7,tip}, - py311-django{42,51,52}-cov{6,7,tip}, - py312-django{51,52,tip}-cov{7,tip}, - py313-django{51,52,tip}-cov{7,tip}, + py310-django{32,42,52}-cov{6,7,tip}, + py311-django{42,52}-cov{6,7,tip}, + py312-django{52,tip}-cov{7,tip}, + py313-django{52,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -30,7 +30,6 @@ deps = django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django42: Django>=4.2,<5.0 - django51: Django>=5.1,<5.2 django52: Django>=5.2,<6.0 djangotip: git+https://github.com/django/django.git pytest From 9882b4e235a74fa275f33b880d2d09142f3f4ed7 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:13:22 -0400 Subject: [PATCH 28/43] modern license specification --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index aada28d..97135ee 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ def read(*names, **kwargs): classifiers = """\ Environment :: Console Intended Audience :: Developers -License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 From 0d271c36263a3dfe64347bd327d6466d40c5f565 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:13:46 -0400 Subject: [PATCH 29/43] build: distributions should include more files --- MANIFEST.in | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 74dd042..a38013a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,14 +2,11 @@ # - http://www.apache.org/licenses/LICENSE-2.0 # - https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt -exclude .isort.cfg -exclude howto.txt -exclude Makefile -exclude requirements.txt -exclude tox.ini -exclude .editorconfig -include AUTHORS.txt -include LICENSE.txt -include NOTICE.txt -include README.rst -prune tests +include *.txt +include .editorconfig +include .isort.cfg +include Makefile +include tox.ini + +recursive-include .github * +recursive-include tests *.py From cc7784f576bc63a2a80a5f53d594322c22537cca Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:39:25 -0400 Subject: [PATCH 30/43] docs: keep the change history current --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 10a6c9a..f0d7f44 100644 --- a/README.rst +++ b/README.rst @@ -137,6 +137,12 @@ History .. scriv-insert-here +v3.1.1 — 2025-06-15 +------------------- + +Support changes: dropped Python 3.8, added Python 3.13. Added Django 5.2. + + v3.1.0 — 2023-07-10 ------------------- From 9f7a8561489b2ea3955cd3da5fe3cbd65657d922 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:42:55 -0400 Subject: [PATCH 31/43] build: add testpypi --- Makefile | 3 +++ NOTICE.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 85fc6c6..9eb9755 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,9 @@ kit: ## Make the source distribution. kit_upload: ## Upload the built distributions to PyPI. python -m twine upload --verbose dist/* +test_upload: ## Upload the distrubutions to test PyPI. + python -m twine upload --verbose --repository testpypi dist/* + tag: ## Make a git tag with the version number. git tag -s -m "Version v$$(python setup.py --version)" v$$(python setup.py --version) git push --all diff --git a/NOTICE.txt b/NOTICE.txt index 69e5a4f..7803be8 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,4 +1,4 @@ -Copyright 2015-2022 Ned Batchelder. All rights reserved. +Copyright 2015-2025 Ned Batchelder. All rights reserved. Except where noted otherwise, this software is licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in From 8686b22cacd48e26f130ead4711d34f785db5103 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 08:46:56 -0400 Subject: [PATCH 32/43] try uploading with badges --- setup.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 97135ee..64bb08c 100644 --- a/setup.py +++ b/setup.py @@ -48,15 +48,9 @@ def read(*names, **kwargs): setup( name='django_coverage_plugin', - version='3.1.0', + version='3.1.1rc1', description='Django template coverage.py plugin', - long_description=( - re.sub( - '(?ms)^.. start-badges.*^.. end-badges', - '', - read('README.rst'), - ) - ), + long_description=(read('README.rst')), long_description_content_type='text/x-rst', author='Ned Batchelder', author_email='ned@nedbatchelder.com', From 2cd85c6525b243fd459d36f4ee0ab17d65dd3035 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 09:51:39 -0400 Subject: [PATCH 33/43] build: more-usual make targets --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9eb9755..1e0dc10 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ # Makefile for django_coverage_plugin +.PHONY: help test clean sterile dist pypi test_pypi tag ghrelease + help: ## Show this help. @echo "Available targets:" @grep '^[a-zA-Z]' $(MAKEFILE_LIST) | sort | awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}' @@ -24,18 +26,18 @@ clean: ## Remove non-source files. sterile: clean ## Remove all non-controlled content, even if expensive. -rm -rf .tox* -kit: ## Make the source distribution. +dist: ## Make the source distribution. python -m build python -m twine check dist/* -kit_upload: ## Upload the built distributions to PyPI. +pypi: ## Upload the built distributions to PyPI. python -m twine upload --verbose dist/* -test_upload: ## Upload the distrubutions to test PyPI. - python -m twine upload --verbose --repository testpypi dist/* +test_pypi: ## Upload the distributions to test PyPI. + python -m twine upload --verbose --repository testpypi --password $$TWINE_TEST_PASSWORD dist/* tag: ## Make a git tag with the version number. - git tag -s -m "Version v$$(python setup.py --version)" v$$(python setup.py --version) + git tag -s -m "Version v$$(python -c 'import django_coverage_plugin; print(django_coverage_plugin.__version__)')" v$$(python -c 'import django_coverage_plugin; print(django_coverage_plugin.__version__)') git push --all ghrelease: ## Make a GitHub release for the latest version. From 30856dfe975e4bd47c9532c44ebe7009e0687be1 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 09:52:32 -0400 Subject: [PATCH 34/43] build: move packaging and config to pyproject.toml Thanks, Claude. --- django_coverage_plugin/__init__.py | 2 + pyproject.toml | 65 ++++++++++++++++++++++++++++++ setup.cfg | 14 +------ setup.py | 59 +++------------------------ 4 files changed, 75 insertions(+), 65 deletions(-) create mode 100644 pyproject.toml diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index bac9149..342d45d 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -3,6 +3,8 @@ """Django Template Coverage Plugin""" +__version__ = "3.1.1rc1" + from .plugin import DjangoTemplatePluginException # noqa from .plugin import DjangoTemplatePlugin diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e4fcf77 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt + +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "django_coverage_plugin" +description = "Django template coverage.py plugin" +readme = "README.rst" +authors = [ + {name = "Ned Batchelder", email = "ned@nedbatchelder.com"}, +] +license = "Apache-2.0" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Framework :: Django", + "Framework :: Django :: 2.2", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.2", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", +] +requires-python = ">= 3.9" +dependencies = [ + "coverage", +] +dynamic = ["version"] + +[project.urls] +"Homepage" = "https://github.com/nedbat/django_coverage_plugin" +"Bug Tracker" = "https://github.com/nedbat/django_coverage_plugin/issues" +"Source" = "https://github.com/nedbat/django_coverage_plugin" + +[tool.setuptools.dynamic] +version = {attr = "django_coverage_plugin.__version__"} + +[tool.setuptools.packages.find] +include = ["django_coverage_plugin*"] + +[tool.pytest.ini_options] +# How come these warnings are suppressed successfully here, but not in conftest.py?? +filterwarnings = [ + # ignore all DeprecationWarnings... + "ignore::DeprecationWarning", + # ...but show them if they are from our code. + "default::DeprecationWarning:django_coverage_plugin", +] + +[tool.scriv] +fragment_directory = "scriv.d" +output_file = "README.rst" +rst_header_chars = "-." \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 91522f4..51e49e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,15 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt -[tool:pytest] -# How come these warnings are suppressed successfully here, but not in conftest.py?? -filterwarnings = - # ignore all DeprecationWarnings... - ignore::DeprecationWarning - # ...but show them if they are from our code. - default::DeprecationWarning:django_coverage_plugin - -[scriv] -fragment_directory = scriv.d -output_file = README.rst -rst_header_chars = -. +# Configuration has moved to pyproject.toml +# This file can be removed once migration is complete diff --git a/setup.py b/setup.py index 64bb08c..5591278 100644 --- a/setup.py +++ b/setup.py @@ -5,60 +5,13 @@ - http://www.apache.org/licenses/LICENSE-2.0 - https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +DEPRECATED: This file is kept for backward compatibility. +All configuration has moved to pyproject.toml. +This file can be removed once migration is complete. """ -import re -from os.path import dirname, join - +# For backward compatibility, import from setuptools from setuptools import setup - -def read(*names, **kwargs): - """Read and return contents of file - - Parameter: encoding kwarg may be set - """ - with open( - join(dirname(__file__), *names), - encoding=kwargs.get('encoding', 'utf8') - ) as f: - return f.read() - - -classifiers = """\ -Environment :: Console -Intended Audience :: Developers -Operating System :: OS Independent -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3.11 -Programming Language :: Python :: 3.12 -Programming Language :: Python :: 3.13 -Programming Language :: Python :: Implementation :: CPython -Programming Language :: Python :: Implementation :: PyPy -Topic :: Software Development :: Quality Assurance -Topic :: Software Development :: Testing -Development Status :: 5 - Production/Stable -Framework :: Django -Framework :: Django :: 2.2 -Framework :: Django :: 3.2 -Framework :: Django :: 4.2 -Framework :: Django :: 5.2 -""" - -setup( - name='django_coverage_plugin', - version='3.1.1rc1', - description='Django template coverage.py plugin', - long_description=(read('README.rst')), - long_description_content_type='text/x-rst', - author='Ned Batchelder', - author_email='ned@nedbatchelder.com', - url='https://github.com/nedbat/django_coverage_plugin', - packages=['django_coverage_plugin'], - install_requires=[ - 'coverage', - ], - license='Apache-2.0', - classifiers=classifiers.splitlines(), -) +# All configuration is now in pyproject.toml +setup() From 11c54bceead4ceddbe0fa9d68943307689d2ac7e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 09:56:29 -0400 Subject: [PATCH 35/43] build: remove setup.py and setup.cfg --- django_coverage_plugin/__init__.py | 2 +- howto.txt | 9 +++++---- setup.cfg | 5 ----- setup.py | 17 ----------------- tox.ini | 4 ++-- 5 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index 342d45d..94463a3 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -3,7 +3,7 @@ """Django Template Coverage Plugin""" -__version__ = "3.1.1rc1" +__version__ = "3.1.1rc2" from .plugin import DjangoTemplatePluginException # noqa from .plugin import DjangoTemplatePlugin diff --git a/howto.txt b/howto.txt index f3cdaa8..f0f4bd7 100644 --- a/howto.txt +++ b/howto.txt @@ -1,7 +1,7 @@ * Release checklist -- Version number in setup.py -- Classifiers in setup.py +- Version number in __init__.py +- Classifiers in pyproject.toml https://pypi.python.org/pypi?%3Aaction=list_classifiers eg: Development Status :: 3 - Alpha @@ -9,7 +9,8 @@ - Copyright date in NOTICE.txt - Update README.rst with latest changes - Kits: - $ make clean kit - $ make kit_upload + $ make clean dist + $ make test_pypi + $ make pypi $ make tag $ make ghrelease diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 51e49e5..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt - -# Configuration has moved to pyproject.toml -# This file can be removed once migration is complete diff --git a/setup.py b/setup.py deleted file mode 100644 index 5591278..0000000 --- a/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -"""Setup for Django Coverage Plugin - -Licensed under the Apache 2.0 License -- http://www.apache.org/licenses/LICENSE-2.0 -- https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt - -DEPRECATED: This file is kept for backward compatibility. -All configuration has moved to pyproject.toml. -This file can be removed once migration is complete. -""" - -# For backward compatibility, import from setuptools -from setuptools import setup - -# All configuration is now in pyproject.toml -setup() diff --git a/tox.ini b/tox.ini index ac3f910..caa351b 100644 --- a/tox.ini +++ b/tox.ini @@ -49,8 +49,8 @@ deps = isort commands = - flake8 --max-line-length=100 setup.py django_coverage_plugin tests setup.py - isort --check-only --diff django_coverage_plugin tests setup.py + flake8 --max-line-length=100 django_coverage_plugin tests + isort --check-only --diff django_coverage_plugin tests [testenv:pkgcheck] skip_install = true From 2d727d9c1f0370856c9058261e1fc0cec246d646 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 10:26:28 -0400 Subject: [PATCH 36/43] build: fix a packaging tweak; more badges --- README.rst | 14 ++++++++++---- django_coverage_plugin/__init__.py | 2 +- pyproject.toml | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index f0d7f44..f16497d 100644 --- a/README.rst +++ b/README.rst @@ -4,10 +4,9 @@ Django Template Coverage.py Plugin A `coverage.py`_ plugin to measure test coverage of Django templates. -.. start-badges - | |status| |kit| |license| | |versions| |djversions| +| |sponsor| |bluesky-nedbat| |mastodon-nedbat| .. |status| image:: https://img.shields.io/pypi/status/django_coverage_plugin.svg :target: https://pypi.python.org/pypi/django_coverage_plugin @@ -25,10 +24,17 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. .. |djversions| image:: https://img.shields.io/badge/Django-2.2%20%7C%203.2%20%7C%204.2%20%7C%205.2-44b78b.svg :target: https://pypi.python.org/pypi/django_coverage_plugin :alt: Supported Django Versions +.. |sponsor| image:: https://img.shields.io/badge/%E2%9D%A4-Sponsor%20me-brightgreen?style=flat&logo=GitHub + :target: https://github.com/sponsors/nedbat + :alt: Sponsor me on GitHub +.. |bluesky-nedbat| image:: https://img.shields.io/badge/dynamic/json?style=flat&color=96a3b0&labelColor=3686f7&logo=icloud&logoColor=white&label=@nedbat&url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%3Factor=nedbat.com&query=followersCount + :target: https://bsky.app/profile/nedbat.com + :alt: nedbat on Bluesky +.. |mastodon-nedbat| image:: https://img.shields.io/badge/dynamic/json?style=flat&labelColor=450657&logo=mastodon&logoColor=ffffff&label=@nedbat&query=followers_count&url=https%3A%2F%2Fhachyderm.io%2Fapi%2Fv1%2Faccounts%2Flookup%3Facct=nedbat + :target: https://hachyderm.io/@nedbat + :alt: nedbat on Mastodon ------------------- -.. end-badges Supported on: diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index 94463a3..c14666d 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -3,7 +3,7 @@ """Django Template Coverage Plugin""" -__version__ = "3.1.1rc2" +__version__ = "3.1.1rc3" from .plugin import DjangoTemplatePluginException # noqa from .plugin import DjangoTemplatePlugin diff --git a/pyproject.toml b/pyproject.toml index e4fcf77..dd90c5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools>=77.0", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -18,7 +18,7 @@ classifiers = [ "Environment :: Console", "Framework :: Django", "Framework :: Django :: 2.2", - "Framework :: Django :: 3.2", + "Framework :: Django :: 3.2", "Framework :: Django :: 4.2", "Framework :: Django :: 5.2", "Intended Audience :: Developers", @@ -62,4 +62,4 @@ filterwarnings = [ [tool.scriv] fragment_directory = "scriv.d" output_file = "README.rst" -rst_header_chars = "-." \ No newline at end of file +rst_header_chars = "-." From eb65668bc82f8bfad270ad68ee91af6432743333 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 10:32:18 -0400 Subject: [PATCH 37/43] build: v3.1.1 --- django_coverage_plugin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index c14666d..5fbdef1 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -3,7 +3,7 @@ """Django Template Coverage Plugin""" -__version__ = "3.1.1rc3" +__version__ = "3.1.1" from .plugin import DjangoTemplatePluginException # noqa from .plugin import DjangoTemplatePlugin From 740bbbee7d73c969d24c6e9d5aac68e9735782e5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 11:01:36 -0400 Subject: [PATCH 38/43] build: fix the tagging --- Makefile | 4 +++- requirements.txt | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1e0dc10..6b6ff91 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,10 @@ pypi: ## Upload the built distributions to PyPI. test_pypi: ## Upload the distributions to test PyPI. python -m twine upload --verbose --repository testpypi --password $$TWINE_TEST_PASSWORD dist/* +VERSION := $(shell python -c "import django_coverage_plugin as me; print(me.__version__)") + tag: ## Make a git tag with the version number. - git tag -s -m "Version v$$(python -c 'import django_coverage_plugin; print(django_coverage_plugin.__version__)')" v$$(python -c 'import django_coverage_plugin; print(django_coverage_plugin.__version__)') + git tag -s -m "Version v$(VERSION)" v$(VERSION) git push --all ghrelease: ## Make a GitHub release for the latest version. diff --git a/requirements.txt b/requirements.txt index fbf51ac..7463b6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,7 @@ tox >= 1.8 build scriv twine + +# We need django and coverage to be able to import ourselves to make a tag... +django +coverage From c612c66a6d0a82a158c3ce6f0a172ef8a3cabecf Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Jun 2025 17:14:37 -0400 Subject: [PATCH 39/43] fix: django should be a requirement of ours, and make tagging smoother --- Makefile | 10 ++++++---- pyproject.toml | 1 + requirements.txt | 10 ++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 6b6ff91..18df828 100644 --- a/Makefile +++ b/Makefile @@ -36,11 +36,13 @@ pypi: ## Upload the built distributions to PyPI. test_pypi: ## Upload the distributions to test PyPI. python -m twine upload --verbose --repository testpypi --password $$TWINE_TEST_PASSWORD dist/* -VERSION := $(shell python -c "import django_coverage_plugin as me; print(me.__version__)") +_install_e: + python -m pip install -q -e . -tag: ## Make a git tag with the version number. - git tag -s -m "Version v$(VERSION)" v$(VERSION) - git push --all +tag: _install_e ## Make a git tag with the version number. + @export VER="$$(python -c "import django_coverage_plugin as me; print(me.__version__)")" && \ + echo git tag -s -m "Version v$$VER" v$$VER + echo git push --all ghrelease: ## Make a GitHub release for the latest version. python -m scriv github-release diff --git a/pyproject.toml b/pyproject.toml index dd90c5f..c71bdc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ requires-python = ">= 3.9" dependencies = [ "coverage", + "Django", ] dynamic = ["version"] diff --git a/requirements.txt b/requirements.txt index 7463b6f..fe664e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,7 @@ -# To run tests, we just need tox. -tox >= 1.8 +# To run tests, we just need tox: +tox + +# For releases: build scriv twine - -# We need django and coverage to be able to import ourselves to make a tag... -django -coverage From a24002821f4010fbed130188311b2089200945ee Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 5 Oct 2025 16:05:10 -0400 Subject: [PATCH 40/43] drop Python 3.9, Django 2.2. Add Python 3.14 --- .github/workflows/tests.yml | 4 +-- README.rst | 14 ++++++--- django_coverage_plugin/__init__.py | 2 +- django_coverage_plugin/plugin.py | 47 +++++------------------------- pyproject.toml | 5 ++-- tox.ini | 10 +++++-- 6 files changed, 29 insertions(+), 53 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 26e2d69..4deb5b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: python-version: # When changing this list, be sure to check the [gh-actions] list in # tox.ini so that tox will run properly. - - "3.9" - "3.10" - "3.11" - "3.12" - "3.13" + - "3.14" fail-fast: false steps: @@ -94,7 +94,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.9" + python-version: "3.10" - name: "Install dependencies" run: | diff --git a/README.rst b/README.rst index f16497d..b735872 100644 --- a/README.rst +++ b/README.rst @@ -20,8 +20,8 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. .. |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 -.. the Django badge says: `2.2 | 3.2 | 4.2 | 5.2` -.. |djversions| image:: https://img.shields.io/badge/Django-2.2%20%7C%203.2%20%7C%204.2%20%7C%205.2-44b78b.svg +.. the Django badge says: `3.2 | 4.2 | 5.2` +.. |djversions| image:: https://img.shields.io/badge/Django-3.2%20%7C%204.2%20%7C%205.2-44b78b.svg :target: https://pypi.python.org/pypi/django_coverage_plugin :alt: Supported Django Versions .. |sponsor| image:: https://img.shields.io/badge/%E2%9D%A4-Sponsor%20me-brightgreen?style=flat&logo=GitHub @@ -38,9 +38,9 @@ A `coverage.py`_ plugin to measure test coverage of Django templates. Supported on: -- Python: 3.9 through 3.13. +- Python: 3.10 through 3.14. -- Django: 2.2 through 5.2. +- Django: 3.2 through 5.2. - Coverage.py: 6.x or higher. @@ -143,6 +143,12 @@ History .. scriv-insert-here +v3.2.0 — 2025-10-05 +------------------- + +Drop Python 3.9 and Django 2.2. Add Python 3.14. + + v3.1.1 — 2025-06-15 ------------------- diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index 5fbdef1..a427ff8 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -3,7 +3,7 @@ """Django Template Coverage Plugin""" -__version__ = "3.1.1" +__version__ = "3.2.0" from .plugin import DjangoTemplatePluginException # noqa from .plugin import DjangoTemplatePlugin diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index 158ee9a..b97a5a7 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -6,41 +6,14 @@ import os.path import re -try: - from coverage.exceptions import NoSource -except ImportError: - # for coverage 5.x - from coverage.misc import NoSource import coverage.plugin import django import django.template -from django.template.base import Lexer, NodeList, Template, TextNode +from coverage.exceptions import NoSource +from django.template.base import Lexer, NodeList, Template, TextNode, TokenType from django.template.defaulttags import VerbatimNode from django.templatetags.i18n import BlockTranslateNode -try: - from django.template.base import TokenType - - def _token_name(token_type): - token_type.name.capitalize() - -except ImportError: - # Django <2.1 uses separate constants for token types - from django.template.base import ( - TOKEN_BLOCK, - TOKEN_MAPPING, - TOKEN_TEXT, - TOKEN_VAR, - ) - - class TokenType: - TEXT = TOKEN_TEXT - VAR = TOKEN_VAR - BLOCK = TOKEN_BLOCK - - def _token_name(token_type): - return TOKEN_MAPPING[token_type] - class DjangoTemplatePluginException(Exception): """Used for any errors from the plugin itself.""" @@ -96,8 +69,8 @@ def check_debug(): return True -if django.VERSION < (2, 0): - raise RuntimeError("Django Coverage Plugin requires Django 2.x or higher") +if django.VERSION < (3, 0): + raise RuntimeError("Django Coverage Plugin requires Django 3.x or higher") # Since we are grabbing at internal details, we have to adapt as they @@ -129,14 +102,8 @@ def read_template_source(filename): if not settings.configured: 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: - charset = settings.FILE_CHARSET - text = f.read().decode(charset) + with open(filename, "r", encoding="utf-8") as f: + text = f.read() return text @@ -326,7 +293,7 @@ def lines(self): if SHOW_PARSING: print( "%10s %2d: %r" % ( - _token_name(token.token_type), + token.token_type.capitalize(), token.lineno, token.contents, ) diff --git a/pyproject.toml b/pyproject.toml index c71bdc9..9b4d29b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,23 +17,22 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Framework :: Django", - "Framework :: Django :: 2.2", "Framework :: Django :: 3.2", "Framework :: Django :: 4.2", "Framework :: Django :: 5.2", "Intended Audience :: Developers", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", ] -requires-python = ">= 3.9" +requires-python = ">= 3.10" dependencies = [ "coverage", "Django", diff --git a/tox.ini b/tox.ini index caa351b..08e6683 100644 --- a/tox.ini +++ b/tox.ini @@ -15,11 +15,11 @@ [tox] # When changing this, also update the classifiers in setup.py: envlist = - py39-django{22,32,42}-cov{6,7,tip}, py310-django{32,42,52}-cov{6,7,tip}, py311-django{42,52}-cov{6,7,tip}, py312-django{52,tip}-cov{7,tip}, py313-django{52,tip}-cov{7,tip}, + py314-django{52,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -27,7 +27,6 @@ deps = cov6: coverage>=6.0,<7.0 cov7: coverage>=7.0,<8.0 covtip: git+https://github.com/nedbat/coveragepy.git - django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 django42: Django>=4.2,<5.0 django52: Django>=5.2,<6.0 @@ -43,6 +42,11 @@ usedevelop = True passenv = * +setenv = + # In later versions of Python, the default coverage.py core is sysmon, + # which doesn't support plugins like us. Force ctrace instead. + py3{12,13,14}: COVERAGE_CORE=ctrace + [testenv:check] deps = flake8 @@ -75,8 +79,8 @@ commands = [gh-actions] python = - 3.9: py39 3.10: py310 3.11: py311 3.12: py312 3.13: py313 + 3.14: py314 From 1c5100c1b818b02c0e6f2465beff932c30981a0f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 5 Oct 2025 18:44:14 -0400 Subject: [PATCH 41/43] fix 'make tag' --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 18df828..65eee1e 100644 --- a/Makefile +++ b/Makefile @@ -41,8 +41,8 @@ _install_e: tag: _install_e ## Make a git tag with the version number. @export VER="$$(python -c "import django_coverage_plugin as me; print(me.__version__)")" && \ - echo git tag -s -m "Version v$$VER" v$$VER - echo git push --all + git tag -s -m "Version v$$VER" v$$VER + git push --all ghrelease: ## Make a GitHub release for the latest version. python -m scriv github-release From 544a761f298baeecf94ce37813ed088a1a09c6cf Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Nov 2025 11:41:09 -0500 Subject: [PATCH 42/43] docs: update license notice to new location --- .editorconfig | 2 +- MANIFEST.in | 2 +- Makefile | 2 +- django_coverage_plugin/__init__.py | 2 +- django_coverage_plugin/plugin.py | 2 +- pyproject.toml | 2 +- tests/__init__.py | 2 +- tests/banner.py | 2 +- tests/conftest.py | 2 +- tests/plugin_test.py | 2 +- tests/test_engines.py | 2 +- tests/test_extends.py | 2 +- tests/test_flow.py | 2 +- tests/test_helpers.py | 2 +- tests/test_html.py | 2 +- tests/test_i18n.py | 2 +- tests/test_settings.py | 2 +- tests/test_simple.py | 2 +- tests/test_source.py | 2 +- tox.ini | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.editorconfig b/.editorconfig index 88200b6..6e7851e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt # This file is for unifying the coding style for different editors and IDEs. # More information at http://EditorConfig.org diff --git a/MANIFEST.in b/MANIFEST.in index a38013a..b220a56 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ # Licensed under the Apache 2.0 License # - http://www.apache.org/licenses/LICENSE-2.0 -# - https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# - https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt include *.txt include .editorconfig diff --git a/Makefile b/Makefile index 65eee1e..8d302f0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt # Makefile for django_coverage_plugin diff --git a/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index a427ff8..f346811 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Django Template Coverage Plugin""" diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index b97a5a7..13e9c41 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """The Django template coverage plugin.""" diff --git a/pyproject.toml b/pyproject.toml index 9b4d29b..6bc35c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt [build-system] requires = ["setuptools>=77.0", "wheel"] diff --git a/tests/__init__.py b/tests/__init__.py index 2d2b590..d4318d5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """The tests for the Django Coverage Plugin.""" diff --git a/tests/banner.py b/tests/banner.py index ff6e7aa..8200b15 100644 --- a/tests/banner.py +++ b/tests/banner.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """For printing the versions from tox.ini.""" diff --git a/tests/conftest.py b/tests/conftest.py index 0852e87..5c8f6d7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """ Pytest auto configuration. diff --git a/tests/plugin_test.py b/tests/plugin_test.py index cc90be8..f103454 100644 --- a/tests/plugin_test.py +++ b/tests/plugin_test.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Base classes and helpers for testing the plugin.""" diff --git a/tests/test_engines.py b/tests/test_engines.py index fdaa2ca..3bdbe32 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of multiple engines for django_coverage_plugin.""" diff --git a/tests/test_extends.py b/tests/test_extends.py index 4b3df69..3f7a987 100644 --- a/tests/test_extends.py +++ b/tests/test_extends.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of template inheritance for django_coverage_plugin.""" diff --git a/tests/test_flow.py b/tests/test_flow.py index 2a00709..db83fa8 100644 --- a/tests/test_flow.py +++ b/tests/test_flow.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of control-flow structures for django_coverage_plugin.""" diff --git a/tests/test_helpers.py b/tests/test_helpers.py index d0e919c..467d879 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Test helpers for the django coverage plugin.""" diff --git a/tests/test_html.py b/tests/test_html.py index 5038468..b71537b 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of HTML reporting for django_coverage_plugin.""" diff --git a/tests/test_i18n.py b/tests/test_i18n.py index e68b920..40affec 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of i18n tags for django_coverage_plugin.""" diff --git a/tests/test_settings.py b/tests/test_settings.py index 4be1636..5314051 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Settings tests for django_coverage_plugin.""" diff --git a/tests/test_simple.py b/tests/test_simple.py index a09ecb7..c4e326d 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Simple tests for django_coverage_plugin.""" diff --git a/tests/test_source.py b/tests/test_source.py index 6313504..e44c7ea 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt """Tests of template inheritance for django_coverage_plugin.""" diff --git a/tox.ini b/tox.ini index 08e6683..1aae1d5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt +# For details: https://github.com/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt # tox configuration for django_coverage_plugin. # From 0bfaf9800748d8aa0b37be91c1f98637af0efadb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Nov 2025 11:43:04 -0500 Subject: [PATCH 43/43] update to new repo location --- README.rst | 18 +++++++++--------- pyproject.toml | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index b735872..d6ef68f 100644 --- a/README.rst +++ b/README.rst @@ -191,7 +191,7 @@ ignore_errors=True`` (`issue 78`_). When using ``source=.``, an existing coverage HTML report directory would be found and believed to be unmeasured HTML template files. This is now fixed. -.. _issue 78: https://github.com/nedbat/django_coverage_plugin/issues/78 +.. _issue 78: https://github.com/coveragepy/django_coverage_plugin/issues/78 v2.0.1 — 2021-10-06 @@ -214,9 +214,9 @@ case-sensitively, causing templates to be missed (`issue 46`_). Fix an issue (`issue 63`_) where tag libraries can't be found if imported during test collection. Thanks to Daniel Izquierdo for the fix. -.. _issue 46: https://github.com/nedbat/django_coverage_plugin/issues/46 -.. _issue 60: https://github.com/nedbat/django_coverage_plugin/issues/60 -.. _issue 63: https://github.com/nedbat/django_coverage_plugin/issues/63 +.. _issue 46: https://github.com/coveragepy/django_coverage_plugin/issues/46 +.. _issue 60: https://github.com/coveragepy/django_coverage_plugin/issues/60 +.. _issue 63: https://github.com/coveragepy/django_coverage_plugin/issues/63 v1.8.0 — 2020-01-23 ------------------- @@ -266,7 +266,7 @@ v1.4.2 — 2017-02-06 Fixes another instance of `issue 32`_, which was the result of an initialization order problem. -.. _issue 32: https://github.com/nedbat/django_coverage_plugin/issues/32 +.. _issue 32: https://github.com/coveragepy/django_coverage_plugin/issues/32 v1.4.1 — 2017-01-25 @@ -288,8 +288,8 @@ Only the ``django.template.backends.django.DjangoTemplates`` template engine is supported, and it must be configured with ``['OPTIONS']['debug'] = True``. Fixes `issue 27`_. -.. _issue 28: https://github.com/nedbat/django_coverage_plugin/issues/28 -.. _issue 27: https://github.com/nedbat/django_coverage_plugin/issues/27 +.. _issue 28: https://github.com/coveragepy/django_coverage_plugin/issues/28 +.. _issue 27: https://github.com/coveragepy/django_coverage_plugin/issues/27 @@ -299,7 +299,7 @@ v1.3.1 — 2016-06-02 Settings are read slightly differently, so as to not interfere with programs that don't need settings. Fixes `issue 18`_. -.. _issue 18: https://github.com/nedbat/django_coverage_plugin/issues/18 +.. _issue 18: https://github.com/coveragepy/django_coverage_plugin/issues/18 @@ -335,7 +335,7 @@ plugin, and fixes `issue 17`_. Potential Django 1.9 support is included, but the patch to Django hasn't been applied yet. -.. _issue 17: https://github.com/nedbat/django_coverage_plugin/issues/17 +.. _issue 17: https://github.com/coveragepy/django_coverage_plugin/issues/17 diff --git a/pyproject.toml b/pyproject.toml index 6bc35c3..0c7292f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,9 +40,9 @@ dependencies = [ dynamic = ["version"] [project.urls] -"Homepage" = "https://github.com/nedbat/django_coverage_plugin" -"Bug Tracker" = "https://github.com/nedbat/django_coverage_plugin/issues" -"Source" = "https://github.com/nedbat/django_coverage_plugin" +"Homepage" = "https://github.com/coveragepy/django_coverage_plugin" +"Bug Tracker" = "https://github.com/coveragepy/django_coverage_plugin/issues" +"Source" = "https://github.com/coveragepy/django_coverage_plugin" [tool.setuptools.dynamic] version = {attr = "django_coverage_plugin.__version__"}