Sfoglia il codice sorgente

Bump dependencies and tests for Wagtail 6.3 Python 3.13 (#655)

No code changes required.

Note: since Wagtail 6.3 made some changes to the base media models, our
pro template is designed to work with Wagtail 6.3 out of the box. If you
are starting a new pro project with an earlier version of wagtail, it
will require clearing and re-generating the migrations. I think this is
an acceptable tradeoff rather than holding back on 6.3, since the
template is only used when creating new projects.

* Bump icalendar to 6.0
* Bump django-bootstrap5 to 24.3
* Update release pipeline to test on Python 3.13 and latest version of
wagtail.
* Remove python 3.8 from pipeline.
Vince Salvino 4 mesi fa
parent
commit
70af62655b

+ 14 - 14
azure-pipelines.yml

@@ -27,29 +27,29 @@ stages:
       vmImage: 'ubuntu-latest'
     strategy:
       matrix:
-        py3.8:
-          PYTHON_VERSION: '3.8'
-          WAGTAIL_VERSION: '6.0.*'
-          TEMPLATE: 'basic'
         py3.9:
           PYTHON_VERSION: '3.9'
-          WAGTAIL_VERSION: '6.0.*'
+          WAGTAIL_VERSION: '6.3.*'
           TEMPLATE: 'basic'
         py3.10:
           PYTHON_VERSION: '3.10'
-          WAGTAIL_VERSION: '6.0.*'
+          WAGTAIL_VERSION: '6.3.*'
           TEMPLATE: 'basic'
         py3.11:
           PYTHON_VERSION: '3.11'
-          WAGTAIL_VERSION: '6.1.*'
+          WAGTAIL_VERSION: '6.3.*'
           TEMPLATE: 'basic'
-        py3.12_basic:
+        py3.12:
           PYTHON_VERSION: '3.12'
-          WAGTAIL_VERSION: '6.1.*'
+          WAGTAIL_VERSION: '6.3.*'
           TEMPLATE: 'basic'
-        py3.12_pro:
-          PYTHON_VERSION: '3.12'
-          WAGTAIL_VERSION: '6.1.*'
+        py3.13_basic:
+          PYTHON_VERSION: '3.13'
+          WAGTAIL_VERSION: '6.3.*'
+          TEMPLATE: 'basic'
+        py3.13_pro:
+          PYTHON_VERSION: '3.13'
+          WAGTAIL_VERSION: '6.3.*'
           TEMPLATE: 'pro'
 
     steps:
@@ -102,7 +102,7 @@ stages:
     - task: UsePythonVersion@0
       displayName: 'Use Python version'
       inputs:
-        versionSpec: '3.12'
+        versionSpec: '3.13'
         architecture: 'x64'
 
     - script: python -m pip install -r requirements-ci.txt
@@ -147,7 +147,7 @@ stages:
     - task: UsePythonVersion@0
       displayName: 'Use Python version'
       inputs:
-        versionSpec: '3.12'
+        versionSpec: '3.13'
         architecture: 'x64'
 
     - script: python -m pip install -r requirements-ci.txt

File diff suppressed because it is too large
+ 3 - 11
coderedcms/project_template/basic/website/migrations/0001_initial.py


+ 47 - 234
coderedcms/project_template/pro/custom_media/migrations/0001_initial.py

@@ -1,271 +1,84 @@
-# Generated by Django 4.2.7 on 2023-11-03 22:24
+# Generated by Django 4.2.16 on 2024-11-01 18:01
 
 from django.conf import settings
 from django.db import migrations, models
 import django.db.models.deletion
 import taggit.managers
 import wagtail.images.models
-import wagtail.models.collections
+import wagtail.models.media
 import wagtail.search.index
 
 
 class Migration(migrations.Migration):
+
     initial = True
 
     dependencies = [
-        ("taggit", "0005_auto_20220424_2025"),
-        ("wagtailcore", "0083_workflowcontenttype"),
+        ('taggit', '0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx'),
+        ('wagtailcore', '0094_alter_page_locale'),
         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
     ]
 
     operations = [
         migrations.CreateModel(
-            name="CustomImage",
+            name='CustomImage',
             fields=[
-                (
-                    "id",
-                    models.BigAutoField(
-                        auto_created=True,
-                        primary_key=True,
-                        serialize=False,
-                        verbose_name="ID",
-                    ),
-                ),
-                (
-                    "title",
-                    models.CharField(max_length=255, verbose_name="title"),
-                ),
-                (
-                    "file",
-                    wagtail.images.models.WagtailImageField(
-                        height_field="height",
-                        upload_to=wagtail.images.models.get_upload_to,
-                        verbose_name="file",
-                        width_field="width",
-                    ),
-                ),
-                (
-                    "width",
-                    models.IntegerField(editable=False, verbose_name="width"),
-                ),
-                (
-                    "height",
-                    models.IntegerField(editable=False, verbose_name="height"),
-                ),
-                (
-                    "created_at",
-                    models.DateTimeField(
-                        auto_now_add=True,
-                        db_index=True,
-                        verbose_name="created at",
-                    ),
-                ),
-                (
-                    "focal_point_x",
-                    models.PositiveIntegerField(blank=True, null=True),
-                ),
-                (
-                    "focal_point_y",
-                    models.PositiveIntegerField(blank=True, null=True),
-                ),
-                (
-                    "focal_point_width",
-                    models.PositiveIntegerField(blank=True, null=True),
-                ),
-                (
-                    "focal_point_height",
-                    models.PositiveIntegerField(blank=True, null=True),
-                ),
-                (
-                    "file_size",
-                    models.PositiveIntegerField(editable=False, null=True),
-                ),
-                (
-                    "file_hash",
-                    models.CharField(
-                        blank=True, db_index=True, editable=False, max_length=40
-                    ),
-                ),
-                (
-                    "alt_text",
-                    models.CharField(
-                        blank=True,
-                        help_text="A description of this image used by search engines and screen readers.",
-                        max_length=255,
-                        verbose_name="Alt Text",
-                    ),
-                ),
-                (
-                    "credit",
-                    models.CharField(
-                        blank=True,
-                        help_text="Credit or attribute the source of the image. Properly attributing images taken from online sources can reduce your risk of copyright infringement.",
-                        max_length=255,
-                        verbose_name="Credit",
-                    ),
-                ),
-                (
-                    "collection",
-                    models.ForeignKey(
-                        default=wagtail.models.collections.get_root_collection_id,
-                        on_delete=django.db.models.deletion.CASCADE,
-                        related_name="+",
-                        to="wagtailcore.collection",
-                        verbose_name="collection",
-                    ),
-                ),
-                (
-                    "tags",
-                    taggit.managers.TaggableManager(
-                        blank=True,
-                        help_text=None,
-                        through="taggit.TaggedItem",
-                        to="taggit.Tag",
-                        verbose_name="tags",
-                    ),
-                ),
-                (
-                    "uploaded_by_user",
-                    models.ForeignKey(
-                        blank=True,
-                        editable=False,
-                        null=True,
-                        on_delete=django.db.models.deletion.SET_NULL,
-                        to=settings.AUTH_USER_MODEL,
-                        verbose_name="uploaded by user",
-                    ),
-                ),
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=255, verbose_name='title')),
+                ('file', wagtail.images.models.WagtailImageField(height_field='height', upload_to=wagtail.images.models.get_upload_to, verbose_name='file', width_field='width')),
+                ('description', models.CharField(blank=True, default='', max_length=255, verbose_name='description')),
+                ('width', models.IntegerField(editable=False, verbose_name='width')),
+                ('height', models.IntegerField(editable=False, verbose_name='height')),
+                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
+                ('focal_point_x', models.PositiveIntegerField(blank=True, null=True)),
+                ('focal_point_y', models.PositiveIntegerField(blank=True, null=True)),
+                ('focal_point_width', models.PositiveIntegerField(blank=True, null=True)),
+                ('focal_point_height', models.PositiveIntegerField(blank=True, null=True)),
+                ('file_size', models.PositiveIntegerField(editable=False, null=True)),
+                ('file_hash', models.CharField(blank=True, db_index=True, editable=False, max_length=40)),
+                ('credit', models.CharField(blank=True, help_text='Credit or attribute the source of the image. Properly attributing images taken from online sources can reduce your risk of copyright infringement.', max_length=255, verbose_name='Credit')),
+                ('collection', models.ForeignKey(default=wagtail.models.media.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.collection', verbose_name='collection')),
+                ('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem', to='taggit.Tag', verbose_name='tags')),
+                ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')),
             ],
             options={
-                "abstract": False,
+                'abstract': False,
             },
-            bases=(
-                wagtail.images.models.ImageFileMixin,
-                wagtail.search.index.Indexed,
-                models.Model,
-            ),
+            bases=(wagtail.images.models.ImageFileMixin, wagtail.search.index.Indexed, models.Model),
         ),
         migrations.CreateModel(
-            name="CustomDocument",
+            name='CustomDocument',
             fields=[
-                (
-                    "id",
-                    models.BigAutoField(
-                        auto_created=True,
-                        primary_key=True,
-                        serialize=False,
-                        verbose_name="ID",
-                    ),
-                ),
-                (
-                    "title",
-                    models.CharField(max_length=255, verbose_name="title"),
-                ),
-                (
-                    "file",
-                    models.FileField(
-                        upload_to="documents", verbose_name="file"
-                    ),
-                ),
-                (
-                    "created_at",
-                    models.DateTimeField(
-                        auto_now_add=True, verbose_name="created at"
-                    ),
-                ),
-                (
-                    "file_size",
-                    models.PositiveIntegerField(editable=False, null=True),
-                ),
-                (
-                    "file_hash",
-                    models.CharField(blank=True, editable=False, max_length=40),
-                ),
-                (
-                    "collection",
-                    models.ForeignKey(
-                        default=wagtail.models.collections.get_root_collection_id,
-                        on_delete=django.db.models.deletion.CASCADE,
-                        related_name="+",
-                        to="wagtailcore.collection",
-                        verbose_name="collection",
-                    ),
-                ),
-                (
-                    "tags",
-                    taggit.managers.TaggableManager(
-                        blank=True,
-                        help_text=None,
-                        through="taggit.TaggedItem",
-                        to="taggit.Tag",
-                        verbose_name="tags",
-                    ),
-                ),
-                (
-                    "uploaded_by_user",
-                    models.ForeignKey(
-                        blank=True,
-                        editable=False,
-                        null=True,
-                        on_delete=django.db.models.deletion.SET_NULL,
-                        to=settings.AUTH_USER_MODEL,
-                        verbose_name="uploaded by user",
-                    ),
-                ),
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=255, verbose_name='title')),
+                ('file', models.FileField(upload_to='documents', verbose_name='file')),
+                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
+                ('file_size', models.PositiveBigIntegerField(editable=False, null=True)),
+                ('file_hash', models.CharField(blank=True, editable=False, max_length=40)),
+                ('collection', models.ForeignKey(default=wagtail.models.media.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.collection', verbose_name='collection')),
+                ('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem', to='taggit.Tag', verbose_name='tags')),
+                ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')),
             ],
             options={
-                "verbose_name": "document",
-                "verbose_name_plural": "documents",
-                "abstract": False,
+                'verbose_name': 'document',
+                'verbose_name_plural': 'documents',
+                'abstract': False,
             },
             bases=(wagtail.search.index.Indexed, models.Model),
         ),
         migrations.CreateModel(
-            name="CustomRendition",
+            name='CustomRendition',
             fields=[
-                (
-                    "id",
-                    models.BigAutoField(
-                        auto_created=True,
-                        primary_key=True,
-                        serialize=False,
-                        verbose_name="ID",
-                    ),
-                ),
-                (
-                    "filter_spec",
-                    models.CharField(db_index=True, max_length=255),
-                ),
-                (
-                    "file",
-                    wagtail.images.models.WagtailImageField(
-                        height_field="height",
-                        storage=wagtail.images.models.get_rendition_storage,
-                        upload_to=wagtail.images.models.get_rendition_upload_to,
-                        width_field="width",
-                    ),
-                ),
-                ("width", models.IntegerField(editable=False)),
-                ("height", models.IntegerField(editable=False)),
-                (
-                    "focal_point_key",
-                    models.CharField(
-                        blank=True, default="", editable=False, max_length=16
-                    ),
-                ),
-                (
-                    "image",
-                    models.ForeignKey(
-                        on_delete=django.db.models.deletion.CASCADE,
-                        related_name="renditions",
-                        to="custom_media.customimage",
-                    ),
-                ),
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('filter_spec', models.CharField(db_index=True, max_length=255)),
+                ('file', wagtail.images.models.WagtailImageField(height_field='height', storage=wagtail.images.models.get_rendition_storage, upload_to=wagtail.images.models.get_rendition_upload_to, width_field='width')),
+                ('width', models.IntegerField(editable=False)),
+                ('height', models.IntegerField(editable=False)),
+                ('focal_point_key', models.CharField(blank=True, default='', editable=False, max_length=16)),
+                ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='renditions', to='custom_media.customimage')),
             ],
             options={
-                "unique_together": {
-                    ("image", "filter_spec", "focal_point_key")
-                },
+                'unique_together': {('image', 'filter_spec', 'focal_point_key')},
             },
             bases=(wagtail.images.models.ImageFileMixin, models.Model),
         ),

+ 2 - 14
coderedcms/project_template/pro/custom_media/models.py

@@ -23,18 +23,9 @@ class CustomDocument(AbstractDocument):
 
 class CustomImage(AbstractImage):
     """
-    A custom Wagtail Image model with fields for alt text and
-    credit/attribution.
+    A custom Wagtail Image model with fields for credit/attribution.
     """
 
-    alt_text = models.CharField(
-        max_length=255,
-        blank=True,
-        verbose_name="Alt Text",
-        help_text=(
-            "A description of this image used by search engines and screen readers."
-        ),
-    )
     credit = models.CharField(
         max_length=255,
         blank=True,
@@ -45,10 +36,7 @@ class CustomImage(AbstractImage):
             "reduce your risk of copyright infringement."
         ),
     )
-    admin_form_fields = Image.admin_form_fields + (
-        "alt_text",
-        "credit",
-    )
+    admin_form_fields = Image.admin_form_fields + ("credit",)
 
 
 class CustomRendition(AbstractRendition):

File diff suppressed because it is too large
+ 3 - 11
coderedcms/project_template/pro/website/migrations/0001_initial.py


+ 6 - 5
pyproject.toml

@@ -15,15 +15,16 @@ classifiers = [
     "Operating System :: OS Independent",
     "Programming Language :: Python",
     "Programming Language :: Python :: 3",
-    "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 :: 3.13",
     "Programming Language :: Python :: 3 :: Only",
     "Framework :: Django",
     "Framework :: Django :: 4.2",
     "Framework :: Django :: 5.0",
+    "Framework :: Django :: 5.1",
     "Framework :: Wagtail",
     "Framework :: Wagtail :: 6",
     "Topic :: Internet :: WWW/HTTP",
@@ -33,11 +34,11 @@ classifiers = [
 dependencies = [
     "beautifulsoup4>=4.8,<4.13",  # should be the same as wagtail
     "django-eventtools==1.0.*",
-    "django-bootstrap5==24.2",
+    "django-bootstrap5==24.3",
     "Django>=4.2,<6.0",  # should be the same as wagtail
     "geocoder==1.38.*",
-    "icalendar==5.0.*",
-    "wagtail>=6.0,<7.0",
+    "icalendar==6.0.*",
+    "wagtail>=6.3,<7.0",
     "wagtail-cache>=2.4,<3",
     "wagtail-seo>=2.5,<3",
 ]
@@ -46,7 +47,7 @@ dynamic = ["version"]
 license = {file = "LICENSE.txt"}
 name = "coderedcms"
 readme = "README.md"
-requires-python = ">=3.8"
+requires-python = ">=3.9"
 
 [project.scripts]
 coderedcms = "coderedcms.bin.coderedcms:main"

Some files were not shown because too many files changed in this diff