From 3c00750ce2b650dfc26b7f5537ba4e2ea27f11bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:30:32 +0000 Subject: [PATCH 1/2] Bump pylint from 2.13.9 to 3.2.7 Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.13.9 to 3.2.7. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.13.9...v3.2.7) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.in | 2 +- requirements.txt | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/requirements.in b/requirements.in index 234a4df..9822a31 100644 --- a/requirements.in +++ b/requirements.in @@ -10,7 +10,7 @@ pip-tools~=6.6.2 PyMySQL==1.1.1 pyGravatar==0.0.6 git+https://github.com/maxcountryman/flask-uploads@master -pylint~=2.13.9 +pylint~=3.2.7 Pillow==10.3.0 requests~=2.32.2 sentry-sdk[flask]~=1.5.12 diff --git a/requirements.txt b/requirements.txt index 6772e31..ba9e425 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ alabaster==0.7.12 # via oic alembic==1.7.7 # via flask-migrate -astroid==2.11.5 +astroid==3.2.4 # via pylint attrs==21.4.0 # via ddtrace @@ -79,8 +79,6 @@ itsdangerous==1.1.0 # via flask jinja2==2.11.3 # via flask -lazy-object-proxy==1.7.1 - # via astroid mako==1.2.2 # via # alembic @@ -126,7 +124,7 @@ pygravatar==0.0.6 # via -r requirements.in pyjwkest==1.4.2 # via oic -pylint==2.13.9 +pylint==3.2.7 # via -r requirements.in pymysql==1.1.1 # via -r requirements.in @@ -161,6 +159,8 @@ tomli==2.0.1 # via # pep517 # pylint +tomlkit==0.13.2 + # via pylint typing-extensions==4.12.2 # via # astroid @@ -175,8 +175,6 @@ werkzeug==1.0.1 # flask wheel==0.38.1 # via pip-tools -wrapt==1.14.1 - # via astroid # The following packages are considered to be unsafe in a requirements file: # pip From c8d8db7681f3c7b9c8357bfa5396b00aa138fb0e Mon Sep 17 00:00:00 2001 From: Sam Cordry Date: Thu, 19 Sep 2024 17:04:00 -0400 Subject: [PATCH 2/2] fix pylint errors --- .pylintrc | 9 +-------- profiles/ldap.py | 6 +++--- profiles/utils.py | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.pylintrc b/.pylintrc index 99e8cc9..130be63 100644 --- a/.pylintrc +++ b/.pylintrc @@ -9,7 +9,6 @@ disable = duplicate-code, no-member, parse-error, - bad-continuation, too-few-public-methods, global-statement, cyclic-import, @@ -18,14 +17,11 @@ disable = [REPORTS] output-format = text -files-output = no reports = no [FORMAT] max-line-length = 120 -max-statement-lines = 75 single-line-if-stmt = no -no-space-check = trailing-comma,dict-separator max-module-lines = 1000 indent-string = ' ' @@ -73,9 +69,6 @@ good-names=logger,id,ID # Bad variable names which should always be refused, separated by a comma bad-names=foo,bar,baz,toto,tutu,tata -# List of builtins function names that should not be used, separated by a comma -bad-functions=apply,input - [DESIGN] max-args = 10 ignored-argument-names = _.* @@ -89,4 +82,4 @@ min-public-methods = 2 max-public-methods = 20 [EXCEPTIONS] -overgeneral-exceptions = Exception +overgeneral-exceptions = builtins.Exception diff --git a/profiles/ldap.py b/profiles/ldap.py index 8e0fd15..423db13 100644 --- a/profiles/ldap.py +++ b/profiles/ldap.py @@ -371,7 +371,7 @@ def ldap_search_members(query): for uid in res: try: - mem = (str(uid[1]).split('\'')[3]) + mem = str(uid[1]).split('\'')[3] ret.append(ldap_get_member(mem)) except IndexError: continue @@ -398,7 +398,7 @@ def ldap_get_year(year): for uid in res: try: - mem = (str(uid[1]).split('\'')[3]) + mem = str(uid[1]).split('\'')[3] ret.append(ldap_get_member(mem)) except IndexError: continue @@ -464,7 +464,7 @@ def get_gravatar(uid=None): @lru_cache(maxsize=1024) def proxy_image(url): - response = requests.get(url) + response = requests.get(url, timeout=10) img = Image.open(BytesIO(response.content)) with BytesIO() as output: img.save(output, format="png") diff --git a/profiles/utils.py b/profiles/utils.py index 1de0caf..505778f 100644 --- a/profiles/utils.py +++ b/profiles/utils.py @@ -36,7 +36,7 @@ def wrapped_function(*args, **kwargs): "uid": uid, "user_obj": user_obj, "member_info": get_member_info(uid), - "color": requests.get('https://themeswitcher.csh.rit.edu/api/colour').content, + "color": requests.get('https://themeswitcher.csh.rit.edu/api/colour', timeout=10).content, "current_year": parse_account_year(str(datetime.datetime.now().strftime("%Y%m"))), "rtp": ldap_is_rtp(user_obj) }