Skip to content

Commit

Permalink
Flask: update Flask and dependencies to v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 20, 2024
1 parent 7387e73 commit e1ecbf5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@ on:
- '**'

jobs:
job:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8==5.0.4 flake8-import-order==0.18.1 darglint==1.8.1 codespell mypy types-requests
python -m pip install flake8==7.1.1 flake8-import-order==0.18.2 darglint==1.8.1 codespell mypy types-requests
- name: Lint with flake8
run: |
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='yoda_eus',
version='1.9.0.dev',
version='2.0.0.dev',
author='Utrecht University - ITS/RDMS department',
author_email='[email protected]',
url='https://uu.nl/rdm',
Expand All @@ -19,12 +19,12 @@
install_requires=[
"bcrypt==4.0.1",
"email-validator==2.0.0",
"Flask==3.0.2",
"Flask-session==0.6.0",
"Flask-SQLAlchemy==3.0.3",
"Flask-wtf==1.2.1",
"Flask==3.1.0",
"flask-session==0.8.0",
"Flask-SQLAlchemy==3.1.1",
"Flask-WTF==1.2.2",
"psycopg2-binary==2.9.10",
"requests==2.32.0",
"Werkzeug==3.0.3"
"requests==2.32.3",
"Werkzeug==3.1.3"
],
)
10 changes: 5 additions & 5 deletions yoda_eus/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,19 +529,19 @@ def process_reset_password_form(hash: str) -> Response:
# Confirm activation to user
return render_template("reset-password-successful.html", **params), 200

@ app.errorhandler(403)
@app.errorhandler(403)
def access_forbidden(e: Exception) -> Response:
return render_template('403.html'), 403

@ app.errorhandler(404)
@app.errorhandler(404)
def page_not_found(e: Exception) -> Response:
return render_template('404.html'), 404

@ app.errorhandler(500)
@app.errorhandler(500)
def internal_error(e: Exception) -> Response:
return render_template('500.html'), 500

@ app.after_request
@app.after_request
def add_security_headers(response: Response) -> Response:
"""Add generic security headers.""" # noqa DAR101 DAR201

Expand Down Expand Up @@ -611,7 +611,7 @@ def static_loader() -> Optional[Response]:

return None

@ app.url_defaults
@app.url_defaults
def add_cache_buster(endpoint: str, values: Dict[str, str]) -> None:
"""Add cache buster to asset (static) URLs."""
if endpoint.endswith("static"):
Expand Down
1 change: 1 addition & 0 deletions yoda_eus/tests/flask.test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ YODA_EUS_FQDN = 'eus.yoda.test'
CSRF_TOKENS_ENABLED = 'false'
API_SECRET = 'dummy_api_secret'
EUS_TITLE_TEXT = 'Yoda External User Service'
SESSION_TYPE = 'filesystem'

# Theming configuration
YODA_THEME_PATH = '/var/www/yoda/themes' # Path to location of themes
Expand Down

0 comments on commit e1ecbf5

Please sign in to comment.