From 9ac10e79f720d264a7e72aea069ab036d4a22749 Mon Sep 17 00:00:00 2001 From: Vipul Narang Date: Mon, 11 Mar 2024 17:03:24 +0530 Subject: [PATCH] django 42 upgrade --- .github/workflows/test.yml | 4 ++-- .pre-commit-config.yaml | 4 ++-- tests/requirements/{django-2.2.txt => django-4.2.txt} | 2 +- tests/requirements/requirements_base.txt | 2 +- tests/test_app/admin.py | 2 +- tox.ini | 7 +++---- 6 files changed, 10 insertions(+), 11 deletions(-) rename tests/requirements/{django-2.2.txt => django-4.2.txt} (59%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb0a602fc..8c77da7c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,9 +8,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.7, 3.8, 3.9, ] # latest release minus two + python-version: [ 3.8, 3.9, '3.10' ] # latest release minus two requirements-file: [ - django-2.2.txt, + django-4.2.txt, django-3.2.txt, ] os: [ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8ea710283..8f20ee253 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,10 +6,10 @@ repos: args: ["--py37-plus"] - repo: https://github.com/adamchainz/django-upgrade - rev: '1.4.0' + rev: '' hooks: - id: django-upgrade - args: [--target-version, "2.2"] + args: [--target-version, "4.2"] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 diff --git a/tests/requirements/django-2.2.txt b/tests/requirements/django-4.2.txt similarity index 59% rename from tests/requirements/django-2.2.txt rename to tests/requirements/django-4.2.txt index 63c04996a..33804ceb2 100644 --- a/tests/requirements/django-2.2.txt +++ b/tests/requirements/django-4.2.txt @@ -1,2 +1,2 @@ -r requirements_base.txt -Django>=2.2,<3.0 +Django>=4.2,<5.0 diff --git a/tests/requirements/requirements_base.txt b/tests/requirements/requirements_base.txt index c4efebe4d..aafe1fe13 100644 --- a/tests/requirements/requirements_base.txt +++ b/tests/requirements/requirements_base.txt @@ -8,7 +8,7 @@ html5lib>=0.999999999 Pillow tox -https://github.com/django-cms/django-cms/tarball/develop-4#egg=django-cms +https://github.com/django-cms/django-cms/tarball/release/4.0.1.x#egg=django-cms # IMPORTANT: latest easy-thumbnails causes error since it returns with floating point, but the tests are not prepared for this and even the lib easy-thumbnails diff --git a/tests/test_app/admin.py b/tests/test_app/admin.py index 6bfd458a5..e30cdcf4d 100644 --- a/tests/test_app/admin.py +++ b/tests/test_app/admin.py @@ -8,6 +8,7 @@ class ToppingInlineAdmin(admin.TabularInline): extra = 1 +@admin.register(Pizza) class PizzaAdmin(admin.ModelAdmin): fieldsets = ( ('', { @@ -23,4 +24,3 @@ class PizzaAdmin(admin.ModelAdmin): inlines = [ToppingInlineAdmin] -admin.site.register(Pizza, PizzaAdmin) diff --git a/tox.ini b/tox.ini index f6b72bf31..6f1a6fc49 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = flake8 isort frontend - py{35,36,37,38}-dj{111,21,22}-cms40 + py{37,38,310}-dj{32,42}-cms40 skip_missing_interpreters=True @@ -11,9 +11,8 @@ skip_missing_interpreters=True deps = -r{toxinidir}/tests/requirements/requirements_base.txt - dj111: Django>=1.11,<2.0 - dj21: Django>=2.1,<2.2 - dj22: Django>=2.2,<3.0 + dj32: Django>=3.2,<4.0 + dj42: Django>=4.2,<5.0 cms40: https://github.com/divio/django-cms/archive/release/4.0.x.zip