From 0e69cffe99f3dc697fd3a10b0db7903682dbd578 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 7 Dec 2023 08:55:46 +0100 Subject: [PATCH] Update supported Python and Django versions --- .github/workflows/test.yml | 22 ++++++++++++---------- CHANGELOG.rst | 4 +++- README.rst | 2 +- setup.py | 7 ++++--- tests/test_compressor.py | 4 ++-- tests/test_views.py | 2 +- tox.ini | 16 ++++++++++------ 7 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 754646e2..44fcb6fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,21 +10,23 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] - django-version: ['3.2', '4.0', '4.1', 'main'] + python-version: ['3.8', '3.11', '3.12'] + django-version: ['3.2', '4.2', '5.0', 'main'] exclude: - - python-version: 3.7 - django-version: 4.0 - - python-version: 3.7 - django-version: 4.1 - - python-version: 3.7 + - python-version: 3.8 + django-version: 5.0 + - python-version: 3.8 django-version: main + - python-version: 3.11 + django-version: 3.2 + - python-version: 3.12 + django-version: 3.2 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -54,6 +56,6 @@ jobs: DJANGO: ${{ matrix.django-version }} - name: Upload coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: name: Python ${{ matrix.python-version }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b41d4e6d..2a0f2055 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,9 @@ This document describes changes between each past release. Unreleased ========== -- Drop support for Django 2.2. +- Drop support for Django 2.2, 4.0, and 4.1. +- Add support for Django 4.2 and 5.0. +- Drop support for Python 3.7 and add support for Python 3.11 and 3.12. 3.6.1 (2023-03-20) ================== diff --git a/README.rst b/README.rst index dbd053e4..efda0ebd 100644 --- a/README.rst +++ b/README.rst @@ -71,7 +71,7 @@ In your code: Releases ======== -Latest release is 3.6.1. It supports Python 3.7+ and Django 3.2 to 4.1. +Latest release is 3.6.1. It supports Python 3.8+ and Django 3.2 to 5.0. Using TinyMCE 5.10.7. diff --git a/setup.py b/setup.py index ae249382..8423b0a6 100755 --- a/setup.py +++ b/setup.py @@ -38,17 +38,18 @@ def read_file(filename): "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", - "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "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", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", ], diff --git a/tests/test_compressor.py b/tests/test_compressor.py index ea52a76f..2b2eea06 100644 --- a/tests/test_compressor.py +++ b/tests/test_compressor.py @@ -31,7 +31,7 @@ def test_cache_data_etag(self, cache_mock): self.assertEqual("0", response["Content-Length"]) self.assertEqual("text/javascript", response["Content-Type"]) self.assertEqual(b"", response.content) - self.assertTrue(cache_mock.called_once) + cache_mock.assert_called_once() @patch("tinymce.compressor.cache.get") def test_cache_data_last_modified(self, cache_mock): @@ -46,7 +46,7 @@ def test_cache_data_last_modified(self, cache_mock): self.assertEqual("0", response["Content-Length"]) self.assertEqual("text/javascript", response["Content-Type"]) self.assertEqual(b"", response.content) - self.assertTrue(cache_mock.called_once) + cache_mock.assert_called_once() def test_compressor(self): request = self.factory.get( diff --git a/tests/test_views.py b/tests/test_views.py index f8001502..0062486a 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -121,7 +121,7 @@ def test_compressor(self, gzip_mock): self.assertEqual(200, response.status_code) self.assertEqual("text/javascript", response["Content-Type"]) self.assertEqual(response_ok.content, response.content) - self.assertTrue(gzip_mock.called_once) + gzip_mock.assert_called_once() def test_render_to_image_list(self): response = render_to_image_list([("test", "test.jpg")]) diff --git a/tox.ini b/tox.ini index 9ab764bf..21ae329f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = - py{37,38,39,310}-dj32 - py{38,39,310}-dj{40,41,main} + py{38,39,310}-dj32 + py{38,39,310,311,312}-dj42 + py{310,311,312}-dj{50,main} flake8 [testenv] @@ -9,6 +10,8 @@ deps = dj32: Django>=3.2,<4.0 dj40: Django>=4.0,<4.1 dj41: Django>=4.1,<4.2 + dj42: Django>=4.2,<5.0 + dj50: Django>=5.0,<5.1 djmain: https://github.com/django/django/archive/main.tar.gz coverage pyenchant @@ -32,14 +35,15 @@ commands = [gh-actions] python = - 3.7: py37, flake8 - 3.8: py38 + 3.8: py38, flake8 3.9: py39 3.10: py310 + 3.11: py311 + 3.12: py312 [gh-actions:env] DJANGO = 3.2: dj32 - 4.0: dj40 - 4.1: dj41 + 4.2: dj42 + 5.0: dj50 main: djmain