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/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f1566d8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +# From: +# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot +# Set update schedule for GitHub Actions + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions once a week + interval: "weekly" + day: "sunday" + cooldown: + # https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns + default-days: 7 + groups: + action-dependencies: + patterns: + - "*" + commit-message: + prefix: "chore" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7f50b7..e164594 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,19 +41,21 @@ 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" + - "3.14" fail-fast: false steps: - name: "Check out the repo" - uses: "actions/checkout@v3" + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: "Set up Python" - uses: "actions/setup-python@v4" + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "${{ matrix.python-version }}" allow-prereleases: true @@ -85,12 +87,14 @@ jobs: steps: - name: "Check out the repo" - uses: "actions/checkout@v2" + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: "Set up Python" - uses: "actions/setup-python@v2" + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: - python-version: "3.8" + python-version: "3.10" - name: "Install dependencies" run: | diff --git a/MANIFEST.in b/MANIFEST.in index 74dd042..b220a56 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,15 +1,12 @@ # 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 -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 diff --git a/Makefile b/Makefile index 85fc6c6..8d302f0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ # 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 +.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,15 +26,22 @@ 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/* -tag: ## Make a git tag with the version number. - git tag -s -m "Version v$$(python setup.py --version)" v$$(python setup.py --version) +test_pypi: ## Upload the distributions to test PyPI. + python -m twine upload --verbose --repository testpypi --password $$TWINE_TEST_PASSWORD dist/* + +_install_e: + python -m pip install -q -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__)")" && \ + git tag -s -m "Version v$$VER" v$$VER git push --all ghrelease: ## Make a GitHub release for the latest version. 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 diff --git a/README.rst b/README.rst index 7801649..559269c 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 @@ -21,23 +20,31 @@ 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: `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 + :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: -- Python: 3.8 through 3.12. +- Python: 3.10 through 3.14. -- Django: 2.x, 3.x and 4.x. +- Django: 3.2 through 5.2. - Coverage.py: 6.x or higher. -The plugin is pip installable:: +The plugin is pip-installable:: $ python3 -m pip install django_coverage_plugin @@ -49,8 +56,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. @@ -137,6 +143,18 @@ 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 +------------------- + +Support changes: dropped Python 3.8, added Python 3.13. Added Django 5.2. + + v3.1.0 — 2023-07-10 ------------------- @@ -173,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 @@ -196,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 ------------------- @@ -248,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 @@ -270,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 @@ -281,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 @@ -317,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/django_coverage_plugin/__init__.py b/django_coverage_plugin/__init__.py index bac9149..f346811 100644 --- a/django_coverage_plugin/__init__.py +++ b/django_coverage_plugin/__init__.py @@ -1,8 +1,10 @@ # 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""" +__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 51a92e2..5e30f64 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.""" @@ -7,42 +7,14 @@ import re from coverage.misc import join_regex - -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.""" @@ -98,8 +70,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 @@ -131,14 +103,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 @@ -151,7 +117,9 @@ class DjangoTemplatePlugin( def __init__(self, options): extensions = options.get("template_extensions", "html,htm,txt") self.extensions = [e.strip() for e in extensions.split(",")] - + + self.exclude_blocks = options.get("exclude_blocks") + self.exclude_blocks = options.get("exclude_blocks") self.debug_checked = False @@ -336,7 +304,7 @@ def lines(self): if SHOW_PARSING: print( "%10s %2d: %r" % ( - _token_name(token.token_type), + token.token_type.capitalize(), token.lineno, token.contents, ) @@ -361,7 +329,13 @@ def lines(self): # In an inheriting template, ignore all tags outside of # blocks. continue - + + # Ignore any block token content that has been explcitly + # excluded in config + if self.exclude_block_token(token): + self._excluded.add(token.lineno) + continue + # Ignore any block token content that has been explcitly # excluded in config if self.exclude_block_token(token): @@ -412,6 +386,7 @@ def exclude_block_token(self, token): if self.exclude_blocks_regex: return self.exclude_blocks_regex.search(token.contents) + def running_sum(seq): total = 0 for num in seq: 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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0c7292f --- /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/coveragepy/django_coverage_plugin/blob/main/NOTICE.txt + +[build-system] +requires = ["setuptools>=77.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 :: 3.2", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.2", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "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.10" +dependencies = [ + "coverage", + "Django", +] +dynamic = ["version"] + +[project.urls] +"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__"} + +[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 = "-." diff --git a/requirements.txt b/requirements.txt index fbf51ac..fe664e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +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 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 91522f4..0000000 --- a/setup.cfg +++ /dev/null @@ -1,15 +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 - -[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 = -. diff --git a/setup.py b/setup.py deleted file mode 100644 index 0132d17..0000000 --- a/setup.py +++ /dev/null @@ -1,70 +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 - -""" - -import re -from os.path import dirname, join - -from setuptools import setup - - -def read(*names, **kwargs): - """Read and return contents of file - - Parameter: encoding kwarg may be set - """ - return open( - join(dirname(__file__), *names), - encoding=kwargs.get('encoding', 'utf8') - ).read() - - -classifiers = """\ -Environment :: Console -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 -Programming Language :: Python :: 3.12 -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 -""" - -setup( - name='django_coverage_plugin', - version='3.1.0', - description='Django template coverage.py plugin', - long_description=( - re.sub( - '(?ms)^.. start-badges.*^.. end-badges', - '', - 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(), -) 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 1034b25..ccb3e84 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.""" @@ -287,7 +287,7 @@ def test_exclude_block(self): [django_coverage_plugin] exclude_blocks = [".+foo.+"] """) - + text = self.run_django_coverage() self.assertEqual(text, "First\n\n bar\n\nLast\n") self.assert_analysis([1, 3, 5]) 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 5c01601..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. # @@ -13,12 +13,13 @@ # [tox] +# When changing this, also update the classifiers in setup.py: envlist = - 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}, - py312-django{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}, + py314-django{52,tip}-cov{7,tip}, check,pkgcheck,doc [testenv] @@ -26,9 +27,9 @@ 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 djangotip: git+https://github.com/django/django.git pytest unittest-mixins==1.6 @@ -41,14 +42,19 @@ 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 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 @@ -69,12 +75,12 @@ 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 = - 3.8: py38 - 3.9: py39 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 + 3.14: py314