Skip to content

Commit

Permalink
Merge pull request #63 from LandRegistry/govuk-frontend-update
Browse files Browse the repository at this point in the history
GOV.UK Frontend Update
  • Loading branch information
matthew-shaw authored Dec 16, 2022
2 parents 6d289fd + bd165e0 commit 5323bf6
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 58 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
45 changes: 27 additions & 18 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [created]
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m build
twine upload dist/*
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ 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.1.0..main)
## [Unreleased](https://github.com/LandRegistry/govuk-frontend-wtf/compare/2.2.0..main)

## [2.2.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/2.2.0) - 16/12/2022

### Added

- [GOV.UK Frontend v4.4.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.4.0) support
- Python 3.11 support

## [2.1.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/2.1.0) - 22/07/2022

Expand Down
8 changes: 6 additions & 2 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.1.0",
version="2.2.0",
author="Matt Shaw",
author_email="matthew.shaw@landregistry.gov.uk",
description="GOV.UK Frontend WTForms Widgets",
Expand All @@ -24,7 +24,11 @@
package_data={"govuk_frontend_wtf": templates},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Environment :: Web Environment",
"Operating System :: OS Independent",
Expand Down
16 changes: 9 additions & 7 deletions tests/fixtures/wtf_widgets_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ TestCharacterCountField:
data:
something: else
expected_output:
- <textarea class="govuk-textarea govuk-textarea--error govuk-js-character-count govuk-textarea--error" id="charactercount_field" name="charactercount_field" rows="5" aria-describedby="charactercount_field-info charactercount_field-hint charactercount_field-error" required="required"></textarea>
- <textarea class="govuk-textarea govuk-textarea--error govuk-js-character-count" id="charactercount_field" name="charactercount_field" rows="5" aria-describedby="charactercount_field-info charactercount_field-hint charactercount_field-error" required="required"></textarea>
- <label class="govuk-label" for="charactercount_field">\s*CharacterCountField\s*</label>
- <p id="charactercount_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*CharacterCountField is required\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
Expand Down Expand Up @@ -725,8 +725,9 @@ TestErrorSummary:
data:
foo: bar
expected_output:
- <div class="govuk-error-summary" aria-labelledby="error-summary-title" role="alert" data-module="govuk-error-summary">
- <h2 class="govuk-error-summary__title" id="error-summary-title">\s*There is a problem\s*</h2>
- <div class="govuk-error-summary" data-module="govuk-error-summary">
- <div role="alert">
- <h2 class="govuk-error-summary__title">\s*There is a problem\s*</h2>
- <a href="#string_field">StringField is required</a>
- <a href="#date_field">Date is required</a>
- <a href="#integer_field">IntegerField is required</a>
Expand Down Expand Up @@ -774,8 +775,8 @@ TestErrorSummary:
charactercount_field: foo
float_field: 1.5
not_expected_output:
- <div class="govuk-error-summary" aria-labelledby="error-summary-title" role="alert" tabindex="-1" data-module="govuk-error-summary">
- <h2 class="govuk-error-summary__title" id="error-summary-title">\s*There is a problem\s*</h2>
- <div class="govuk-error-summary" tabindex="-1" data-module="govuk-error-summary">
- <h2 class="govuk-error-summary__title">\s*There is a problem\s*</h2>
test_single_error:
request:
method: post
Expand All @@ -802,6 +803,7 @@ TestErrorSummary:
charactercount_field: foo
float_field: 1.5
expected_output:
- <div class="govuk-error-summary" aria-labelledby="error-summary-title" role="alert" data-module="govuk-error-summary">
- <h2 class="govuk-error-summary__title" id="error-summary-title">\s*There is a problem\s*</h2>
- <div class="govuk-error-summary" data-module="govuk-error-summary">
- <div role="alert">
- <h2 class="govuk-error-summary__title">\s*There is a problem\s*</h2>
- <a href="#string_field">Example serverside error - type &#34;John Smith&#34; into this field to suppress it</a>
12 changes: 6 additions & 6 deletions tests/requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
deepmerge==1.0.1
email_validator==1.2.1
deepmerge==1.1.0
email_validator==1.3.0
flask-wtf==1.0.1
flask==2.1.3
govuk-frontend-jinja==2.3.0
pytest-cov==3.0.0
pyyaml==6.0
flask==2.2.2
govuk-frontend-jinja==2.4.0
pytest-cov==4.0.0
pyyaml==6.0
37 changes: 16 additions & 21 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
#
attrs==21.4.0
attrs==22.1.0
# via pytest
click==8.1.3
# via flask
coverage[toml]==6.4.2
coverage[toml]==6.5.0
# via pytest-cov
deepmerge==1.0.1
deepmerge==1.1.0
# via -r requirements.in
dnspython==2.2.1
# via email-validator
email-validator==1.2.1
email-validator==1.3.0
# via -r requirements.in
flask==2.1.3
exceptiongroup==1.0.4
# via pytest
flask==2.2.2
# via
# -r requirements.in
# flask-wtf
flask-wtf==1.0.1
# via -r requirements.in
govuk-frontend-jinja==2.3.0
govuk-frontend-jinja==2.4.0
# via -r requirements.in
idna==3.3
idna==3.4
# via email-validator
importlib-metadata==4.12.0
# via flask
iniconfig==1.1.1
# via pytest
itsdangerous==2.1.2
Expand All @@ -41,28 +41,23 @@ jinja2==3.1.2
markupsafe==2.1.1
# via
# jinja2
# werkzeug
# wtforms
packaging==21.3
packaging==22.0
# via pytest
pluggy==1.0.0
# via pytest
py==1.11.0
# via pytest
pyparsing==3.0.9
# via packaging
pytest==7.1.2
pytest==7.2.0
# via pytest-cov
pytest-cov==3.0.0
pytest-cov==4.0.0
# via -r requirements.in
pyyaml==6.0
# via -r requirements.in
tomli==2.0.1
# via
# coverage
# pytest
werkzeug==2.1.2
werkzeug==2.2.2
# via flask
wtforms==3.0.1
# via flask-wtf
zipp==3.8.1
# via importlib-metadata

0 comments on commit 5323bf6

Please sign in to comment.