Skip to content

Commit

Permalink
Merge pull request #172 from mila-iqia/fix-werkzeug-version-bug
Browse files Browse the repository at this point in the history
Update python libraries
  • Loading branch information
soline-b authored Oct 19, 2023
2 parents 250bf34 + 35444e2 commit 71d4d8f
Show file tree
Hide file tree
Showing 26 changed files with 894 additions and 893 deletions.
2 changes: 1 addition & 1 deletion clockwork_dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV CLOCKWORK_ENABLE_TESTING_LOGIN=True
ENV MONGODB_DATABASE_NAME="clockwork"

# to have gcc to build `dulwich` used by poetry
RUN apt update && apt install -y build-essential
RUN apt update && apt install -y build-essential git

RUN pip install --upgrade pip poetry

Expand Down
6 changes: 3 additions & 3 deletions clockwork_tools_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest==7.1
pymongo==4.0
coverage==6.3
coverage==7.3.2
pymongo==4.5.0
pytest==7.4.2
9 changes: 9 additions & 0 deletions clockwork_tools_test/requirements_orig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage==7.3.2
dnspython==2.4.2
exceptiongroup==1.1.3
iniconfig==2.0.0
packaging==23.2
pluggy==1.3.0
pymongo==4.5.0
pytest==7.4.2
tomli==2.0.1
1 change: 1 addition & 0 deletions clockwork_web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WORKDIR ${CLOCKWORK_ROOT}
ENV FLASK_APP=clockwork_web.main:app
ENV MONGODB_DATABASE_NAME="clockwork"

RUN apt-get update && apt-get install -y --no-install-recommends git
RUN pip install --upgrade pip

COPY requirements.txt /requirements_web.txt
Expand Down
3 changes: 2 additions & 1 deletion clockwork_web/browser_routes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# Use of "Markup" described there to avoid Flask escaping it when passing to a template.
# https://stackoverflow.com/questions/3206344/passing-html-to-template-using-flask-jinja2

from flask import Flask, Response, url_for, request, redirect, make_response, Markup
from markupsafe import Markup
from flask import Flask, Response, url_for, request, redirect, make_response
from flask import request, send_file
from flask import jsonify
from werkzeug.utils import secure_filename
Expand Down
2 changes: 1 addition & 1 deletion clockwork_web/browser_routes/gpu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from flask import Blueprint, Markup, request
from flask import Blueprint, request
from flask.json import jsonify
from flask_login import current_user, login_required
from flask_babel import gettext
Expand Down
4 changes: 2 additions & 2 deletions clockwork_web/browser_routes/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Use of "Markup" described there to avoid Flask escaping it when passing to a template.
# https://stackoverflow.com/questions/3206344/passing-html-to-template-using-flask-jinja2

from flask import Flask, Response, url_for, request, redirect, make_response, Markup
from markupsafe import Markup
from flask import Flask, Response, url_for, request, redirect, make_response
from flask import request, send_file
from flask import jsonify
from werkzeug.utils import secure_filename
Expand Down
13 changes: 4 additions & 9 deletions clockwork_web/browser_routes/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

# Use of "Markup" described there to avoid Flask escaping it when passing to a template.
# https://stackoverflow.com/questions/3206344/passing-html-to-template-using-flask-jinja2

from flask import Flask, Response, url_for, request, redirect, make_response, Markup
from flask import request, send_file
from flask import jsonify
from werkzeug.utils import secure_filename
from markupsafe import Markup
from flask import Flask, Response, request
from flask import request
from werkzeug.wsgi import FileWrapper

# https://flask.palletsprojects.com/en/1.1.x/appcontext/
Expand All @@ -36,10 +34,7 @@

from clockwork_web.core.clusters_helper import get_all_clusters
from clockwork_web.core.nodes_helper import get_nodes
from clockwork_web.core.jobs_helper import (
get_filter_cluster_name,
combine_all_mongodb_filters,
)
from clockwork_web.core.jobs_helper import combine_all_mongodb_filters
from clockwork_web.core.nodes_helper import (
get_filter_node_name,
strip_artificial_fields_from_node,
Expand Down
3 changes: 2 additions & 1 deletion clockwork_web/browser_routes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import secrets
import logging

from flask import Flask, Response, url_for, request, redirect, make_response, Markup
from markupsafe import Markup
from flask import Flask, Response, url_for, request, redirect, make_response
from flask import request, send_file
from flask import jsonify

Expand Down
31 changes: 22 additions & 9 deletions clockwork_web/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
requests==2.27
Flask==2.1
oauthlib==3.2
Werkzeug==2.2.2
Flask-Login==0.6.0
Flask-Babel==2.0.0
pymongo==4.0
Babel==2.13.0
blinker==1.6.3
certifi==2023.7.22
charset-normalizer==3.3.0
click==8.1.7
dnspython==2.4.2
Flask==3.0.0
flask-babel==4.0.0
Flask-Login @ git+https://github.com/maxcountryman/flask-login.git@2204b4eee7b215977ba5a1bf85e2061f7fa65e20
idna==3.4
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
oauthlib==3.2.2
pymongo==4.5.0
pytz==2023.3.post1
requests==2.31.0
sentry-sdk==1.32.0
toml==0.10.2
sentry-sdk[flask]

urllib3==2.0.7
Werkzeug==3.0.0
zipp==3.17.0
9 changes: 9 additions & 0 deletions clockwork_web/requirements_orig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Flask==3.0.0
flask-babel==4.0.0
Flask-Login @ git+https://github.com/maxcountryman/flask-login.git@2204b4eee7b215977ba5a1bf85e2061f7fa65e20
oauthlib==3.2.2
pymongo==4.5.0
requests==2.31.0
sentry-sdk==1.32.0
toml==0.10.2
Werkzeug==3.0.0
9 changes: 4 additions & 5 deletions clockwork_web/server_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from .core.jobs_helper import job_state_to_aggregated


from werkzeug.urls import url_encode
from urllib.parse import urlencode

register_config("flask.secret_key", validator=string)
register_config("translation.translations_folder", default="", validator=string)
Expand Down Expand Up @@ -128,7 +128,7 @@ def modify_query(**new_values):
for key, value in new_values.items():
args[key] = value

return "{}?{}".format(request.path, url_encode(args))
return "{}?{}".format(request.path, urlencode(args))

# Adding a function to help comparing two usernames
@app.template_global()
Expand All @@ -146,9 +146,6 @@ def have_same_users(user1: str, user2: str):
)

# Initialize Babel
babel = Babel(app)

@babel.localeselector
def get_locale():
# If the user is authenticated
if current_user and current_user.is_authenticated():
Expand All @@ -167,6 +164,8 @@ def get_locale():

return session["language"]

babel = Babel(app, locale_selector=get_locale, timezone_selector=None)

# Initialize templates filters
@app.template_filter()
def format_date(float_timestamp, expected_date_format, expected_time_format):
Expand Down
17 changes: 14 additions & 3 deletions clockwork_web_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
pytest==7.1
coverage==6.3
requests-mock==1.9
certifi==2023.7.22
charset-normalizer==3.3.0
coverage==7.3.2
exceptiongroup==1.1.3
idna==3.4
iniconfig==2.0.0
packaging==23.2
pluggy==1.3.0
pytest==7.4.2
requests==2.31.0
requests-mock==1.11.0
six==1.16.0
tomli==2.0.1
urllib3==2.0.7
4 changes: 4 additions & 0 deletions clockwork_web_test/requirements_orig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage==7.3.2
pytest==7.4.2
requests-mock==1.11.0
toml==0.10.2
Loading

0 comments on commit 71d4d8f

Please sign in to comment.