Skip to content

Commit 4a7f7e1

Browse files
committed
Merge branch 'main' into release/2
2 parents a9c64c5 + 9b3e7f9 commit 4a7f7e1

29 files changed

Lines changed: 154 additions & 189 deletions

azure-pipelines.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ stages:
3030
vmImage: 'ubuntu-latest'
3131
strategy:
3232
matrix:
33-
py3.7:
34-
PYTHON_VERSION: '3.7'
35-
py3.8:
33+
py3.8_wag3:
3634
PYTHON_VERSION: '3.8'
37-
py3.9:
35+
WAGTAIL: '3.*'
36+
py3.9_wag4:
3837
PYTHON_VERSION: '3.9'
39-
py3.10:
38+
WAGTAIL: '4.*'
39+
py3.10_wag5:
4040
PYTHON_VERSION: '3.10'
41+
WAGTAIL: '5.*'
42+
py3.11_wag5:
43+
PYTHON_VERSION: '3.11'
44+
WAGTAIL: '5.*'
4145

4246
steps:
4347
- task: UsePythonVersion@0
@@ -46,7 +50,7 @@ stages:
4650
versionSpec: '$(PYTHON_VERSION)'
4751
architecture: 'x64'
4852

49-
- script: python -m pip install -r requirements-dev.txt
53+
- script: python -m pip install -r requirements-dev.txt wagtail==$(WAGTAIL)
5054
displayName: 'CR-QC: Install from local repo'
5155

5256
- script: |
@@ -86,7 +90,7 @@ stages:
8690
- task: UsePythonVersion@0
8791
displayName: 'Use Python version'
8892
inputs:
89-
versionSpec: '3.10'
93+
versionSpec: '3.11'
9094
architecture: 'x64'
9195

9296
- script: python -m pip install -r requirements-dev.txt
@@ -98,8 +102,11 @@ stages:
98102
- script: flake8 .
99103
displayName: 'CR-QC: Static analysis (flake8)'
100104

105+
- script: isort --check .
106+
displayName: 'CR-QC: Format check (isort)'
107+
101108
- script: black --check .
102-
displayName: 'CR-QC: Format check'
109+
displayName: 'CR-QC: Format check (black)'
103110

104111
- script: mypy ./wagtailcache/
105112
displayName: 'CR-QC: Type check (mypy)'
@@ -134,7 +141,7 @@ stages:
134141
- task: UsePythonVersion@0
135142
displayName: 'Use Python version'
136143
inputs:
137-
versionSpec: '3.10'
144+
versionSpec: '3.11'
138145
architecture: 'x64'
139146

140147
- script: python -m pip install -r requirements-dev.txt

docs/_templates/sponsor.html

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
<a class="card mt-5" href="https://www.coderedcorp.com/"
2-
style="font-size:0.9em; line-height: 1.2em; max-width: 275px; text-decoration:none;">
3-
<div class="row no-gutters">
4-
<div class="col-3">
5-
<img src="https://docs.coderedcorp.com/logo-square-red-128.png" class="w-100" alt=""/>
6-
</div>
7-
<div class="col-9">
8-
<p class="p-2 m-0">
9-
<strong>Get Pro Support</strong><br>
10-
This project is commercially supported by CodeRed.
11-
</p>
12-
</div>
13-
</div>
1+
<a href="https://www.codered.cloud/?utm_source=docs-wagtail-cache&utm_medium=banner">
2+
<img src="https://docs.coderedcorp.com/crcloud-docs-ad.webp" alt="Wagtail Hosting by CodeRed" class="w-100">
143
</a>

docs/conf.py

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file does only contain a selection of the most common options. For a
4-
# full list see the documentation:
5-
# http://www.sphinx-doc.org/en/master/config
6-
7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
# import os
14-
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
1+
"""
2+
Configuration file for the Sphinx documentation builder.
163
4+
This file does only contain a selection of the most common options. For a
5+
full list see the documentation:
6+
http://www.sphinx-doc.org/en/master/config
7+
8+
-- Path setup --------------------------------------------------------------
9+
10+
If extensions (or modules to document with autodoc) are in another directory,
11+
add these directories to sys.path here. If the directory is relative to the
12+
documentation root, use os.path.abspath to make it absolute, like shown here.
13+
14+
import os
15+
import sys
16+
sys.path.insert(0, os.path.abspath('.'))
17+
"""
1718
import datetime
19+
1820
from wagtailcache import __shortversion__
1921

2022

@@ -23,31 +25,23 @@
2325
project = "wagtail-cache"
2426
author = "CodeRed LLC"
2527
copyright = f"2018–{str(datetime.datetime.now().year)}, {author}"
26-
2728
# The short X.Y version
2829
version = __shortversion__
2930
# The full version, including alpha/beta/rc tags
3031
release = __shortversion__
31-
32-
3332
# -- General configuration ---------------------------------------------------
34-
3533
source_suffix = ".rst"
3634

3735
master_doc = "index"
3836

3937
language = "en"
4038

4139
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
42-
4340
# Add any paths that contain templates here, relative to this directory.
4441
templates_path = ["_templates"]
4542

4643
extensions = ["sphinx_wagtail_theme"]
47-
48-
4944
# -- Options for HTML output -------------------------------------------------
50-
5145
html_show_sourcelink = False
5246

5347
html_theme = "sphinx_wagtail_theme"

docs/contributing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ development tools:
2929
3030
Write some code.
3131

32-
Next, run the static analysis tools (``flake8`` and ``mypy``)
32+
Next, run the formatters and static analysis tools:
3333

3434
.. code-block:: console
3535
36+
$ isort .
37+
$ black .
3638
$ flake8 ./wagtailcache/
3739
$ mypy ./wagtailcache/
3840

docs/getting_started/hooks.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For example:
2727

2828
.. code-block:: python
2929
30-
from wagtail.core import hooks
30+
from wagtail import hooks
3131
3232
@hooks.register("is_request_cacheable")
3333
def nocache_in_query(request, curr_cache_decision):
@@ -54,7 +54,7 @@ For example:
5454

5555
.. code-block:: python
5656
57-
from wagtail.core import hooks
57+
from wagtail import hooks
5858
5959
@hooks.register("is_response_cacheable")
6060
def nocache_secrets(response, curr_cache_decision):

docs/getting_started/install.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ adding the Wagtail Cache middleware.
4040
2. Define a cache
4141
-----------------
4242

43-
Next a cache must be configured in the settings. If you use django-redis, see :doc:`Supported Cache Backends </getting_started/supported_backends>`. Here is an example file cache,
43+
Next a cache must be configured in the settings. Here is an example file cache,
4444
which is suitable for use on any web server:
4545

4646
.. code-block:: python
@@ -200,11 +200,11 @@ To this:
200200
from django.conf.urls import url
201201
202202
from django.contrib.auth import views as auth_views
203-
from wagtail.core.urls import serve_pattern, WAGTAIL_FRONTEND_LOGIN_TEMPLATE
204-
from wagtail.core import views as wagtail_views
203+
from wagtail.urls import serve_pattern, WAGTAIL_FRONTEND_LOGIN_TEMPLATE
204+
from wagtail import views as wagtail_views
205205
from wagtailcache.cache import cache_page
206206
207-
# Copied from wagtail.core.urls:
207+
# Copied from wagtail.urls:
208208
url(r'^_util/authenticate_with_password/(\d+)/(\d+)/$', wagtail_views.authenticate_with_password,
209209
name='wagtailcore_authenticate_with_password'),
210210
url(r'^_util/login/$', auth_views.LoginView.as_view(template_name=WAGTAIL_FRONTEND_LOGIN_TEMPLATE),

docs/getting_started/supported_backends.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ Built-in Django cache backends
1616
Wagtail Cache may or may not work correctly with 3rd party backends. If you experience an issue, please
1717
`report it on our GitHub page <https://github.com/coderedcorp/wagtail-cache/issues>`_.
1818

19-
django-redis
20-
------------
21-
22-
Wagtail Cache provides a compatibility backend to support ``django-redis``. Install as follows:
23-
24-
#. Install wagtail-cache :doc:`following the installation guide </getting_started/install>`.
25-
26-
#. `Install django-redis <http://niwinz.github.io/django-redis/latest/#_user_guide>`_ and define
27-
a Redis cache in your settings.py.
28-
29-
#. Replace ``django_redis.cache.RedisCache`` with ``wagtailcache.compat_backends.django_redis.RedisCache``
30-
in your cache definition.
31-
3219
.. note::
3320
If you are currently using Redis or have other code that uses a Redis cache, It is advised to use
3421
separate cache definitions for wagtail-cache and your other uses.

docs/releases.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ Release Notes
33
=============
44

55

6+
2.3.0
7+
=====
8+
9+
* Support Wagtail 5 and Django 4.2.
10+
11+
* Remove ``django-redis`` compatibility backend. Django 4.0+ has a native redis backend.
12+
13+
614
2.2.0
715
=====
816

9-
* Support Wagtail 4 and Django 4.1
17+
* Support Wagtail 4 and Django 4.1.
1018

1119

1220
2.1.1

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 80
3-
target-version = ['py37', 'py38', 'py39', 'py310']
3+
target-version = ['py38', 'py39', 'py310', 'py311']
44
# Regular expression of files to exclude.
55
exclude = '''
66
/(
@@ -9,3 +9,17 @@ exclude = '''
99
| migrations
1010
)/
1111
'''
12+
13+
[tool.isort]
14+
force_alphabetical_sort_within_sections = true
15+
force_single_line = true
16+
lines_after_imports = 2
17+
lines_before_imports = 0
18+
lines_between_sections = 1
19+
lines_between_types = 0
20+
line_length = 80
21+
profile = "black"
22+
skip_gitignore = true
23+
extend_skip = ["migrations"]
24+
# Specific to this project
25+
known_first_party = ["home", "wagtailcache"]

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
black
33
codespell
44
flake8
5+
isort
56
mypy
67
pytest
78
pytest-cov

0 commit comments

Comments
 (0)