Skip to content

Commit

Permalink
Merge branch 'release/8.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Feb 1, 2025
2 parents 65cea22 + 773b226 commit 86fd526
Show file tree
Hide file tree
Showing 27 changed files with 1,046 additions and 376 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
wagtail-version:
- 4.1
- 5.1
- 5.2
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
wagtail-version: ["5.2", "6.2", "6.3"]
django-version: ["4.2", "5.0", "5.1"]
exclude:
- python-version: "3.13"
django-version: "4.2"
- python-version: "3.13"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.1"
- wagtail-version: "5.2"
django-version: "5.1"
- wagtail-version: "6.2"
django-version: "5.1"
services:
postgres:
image: postgis/postgis:12-2.5
image: postgis/postgis:13-3.4
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
Expand All @@ -27,9 +38,9 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -57,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose"
Expand All @@ -68,10 +79,10 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -82,10 +93,10 @@ jobs:
runs-on: ubuntu-latest
needs: [test, lint-black, lint-isort]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@

## [Unreleased]
### Added
### Fixed
### Changed
### Removed

## [8.2.0] - 2025.02.01
### Added
- Add support for Wagtail 6.0/6.1 (@katdom13)
- Add support for Wagtail 6.2 (@engineervix)
- Add error handling to geocoding fields (@marteinn)

### Fixed
- Fix rendering of MapsField when Point is a NoneType (@nickmoreton)
- Update CI testing matrix to test against python 3.9 to 3.13 (@nickmoreton)
- Update CI testing matrix to test against wagtail 5.2 to 6.3 (@nickmoreton)
- Update CI testing matrix to test against Django 4.2 to 5.1 (@nickmoreton)
- Update classifiers to include Django 5.1 and Python 3.13 (@nickmoreton)
- Update leaflet to 1.9.4 (@marteinn)
- Upgrade mapbox geocoding API to v6 (@marteinn)
- App test page descriptions to improve testing (@marteinn)

### Changed
- Implement stimulus approach to GoogleMapsField, GeocoderField, and LeafletField (@katdom13)

### Removed
- Drop support for Django 4.1 (@katdom13)
- Drop support for Wagtail < 5.2 (@katdom13)
- Drop testing around python 3.8 (@nickmoreton)

## [8.1.1] - 2023.12.29
### Fixed
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.12-slim
MAINTAINER Frojd
FROM python:3.13-slim
LABEL maintainer="Frojd"
LABEL version="v0.1.0"

ENV PYTHONUNBUFFERED=1 \
Expand All @@ -18,7 +18,7 @@ RUN apt-get update \

RUN pip install --upgrade pip \
&& pip install -e .[test] --no-cache-dir \
&& pip install psycopg2-binary==2.9.3 \
&& pip install psycopg2-binary==2.9.10 \
&& pip install ipython \
&& pip install pywatchman \
&& pip install python-dotenv
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2024 Fröjd Interactive
Copyright (c) 2015-2025 Fröjd Interactive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Local/Dev
version: '3'
services:
web:
image: frojd/geo-widget-web
Expand All @@ -20,7 +19,7 @@ services:
- DATABASE_PORT=5432
env_file: web.env
db:
image: postgis/postgis:12-2.5
image: postgis/postgis:13-3.4
restart: always
environment:
- POSTGRES_USER=postgres
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-with-google-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Requirements

- Python 3.8+
- Wagtail 4.1+ and Django 3.2+
- Wagtail 5.2+ and Django 4.2+
- A Google account


Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-with-leaflet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Requirements

- Python 3.8+
- Wagtail 4.1+ and Django 3.2+
- Wagtail 5.2+ and Django 4.2+
- Access to a tile provider for Leaflet, this library includes built in support for Open Street Map


Expand Down
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,28 @@
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"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",
"Topic :: Utilities",
],
extras_require={"test": test_extras},
install_requires=[
"Wagtail>=4.1",
"Wagtail>=5.2",
],
project_urls={
"Source": "https://github.com/Frojd/wagtail-geo-widget/",
Expand Down
1 change: 1 addition & 0 deletions tests/examplesite/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"wagtail.documents",
"wagtail.images",
"wagtail.search",
"wagtail.contrib.search_promotions",
"wagtail.admin",
"wagtail",
]
Expand Down
4 changes: 2 additions & 2 deletions tests/geopage/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
import django.db.models.deletion
import modelcluster.fields
from django.db import migrations, models
from wagtail import VERSION as WAGTAIL_VERSION
import wagtail.blocks as wagtail_blocks
import wagtail.fields as wagtail_fields

import wagtailgeowidget.blocks


class Migration(migrations.Migration):

initial = True

dependencies = [
("wagtailcore", "0066_collection_management_permissions"),
]

streamfield_params = {"use_json_field": True}
streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

operations = [
migrations.CreateModel(
Expand Down
21 changes: 19 additions & 2 deletions tests/geopage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from modelcluster.fields import ParentalKey
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import blocks
from wagtail.admin.panels import (
FieldPanel,
Expand Down Expand Up @@ -50,6 +51,8 @@ class GeoPageRelatedLocations(Orderable, GeoLocation):


class GeoPage(Page):
page_description = "Google maps with google maps geocoder"

address = models.CharField(max_length=250, blank=True, null=True)
location = models.PointField(srid=4326, null=True, blank=True)

Expand Down Expand Up @@ -109,6 +112,8 @@ class GeoPageWithLeafletRelatedLocations(Orderable, GeoLocationWithLeaflet):


class GeoPageWithLeaflet(Page):
page_description = "Leaflet with nominatim geocoder"

address = models.CharField(
max_length=250,
help_text=_("Search powered by Nominatim"),
Expand Down Expand Up @@ -141,7 +146,9 @@ class GeoPageWithLeaflet(Page):


class GeoStreamPage(Page):
streamfield_params = {"use_json_field": True}
page_description = "All map blocks"

streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

body = StreamField(
[
Expand Down Expand Up @@ -219,6 +226,10 @@ def get_context(self, request):


class ClassicGeoPage(Page):
page_description = "Google maps with google maps geocoder"

page_description = "Google maps with google geocoder"

address = models.CharField(max_length=250, blank=True, null=True)
location = models.CharField(max_length=250, blank=True, null=True)

Expand Down Expand Up @@ -252,6 +263,8 @@ def lng(self):


class ClassicGeoPageWithLeaflet(Page):
page_description = "Leaflet with mapbox geocoder"

address = models.CharField(
max_length=250,
help_text=_("Search powered by MapBox"),
Expand All @@ -271,7 +284,7 @@ class ClassicGeoPageWithLeaflet(Page):
]

def get_context(self, request):
data = super(ClassicGeoPage, self).get_context(request)
data = super().get_context(request)
return data

@cached_property
Expand All @@ -290,6 +303,8 @@ def lng(self):


class ClassicGeoPageWithZoom(Page):
page_description = "Google maps with google maps geocoder"

address = models.CharField(max_length=250, blank=True, null=True)
location = models.CharField(max_length=250, blank=True, null=True)
zoom = models.SmallIntegerField(blank=True, null=True)
Expand Down Expand Up @@ -330,6 +345,8 @@ def lng(self):


class ClassicGeoPageWithLeafletAndZoom(Page):
page_description = "Leaflet with nominatim geocoder"

address = models.CharField(
max_length=250,
help_text=_("Search powered by Nominatim"),
Expand Down
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/classic_geo_page_with_leaflet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/classic_geo_page_with_zoom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/geo_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.location.tuple }}
</li>
<li>
Lat: {{ page.location.y }}
</li>
<li>
Lng: {{ page.location.x }}
</li>
</ul>
{% endblock %}
Loading

0 comments on commit 86fd526

Please sign in to comment.