diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8a7d758 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @matthew-shaw \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5356949..a21fdc1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5278813..fe8d5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/LandRegistry/govuk-frontend-wtf/compare/2.5.0..main) +## [Unreleased](https://github.com/LandRegistry/govuk-frontend-wtf/compare/3.0.0..main) + +## [3.0.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/3.0.0) - 13/02/2024 + +### Added + +- [GOV.UK Frontend v5.1.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.1.0) support +- WTForms 3.1 support +- Python 3.12 support + +### Fixed + +- Avoid rendering an empty hint [#82](https://github.com/LandRegistry/govuk-frontend-wtf/pull/82). Thanks [andreyyudin](https://github.com/andreyyudin) +- Use id for errors [#84](https://github.com/LandRegistry/govuk-frontend-wtf/pull/84). Thanks [andreyyudin](https://github.com/andreyyudin) ## [2.5.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/2.5.0) - 13/07/2023 @@ -22,6 +35,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Upgraded dependencies +### Removed + +- Python 3.7 support + ## [2.3.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/2.3.0) - 15/02/2023 ### Added diff --git a/README.md b/README.md index 1714b9f..5d3eab0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GOV.UK Frontend WTForms Widgets [![PyPI version](https://badge.fury.io/py/govuk-frontend-wtf.svg)](https://pypi.org/project/govuk-frontend-wtf/) -![govuk-frontend 4.7.0](https://img.shields.io/badge/govuk--frontend%20version-4.7.0-005EA5?logo=gov.uk&style=flat) +![govuk-frontend 5.1.0](https://img.shields.io/badge/govuk--frontend%20version-5.1.0-005EA5?logo=gov.uk&style=flat) [![Python package](https://github.com/LandRegistry/govuk-frontend-wtf/actions/workflows/python-package.yml/badge.svg)](https://github.com/LandRegistry/govuk-frontend-wtf/actions/workflows/python-package.yml) **GOV.UK Frontend WTForms is a [community tool](https://design-system.service.gov.uk/community/resources-and-tools/) of the [GOV.UK Design System](https://design-system.service.gov.uk/). The Design System team is not responsible for it and cannot support you with using it. Contact the [maintainers](#contributors) directly if you need [help](#support) or you want to request a feature.** diff --git a/govuk_frontend_wtf/wtforms_widgets.py b/govuk_frontend_wtf/wtforms_widgets.py index 50cca1f..eb283df 100644 --- a/govuk_frontend_wtf/wtforms_widgets.py +++ b/govuk_frontend_wtf/wtforms_widgets.py @@ -315,7 +315,7 @@ def __call__(self, field, **kwargs): kwargs["items"] = [] # Construct select box choices - for val, label, selected in field.iter_choices(): + for val, label, selected, render_kw in field.iter_choices(): item = {"text": label, "value": val, "selected": selected} kwargs["items"].append(item) diff --git a/setup.py b/setup.py index 87342a4..ede62e3 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setuptools.setup( name="govuk-frontend-wtf", - version="2.5.0", + version="3.0.0", author="Matt Shaw", author_email="matthew.shaw@landregistry.gov.uk", description="GOV.UK Frontend WTForms Widgets", @@ -28,6 +28,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", "Environment :: Web Environment", "Operating System :: OS Independent", @@ -41,8 +42,8 @@ "deepmerge", "flask", "flask-wtf", - "govuk-frontend-jinja>=2.0.0", + "govuk-frontend-jinja>=3.0.0", "jinja2", - "wtforms", + "wtforms>=3.1.0", ], ) diff --git a/tests/fixtures/wtf_widgets_data.yaml b/tests/fixtures/wtf_widgets_data.yaml index d378d06..958ae00 100644 --- a/tests/fixtures/wtf_widgets_data.yaml +++ b/tests/fixtures/wtf_widgets_data.yaml @@ -562,7 +562,7 @@ TestRadioField: test_empty_get: expected_output: -