From 7e3faa08ad3040aab8c6bd878c325325258ebe5e Mon Sep 17 00:00:00 2001 From: dgw Date: Fri, 24 Jan 2025 14:45:43 -0600 Subject: [PATCH 1/2] trigger, tools.time: flake8-type-checking 3 is stricter about `cast()` --- sopel/tools/time.py | 2 +- sopel/trigger.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sopel/tools/time.py b/sopel/tools/time.py index 19acc57e4..1ec42e551 100644 --- a/sopel/tools/time.py +++ b/sopel/tools/time.py @@ -94,7 +94,7 @@ def validate_timezone(zone: Optional[str]) -> str: except pytz.exceptions.UnknownTimeZoneError: raise ValueError('Invalid time zone.') - return cast(str, tz.zone) + return cast('str', tz.zone) def validate_format(tformat: str) -> str: diff --git a/sopel/trigger.py b/sopel/trigger.py index 3f04040da..866b15780 100644 --- a/sopel/trigger.py +++ b/sopel/trigger.py @@ -229,7 +229,7 @@ def __init__( # The regex will always match any string, even an empty one components_match = cast( - Match, PreTrigger.component_regex.match(self.hostmask or '')) + 'Match', PreTrigger.component_regex.match(self.hostmask or '')) nick, self.user, self.host = components_match.groups() self.nick: Identifier = self.make_identifier(nick) From 31d90266572c435d32967fdecc7328542682dd89 Mon Sep 17 00:00:00 2001 From: dgw Date: Wed, 1 Jan 2025 10:59:12 -0600 Subject: [PATCH 2/2] build: pin urllib3<2.3 to accommodate our old fork of vcrpy We can unpin this when py3.9 support drops in October 2025. Original hope was to get a PR merged upstream in vcrpy that fixes the urllib version issues with Python < 3.10, but that hasn't gone anywhere. --- dev-requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev-requirements.txt b/dev-requirements.txt index e548c691a..8fbec0919 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -20,6 +20,9 @@ sphinx-rfcsection~=0.1.1 # use fork of vcrpy 5.x until kevin1024/vcrpy#777 is (hopefully) accepted # (or until py3.9 EOL... in 10/2025, I HOPE NOT) vcrpy @ git+https://github.com/sopel-irc/vcrpy@uncap-urllib3 +# also have to use a version of urllib3 that doesn't use the `version_string` +# attr of the response object, because vcrpy won't support it until 7.x +urllib3<2.3 # type check # often breaks CI on master, so pin and update deliberately, on our own terms mypy==1.11.2