Skip to content

Commit 854c149

Browse files
authored
Updated deps to latest, updated python to 3.13 from @pikachu0542 (#69)
Updated deps to latest, updated python to 3.13
2 parents 37ba7b6 + 103393a commit 854c149

File tree

8 files changed

+80
-87
lines changed

8 files changed

+80
-87
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
python-version: [3.8]
15+
python-version: [3.13]
1616

1717
steps:
1818
- uses: actions/checkout@v2

.pylintrc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[MASTER]
22
ignore = ,input
33
persistent = yes
4-
load-plugins = pylint_quotes
54

65
[MESSAGES CONTROL]
76
disable =
@@ -10,7 +9,6 @@ disable =
109
duplicate-code,
1110
no-member,
1211
parse-error,
13-
bad-continuation,
1412
too-few-public-methods,
1513
global-statement,
1614
cyclic-import,
@@ -21,19 +19,13 @@ disable =
2119

2220
[REPORTS]
2321
output-format = text
24-
files-output = no
2522
reports = no
2623

2724
[FORMAT]
2825
max-line-length = 120
29-
max-statement-lines = 75
3026
single-line-if-stmt = no
31-
no-space-check = trailing-comma,dict-separator
3227
max-module-lines = 1000
3328
indent-string = ' '
34-
string-quote=single-avoid-escape
35-
triple-quote=single
36-
docstring-quote=double
3729

3830
[MISCELLANEOUS]
3931
notes = FIXME,XXX,TODO
@@ -79,9 +71,6 @@ good-names=logger,id,ID
7971
# Bad variable names which should always be refused, separated by a comma
8072
bad-names=foo,bar,baz,toto,tutu,tata
8173

82-
# List of builtins function names that should not be used, separated by a comma
83-
bad-functions=apply,input
84-
8574
[DESIGN]
8675
max-args = 10
8776
ignored-argument-names = _.*
@@ -95,4 +84,4 @@ min-public-methods = 2
9584
max-public-methods = 20
9685

9786
[EXCEPTIONS]
98-
overgeneral-exceptions = Exception
87+
overgeneral-exceptions = builtins.Exception

Containerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM docker.io/python:3.9-bookworm
1+
FROM docker.io/python:3.13-bookworm
22

33
WORKDIR /src/
44
COPY ./ .
55
RUN pip install -r requirements.txt
66
RUN git config --system --add safe.directory /src
77

8-
ENTRYPOINT [ "gunicorn", "selections:app", "--bind=0.0.0.0:8080"]
8+
ENTRYPOINT [ "gunicorn", "selections:app", "--bind=0.0.0.0:8080"]

requirements.txt

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
1-
alabaster==0.7.12
2-
alembic==0.9.9
3-
astroid==2.4.1
4-
Beaker==1.11.0
5-
blinker==1.4
6-
certifi==2020.4.5.1
7-
cffi==1.14.0
8-
chardet==3.0.4
9-
click==7.1.2
10-
cryptography==3.3.2
11-
dnspython==1.16.0
12-
Flask==1.1.2
13-
Flask-Migrate==2.1.1
14-
Flask-pyoidc==1.2.0
15-
Flask-SQLAlchemy==2.3.2
16-
future==0.18.2
17-
gunicorn==19.7.1
18-
idna==2.9
19-
isort==4.3.21
20-
itsdangerous==1.1.0
21-
Jinja2==2.11.3
22-
lazy-object-proxy==1.4.3
23-
lxml==4.6.3
24-
Mako==1.1.2
25-
MarkupSafe==1.1.1
26-
mccabe==0.6.1
27-
oic==0.11.0.1
28-
Pillow==8.1.1
29-
pyasn1==0.4.8
30-
pyasn1-modules==0.2.8
31-
pycparser==2.20
32-
pycryptodomex==3.9.7
1+
alabaster==1.0.0
2+
alembic==1.16.5
3+
astroid==3.3.11
4+
Beaker==1.13.0
5+
blinker==1.9.0
6+
certifi==2025.8.3
7+
cffi==2.0.0
8+
chardet==5.2.0
9+
click==8.2.1
10+
cryptography==45.0.7
11+
dnspython==2.8.0
12+
Flask==3.1.2
13+
Flask-Migrate==4.1.0
14+
Flask-pyoidc==3.14.3
15+
Flask-SQLAlchemy==3.1.1
16+
future==1.0.0
17+
gunicorn==23.0.0
18+
idna==3.10
19+
isort==6.0.1
20+
itsdangerous==2.2.0
21+
Jinja2==3.1.6
22+
lazy-object-proxy==1.12.0
23+
lxml==6.0.1
24+
Mako==1.3.10
25+
MarkupSafe==3.0.2
26+
mccabe==0.7.0
27+
oic==1.6.1
28+
Pillow==11.3.0
29+
pyasn1==0.6.1
30+
pyasn1-modules==0.4.2
31+
pycparser==2.23
32+
pycryptodomex==3.23.0
3333
pyjwkest==1.4.2
34-
pylint==2.5.2
35-
pylint-quotes==0.2.1
36-
PyMySQL==0.8.0
37-
pyOpenSSL==19.1.0
38-
python-dateutil==2.8.1
39-
python-docx==0.8.6
34+
pylint==3.3.8
35+
PyMySQL==1.1.2
36+
pyOpenSSL==25.2.0
37+
python-dateutil==2.9.0.post0
38+
python-docx==1.2.0
4039
python-editor==1.0.4
41-
python-resize-image==1.1.11
42-
requests==2.23.0
43-
sentry-sdk==0.14.3
44-
six==1.14.0
45-
SQLAlchemy==1.3.17
46-
toml==0.10.1
47-
urllib3==1.25.9
48-
Werkzeug==1.0.1
49-
wrapt==1.12.1
50-
boto3==1.35.49
40+
python-resize-image==1.1.20
41+
requests==2.32.5
42+
sentry-sdk==2.38.0
43+
six==1.17.0
44+
SQLAlchemy==2.0.43
45+
toml==0.10.2
46+
urllib3==2.5.0
47+
Werkzeug==3.1.3
48+
wrapt==1.17.3
49+
boto3==1.40.32

selections/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from flask import Flask
66
from flask_migrate import Migrate
77
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
8+
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
89
from flask_sqlalchemy import SQLAlchemy
910
import sentry_sdk
1011
from sentry_sdk.integrations.flask import FlaskIntegration
@@ -20,8 +21,12 @@
2021
else:
2122
app.config.from_pyfile(os.path.join(os.getcwd(), 'config.env.py'))
2223

23-
auth = OIDCAuthentication(app, issuer=app.config['OIDC_ISSUER'],
24-
client_registration_info=app.config['OIDC_CLIENT_CONFIG'])
24+
#auth = OIDCAuthentication(app, issuer=app.config['OIDC_ISSUER'],
25+
# client_registration_info=app.config['OIDC_CLIENT_CONFIG'])
26+
27+
client_metadata = ClientMetadata(app.config["OIDC_CLIENT_CONFIG"])
28+
provider_config = ProviderConfiguration(issuer=app.config["OIDC_ISSUER"], client_registration_info=client_metadata)
29+
auth = OIDCAuthentication({'default': provider_config}, app)
2530

2631
# Sentry
2732
sentry_sdk.init(
@@ -45,7 +50,7 @@
4550
try:
4651
s3.create_bucket(Bucket=app.config['S3_BUCKET_NAME'])
4752
except s3.exceptions.BucketAlreadyExists:
48-
1+1
53+
pass
4954

5055
# Load Applications Blueprint
5156
from selections.blueprints.application import *
@@ -55,7 +60,7 @@
5560

5661

5762
@app.route('/')
58-
@auth.oidc_auth
63+
@auth.oidc_auth("default")
5964
@before_request
6065
def main(info=None):
6166
is_evals = '/eboard-evaluations' in info['group_list']

selections/blueprints/application.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections import defaultdict
2-
from zipfile import BadZipFile
32

43
from flask import render_template, redirect, url_for, flash, request
54

@@ -9,7 +8,7 @@
98

109

1110
@app.route('/application/<app_id>')
12-
@auth.oidc_auth
11+
@auth.oidc_auth("default")
1312
@before_request
1413
def get_application(app_id, info=None):
1514
applicant_info = Applicant.query.filter_by(id=app_id).first()
@@ -33,7 +32,7 @@ def get_application(app_id, info=None):
3332
fields=fields)
3433

3534
@app.route('/application/content/<app_id>')
36-
@auth.oidc_auth
35+
@auth.oidc_auth("default")
3736
def get_application_pdf(app_id):
3837
applicant_info = Applicant.query.filter_by(id=app_id).first()
3938
resp = s3.get_object(Bucket=app.config['S3_BUCKET_NAME'], Key='/'+applicant_info.rit_id+'.pdf')
@@ -42,7 +41,7 @@ def get_application_pdf(app_id):
4241

4342

4443
@app.route('/application', methods=['POST'])
45-
@auth.oidc_auth
44+
@auth.oidc_auth("default")
4645
def create_application():
4746
applicant_rit_id = request.form.get('rit_id')
4847
applicant = Applicant(
@@ -60,7 +59,7 @@ def create_application():
6059

6160

6261
@app.route('/application/import', methods=['POST'])
63-
@auth.oidc_auth
62+
@auth.oidc_auth("default")
6463
#@before_request
6564
def import_application():
6665
word_file = request.files['file']
@@ -97,7 +96,7 @@ def import_application():
9796
if line[-1:] == ' ':
9897
app_text += line
9998
else:
100-
app_text += '\n{}'.format(line)
99+
app_text += f'\n{line}'
101100

102101
applications[app_rit_id] = [app_gender, app_text]
103102
new_app = Applicant(
@@ -115,7 +114,7 @@ def import_application():
115114

116115

117116
@app.route('/application/delete/<app_id>', methods=['GET'])
118-
@auth.oidc_auth
117+
@auth.oidc_auth("default")
119118
@before_request
120119
def delete_application(app_id, info=None):
121120
is_evals = '/eboard-evaluations' in info['group_list']
@@ -136,7 +135,7 @@ def delete_application(app_id, info=None):
136135

137136

138137
@app.route('/application/create')
139-
@auth.oidc_auth
138+
@auth.oidc_auth("default")
140139
@before_request
141140
def get_application_creation(info=None):
142141
is_evals = '/eboard-evaluations' in info['group_list']
@@ -149,7 +148,7 @@ def get_application_creation(info=None):
149148

150149

151150
@app.route('/application/<app_id>', methods=['POST'])
152-
@auth.oidc_auth
151+
@auth.oidc_auth("default")
153152
@before_request
154153
def submit_application(app_id, info=None):
155154
member = Members.query.filter_by(username=info['uid']).first()
@@ -188,17 +187,17 @@ def submit_application(app_id, info=None):
188187
db.session.add(member_score)
189188
db.session.flush()
190189
db.session.commit()
191-
flash('Thanks for evaluating application #{}!'.format(app_id))
190+
flash(f'Thanks for evaluating application #{app_id}!')
192191
return redirect('/', 302)
193192

194193

195194
@app.route('/application/review/<app_id>', methods=['GET'])
196-
@auth.oidc_auth
195+
@auth.oidc_auth("default")
197196
@before_request
198197
def review_application(app_id, info=None):
199198
applicant_info = Applicant.query.filter_by(id=app_id).first()
200199
evaluated = bool(Submission.query.filter_by(application=app_id, medium='Phone').all())
201-
scores = Submission.query.filter_by(application=app_id).all()
200+
scores = Submission.query.filter_by(application=app_id).all()
202201
return render_template(
203202
'review_app.html',
204203
info=info,
@@ -209,11 +208,12 @@ def review_application(app_id, info=None):
209208

210209

211210
@app.route('/application/phone/<app_id>', methods=['GET'])
212-
@auth.oidc_auth
211+
@auth.oidc_auth("default")
213212
@before_request
214213
def get_phone_application(app_id, info=None):
215214
applicant_info = Applicant.query.filter_by(id=app_id).first()
216-
pdf_url = s3.generate_presigned_url('get_object', Params={'Bucket': app.config['S3_BUCKET_NAME'], 'Key': applicant_info.rit_id+'.pdf'}, ExpiresIn=30)
215+
pdf_url = s3.generate_presigned_url('get_object', Params={'Bucket': app.config['S3_BUCKET_NAME'],
216+
'Key': applicant_info.rit_id+'.pdf'}, ExpiresIn=30)
217217
pdf_url = pdf_url.replace("s3.csh", "assets.csh")
218218
scores = [subs.score for subs in Submission.query.filter_by(application=app_id).all()]
219219
total = 0
@@ -232,7 +232,7 @@ def get_phone_application(app_id, info=None):
232232

233233

234234
@app.route('/application/phone/<app_id>', methods=['POST'])
235-
@auth.oidc_auth
235+
@auth.oidc_auth("default")
236236
@before_request
237237
def promote_application(app_id, info=None):
238238
score = request.form.get('score')

selections/blueprints/teams.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@app.route('/teams')
9-
@auth.oidc_auth
9+
@auth.oidc_auth("default")
1010
@before_request
1111
def get_teams(info=None):
1212
is_evals = '/eboard-evaluations' in info['group_list']
@@ -34,7 +34,7 @@ def get_teams(info=None):
3434

3535

3636
@app.route('/teams', methods=['POST'])
37-
@auth.oidc_auth
37+
@auth.oidc_auth("default")
3838
@before_request
3939
def create_team(info=None):
4040
is_evals = '/eboard-evaluations' in info['group_list']
@@ -69,7 +69,7 @@ def create_team(info=None):
6969

7070

7171
@app.route('/teams/<team_id>', methods=['POST'])
72-
@auth.oidc_auth
72+
@auth.oidc_auth("default")
7373
@before_request
7474
def add_to_team(team_id, info=None):
7575
is_evals = '/eboard-evaluations' in info['group_list']
@@ -102,7 +102,7 @@ def add_to_team(team_id, info=None):
102102

103103

104104
@app.route('/teams/remove/<username>', methods=['GET'])
105-
@auth.oidc_auth
105+
@auth.oidc_auth("default")
106106
@before_request
107107
def remove_from_team(username, info=None):
108108
is_evals = '/eboard-evaluations' in info['group_list']

selections/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def assign_pending_applicants():
4949
app_data.team = int(team)
5050
app_group += 1
5151
db.session.flush()
52-
db.session.commit()
52+
db.session.commit()

0 commit comments

Comments
 (0)