Skip to content

Commit

Permalink
Merge pull request #72 from canonical/wd-12659
Browse files Browse the repository at this point in the history
chore: Bump Flask to 2.3.3 and update dependencies
  • Loading branch information
petesfrench authored Jul 5, 2024
2 parents 2aaa175 + b3569c6 commit 0095840
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Install system dependencies
run: |
Expand All @@ -22,31 +22,34 @@ jobs:
run: python3 -m twine check dist/*

lint:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.6

- name: Install dependencies
run: pip3 install black flake8
- uses: actions/checkout@v2

- name: Install system dependencies
run: |
sudo apt update && sudo apt install -y --no-install-recommends python3-setuptools
pip3 install --upgrade setuptools
pip3 install black flake8
- name: Flake
run: flake8 canonicalwebteam tests

- name: Black
run: black --line-length 79 --check canonicalwebteam tests

test:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.6
- uses: actions/checkout@v2

- name: Install system dependencies
run: |
sudo apt update && sudo apt install -y --no-install-recommends python3-setuptools
pip3 install --upgrade setuptools
pip3 install .
- name: Install dependencies
run: pip3 install .
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.0.0 (2024-07-04)

Pin to Flask 2.3.3
Update dependencies: jinja2, Werkzeug, markupsafe, itsdangerous

# 1.0.6 (2022-08-04)

Disable MIME-sniffing with `x-content-type-options: NOSNIFF` ([rationale here](https://github.com/canonical/web-design-systems-squad/issues/77#issuecomment-1205100399))
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="canonicalwebteam.flask-base",
version="1.1.0",
version="2.0.0",
description=(
"Flask extension that applies common configurations"
"to all of webteam's flask apps."
Expand All @@ -22,14 +22,14 @@
packages=find_packages(),
install_requires=[
"canonicalwebteam.yaml-responses[flask] (>=1,<2)",
"flask==1.1.2",
"jinja2 (>=3,<3.1.0)",
"flask==2.3.3",
"jinja2 >= 3.1.2, < 3.2.0",
"gevent==21.12.0",
"greenlet==1.1.2",
"talisker[gunicorn,gevent,flask,prometheus,raven]",
"Werkzeug (>=1.0.0, <1.2)",
"markupsafe >= 1.0, < 2.1.0",
"itsdangerous >= 0.24, < 2.0",
"Werkzeug >= 2.3.7, < 3.0.0",
"markupsafe >= 1.0, < 2.2.0",
"itsdangerous >= 0.24, < 2.2.0",
],
dependency_links=[],
include_package_data=True,
Expand Down
5 changes: 3 additions & 2 deletions tests/test_flask_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_favicon_redirect(self):
self.assertEqual(302, response.status_code)
self.assertEqual(
response.headers.get("Location"),
"http://localhost" + local_url,
local_url,
)

def test_favicon_serve(self):
Expand Down Expand Up @@ -266,6 +266,7 @@ def test_clear_trailing_slash(self):

def test_static_files(self):
flask_app = create_test_app()
flask_app.config["SEND_FILE_MAX_AGE_DEFAULT"] = 31536000 # 1 year

with flask_app.test_client() as client:
# Check basic serving of static files works
Expand All @@ -279,7 +280,7 @@ def test_static_files(self):

max_age = flask_app.config["SEND_FILE_MAX_AGE_DEFAULT"]
if max_age:
self.assertIn(f"max-age={max_age.seconds}", plain_cache)
self.assertIn(f"max-age={max_age}", plain_cache)
else:
self.assertIn("max-age=60", plain_cache)

Expand Down

0 comments on commit 0095840

Please sign in to comment.