Skip to content

Commit

Permalink
Merge pull request #83 from LandRegistry/govuk-frontend-50
Browse files Browse the repository at this point in the history
GOV.UK Frontend v5.0
  • Loading branch information
matthew-shaw authored Feb 13, 2024
2 parents 0dad144 + b07bdf9 commit 575b8b3
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @matthew-shaw
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.**
Expand Down
2 changes: 1 addition & 1 deletion govuk_frontend_wtf/wtforms_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
],
)
10 changes: 5 additions & 5 deletions tests/fixtures/wtf_widgets_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ TestRadioField:
test_empty_get:
expected_output:
- <div class="govuk-form-group">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -579,7 +579,7 @@ TestRadioField:
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <p id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -597,7 +597,7 @@ TestRadioField:
radio_field: two
expected_output:
- <div class="govuk-form-group">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -614,7 +614,7 @@ TestRadioField:
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <p id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -630,7 +630,7 @@ TestRadioField:
radio_field_no_description: foo
expected_output:
- <div class="govuk-form-group">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand Down
8 changes: 4 additions & 4 deletions tests/requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
deepmerge==1.1.1
email_validator==2.0.0.post2
flask-wtf==1.1.2
flask==2.3.3
govuk-frontend-jinja==2.8.0
email_validator==2.1.0.post1
flask-wtf==1.2.1
flask==3.0.2
govuk-frontend-jinja>=3.0.0
pytest-cov==4.1.0
pyyaml==6.0.1
30 changes: 15 additions & 15 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,56 @@
#
# pip-compile requirements.in
#
blinker==1.6.2
blinker==1.7.0
# via flask
click==8.1.4
click==8.1.7
# via flask
coverage[toml]==7.2.7
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
deepmerge==1.1.1
# via -r requirements.in
dnspython==2.3.0
dnspython==2.5.0
# via email-validator
email-validator==2.0.0.post2
email-validator==2.1.0.post1
# via -r requirements.in
flask==2.3.3
flask==3.0.2
# via
# -r requirements.in
# flask-wtf
flask-wtf==1.1.2
flask-wtf==1.2.1
# via -r requirements.in
govuk-frontend-jinja==2.8.0
govuk-frontend-jinja==3.0.0
# via -r requirements.in
idna==3.4
idna==3.6
# via email-validator
iniconfig==2.0.0
# via pytest
itsdangerous==2.1.2
# via
# flask
# flask-wtf
jinja2==3.1.2
jinja2==3.1.3
# via
# flask
# govuk-frontend-jinja
markupsafe==2.1.3
markupsafe==2.1.5
# via
# jinja2
# werkzeug
# wtforms
packaging==23.1
packaging==23.2
# via pytest
pluggy==1.2.0
pluggy==1.4.0
# via pytest
pytest==7.4.0
pytest==8.0.0
# via pytest-cov
pytest-cov==4.1.0
# via -r requirements.in
pyyaml==6.0.1
# via -r requirements.in
werkzeug==3.0.1
# via flask
wtforms==3.0.1
wtforms==3.1.2
# via flask-wtf

0 comments on commit 575b8b3

Please sign in to comment.