From a97bc4c0ef56d9e095a2fe9982721ae31f43b585 Mon Sep 17 00:00:00 2001 From: David Cain Date: Sat, 22 Jun 2024 07:21:44 -0600 Subject: [PATCH] Upgrade gsheets to latest This may all be moot if we're forced to scrap the spreadsheet functionality, but all the same -- upgrade and fix a typing error. --- poetry.lock | 23 +++-------------------- ws/utils/member_sheets.py | 6 +++++- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index dce7b630..85611b9a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -881,19 +881,18 @@ tool = ["click (>=6.0.0)"] [[package]] name = "gspread" -version = "6.1.0" +version = "6.1.2" description = "Google Spreadsheets Python API" optional = false python-versions = ">=3.8" files = [ - {file = "gspread-6.1.0-py3-none-any.whl", hash = "sha256:67aa3335cfcbb2625e41b53129433ba779f2890244a4c532624362ce5e022342"}, - {file = "gspread-6.1.0.tar.gz", hash = "sha256:576b72b628b251d2ee41e02b982d3c714d511d2a5aa3a88e587ed9efc4d6e752"}, + {file = "gspread-6.1.2-py3-none-any.whl", hash = "sha256:345996fbb74051ee574e3d330a375ac625774f289459f73cb1f8b6fb3cf4cac5"}, + {file = "gspread-6.1.2.tar.gz", hash = "sha256:b147688b8c7a18c9835d5f998997ec17c97c0470babcab17f65ac2b3a32402b7"}, ] [package.dependencies] google-auth = ">=1.12.0" google-auth-oauthlib = ">=0.4.1" -StrEnum = "0.4.15" [[package]] name = "gunicorn" @@ -1970,22 +1969,6 @@ pure-eval = "*" [package.extras] tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] -[[package]] -name = "strenum" -version = "0.4.15" -description = "An Enum that inherits from str." -optional = false -python-versions = "*" -files = [ - {file = "StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659"}, - {file = "StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff"}, -] - -[package.extras] -docs = ["myst-parser[linkify]", "sphinx", "sphinx-rtd-theme"] -release = ["twine"] -test = ["pylint", "pytest", "pytest-black", "pytest-cov", "pytest-pylint"] - [[package]] name = "tomli" version = "2.0.1" diff --git a/ws/utils/member_sheets.py b/ws/utils/member_sheets.py index fb84f3d4..29317619 100644 --- a/ws/utils/member_sheets.py +++ b/ws/utils/member_sheets.py @@ -242,7 +242,11 @@ def update_participant( return # Insert a new row if no existing row found - sorted_names = wks.col_values(1)[1:] + sorted_names: list[str] = [] + for name in wks.col_values(1)[1:]: + assert isinstance(name, str) # (not numeric, not null) + sorted_names.append(name) + row_index = bisect.bisect(sorted_names, participant.name) + 1 wks.insert_row(new_row, row_index + 1)