Skip to content

Commit

Permalink
Merge pull request #44 from torchbox-forks/main
Browse files Browse the repository at this point in the history
Wagtail 6.0
  • Loading branch information
katdom13 committed Mar 8, 2024
2 parents 4c8825e + 1273343 commit c1bd5f6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 30 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3

Expand All @@ -33,12 +33,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand All @@ -53,10 +53,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3

Expand All @@ -70,7 +70,7 @@ jobs:
run: twine check dist/*

- name: Upload Python packages artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: Python Packages
path: dist
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Unreleased
----------
* Drop support for Wagtail < 5.2 (@katdom13)
* Add support for Wagtail 6.0 (@katdom13)
* Add support for Python 3.12 (@katdom13)

1.0.1 - 8th March 2024
----------------------
* Drop support for Wagtail versions 4.2 and 5.0 (@katdom13)
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Internet :: WWW/HTTP
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.1
Framework :: Django :: 4.2
Framework :: Django :: 5.0
Framework :: Wagtail
Framework :: Wagtail :: 4
Framework :: Wagtail :: 5
Framework :: Wagtail :: 6
keywords =
wagtail
s3
Expand All @@ -33,7 +34,7 @@ keywords =
[options]
packages = find:
install_requires =
Wagtail >=4.1
Wagtail >=5.2
django-storages[boto3] <2
python_requires = >=3.8

Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
envlist =
py{38,39,310}-dj{32,41}-wt{41,51,52}
py311-dj41-wt{41,51,52}
py311-dj42-wt{51,52,main}
py{38,39,310}-dj32-wagtail52
py{38,39,310,311}-dj42-wagtail{52,60}
py{311,312}-dj50-wagtail{52,60}
flake8
isort
black
Expand All @@ -13,18 +13,18 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
setenv =
PYTHONPATH = {toxinidir}
DJANGO_SETTINGS_MODULE = wagtail_storages.tests.settings
deps =
dj32: Django>=3.2,<4.0
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<4.3
wagtail41: wagtail>=4.1,<4.2
wagtail51: wagtail>=5.1,<5.2
dj50: Django>=5.0,<5.1
wagtail52: wagtail>=5.2,<5.3
wagtail60: wagtail>=6.0,<6.1
wagtailmain: git+https://github.com/wagtail/wagtail.git@main#egg=Wagtail

install_command = pip install -U {opts} {packages}
Expand Down
2 changes: 0 additions & 2 deletions wagtail_storages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
__version__ = "1.0.1"

default_app_config = "wagtail_storages.apps.WagtailStoragesConfig"
18 changes: 9 additions & 9 deletions wagtail_storages/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import django.utils.crypto

from wagtail import VERSION as WAGTAIL_VERSION

TESTS_PATH = os.path.dirname(os.path.abspath(__file__))

SECRET_KEY = django.utils.crypto.get_random_string(50)
Expand Down Expand Up @@ -46,12 +44,7 @@

STATIC_ROOT = os.path.join(TESTS_PATH, "static")

if WAGTAIL_VERSION >= (5, 2):
# when running tests with Wagtail 5.2+, we need to set the STATIC_URL explicitly,
# otherwise the test server will not start.
# This happens when running tests against the main branch of Wagtail
# so I am assuming that an upcoming release will require this.
STATIC_URL = "/static/"
STATIC_URL = "/static/"

ROOT_URLCONF = "wagtail_storages.tests.urls"

Expand All @@ -68,7 +61,14 @@

AWS_STORAGE_BUCKET_NAME = "test"

DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}

MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
Expand Down
4 changes: 2 additions & 2 deletions wagtail_storages/tests/test_protected_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_create_public_document(self):
response = self.client.get(url)

# Test wagtail redirects to S3.
self.assertEquals(response.status_code, 302)
self.assertEqual(response.status_code, 302)
self.assertTrue(response.url)
# Check object is public
self.assertTrue(self.check_document_is_public(document))
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_create_private_document(self):
response = self.client.get(url)

# Test wagtail redirects to S3.
self.assertEquals(response.status_code, 302)
self.assertEqual(response.status_code, 302)
self.assertTrue(response.url)
# Check object is not public
self.assertFalse(self.check_document_is_public(document))

0 comments on commit c1bd5f6

Please sign in to comment.