From dbd61f5583230247a62102ef222eca5768b437d8 Mon Sep 17 00:00:00 2001 From: Aiky30 Date: Tue, 10 May 2022 15:54:12 +0100 Subject: [PATCH] feat: django-cms 4.0.x - django 3.2 and Python 3.9 compatibility (#92) --- .github/workflows/test.yml | 4 ++-- .pre-commit-config.yaml | 11 +++++------ CHANGELOG.rst | 6 ++++++ setup.py | 5 ++--- tests/requirements/base.txt | 12 ++++++++---- tests/requirements/dj11_cms40.txt | 4 ---- tests/requirements/dj22_cms40.txt | 2 -- tests/requirements/dj32_cms40.txt | 3 +++ tests/settings.py | 2 ++ 9 files changed, 28 insertions(+), 21 deletions(-) delete mode 100644 tests/requirements/dj11_cms40.txt create mode 100644 tests/requirements/dj32_cms40.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3bf1414..5804387b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,10 +8,10 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.6, 3.7, ] + python-version: [ 3.7, 3.8, 3.9 ] requirements-file: [ - dj11_cms40.txt, dj22_cms40.txt, + dj32_cms40.txt, ] os: [ ubuntu-20.04, diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37516d4a..8f6f84b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,12 +6,11 @@ repos: # - id: pyupgrade # args: ["--py37-plus"] # -# FIXME: Should be enabled for codebases that are minimum django 2.2+ -# - repo: https://github.com/adamchainz/django-upgrade -# rev: '1.4.0' -# hooks: -# - id: django-upgrade -# args: [--target-version, "2.2"] + - repo: https://github.com/adamchainz/django-upgrade + rev: '1.4.0' + hooks: + - id: django-upgrade + args: [--target-version, "2.2"] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dd7ab2f3..95ed4692 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,9 +4,15 @@ Changelog Unreleased ========== + +* Python 3.8, 3.9 support added +* Django 3.0, 3.1 and 3.2 support added +* Python 3.5 and 3.6 support removed +* Django 1.11 support removed * port-feat: pre-commit config added from the v3 workstream * fix: Added test coverage to admin preview view + 4.0.0.dev4 (2022-02-03) ======================= diff --git a/setup.py b/setup.py index 08ee8285..e466fb92 100644 --- a/setup.py +++ b/setup.py @@ -18,17 +18,16 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Framework :: Django', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', 'Framework :: Django :: 3.1', + 'Framework :: Django :: 3.2', 'Framework :: Django CMS', - 'Framework :: Django CMS :: 3.7', - 'Framework :: Django CMS :: 3.8', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', diff --git a/tests/requirements/base.txt b/tests/requirements/base.txt index 2ea5f4f9..96a6f304 100644 --- a/tests/requirements/base.txt +++ b/tests/requirements/base.txt @@ -1,6 +1,10 @@ -django-app-helper -tox coverage -isort -flake8 +django-app-helper factory-boy +flake8 +isort +tox + +# Unreleased django-cms 4.0 compatible packages +https://github.com/django-cms/django-cms/tarball/develop-4#egg=django-cms +https://github.com/django-cms/djangocms-versioning/tarball/master#egg=djangocms-versioning diff --git a/tests/requirements/dj11_cms40.txt b/tests/requirements/dj11_cms40.txt deleted file mode 100644 index 4c9d6c95..00000000 --- a/tests/requirements/dj11_cms40.txt +++ /dev/null @@ -1,4 +0,0 @@ --r base.txt - -https://github.com/django-cms/django-cms/tarball/release/4.0.x#egg=django-cms -https://github.com/divio/djangocms-versioning/tarball/master/#egg=djangocms-versioning diff --git a/tests/requirements/dj22_cms40.txt b/tests/requirements/dj22_cms40.txt index c84c4174..2f04bac0 100644 --- a/tests/requirements/dj22_cms40.txt +++ b/tests/requirements/dj22_cms40.txt @@ -1,5 +1,3 @@ -r base.txt Django>=2.2,<3.0 -https://github.com/django-cms/django-cms/tarball/release/4.0.x#egg=django-cms -https://github.com/divio/djangocms-versioning/tarball/master/#egg=djangocms-versioning diff --git a/tests/requirements/dj32_cms40.txt b/tests/requirements/dj32_cms40.txt new file mode 100644 index 00000000..7526db15 --- /dev/null +++ b/tests/requirements/dj32_cms40.txt @@ -0,0 +1,3 @@ +-r base.txt + +Django>=3.2,<4.0 diff --git a/tests/settings.py b/tests/settings.py index 60b52c6d..c5ec3774 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -1,5 +1,6 @@ #!/usr/bin/env python HELPER_SETTINGS = { + 'SECRET_KEY': "djangocmssnippetstestsuitekey", 'INSTALLED_APPS': [ 'tests.utils', 'djangocms_versioning', @@ -18,6 +19,7 @@ 'CMS_TEMPLATES': ( ("page.html", "Normal page"), ), + "DEFAULT_AUTO_FIELD": "django.db.models.AutoField", }