From 3e3466092cd91bbb7b314a663587413d232df5be Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:20:22 +1000 Subject: [PATCH 1/6] ci: Stop building for Python 3.9 --- .github/workflows/dist.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 3faa3729..c5bf3446 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -131,7 +131,6 @@ jobs: - "macos-14" # arm64 - "windows-2022" python_version: - - '3.9' - '3.10' - '3.11' - '3.12' From 3886c70543ce153045a643f175f751139e469257 Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:30:51 +1000 Subject: [PATCH 2/6] Fix UP024 (Replace aliased errors with `OSError`) ruff check --select=UP024 --fix --- subprojects/robotpy-cscore/cscore/imagewriter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/robotpy-cscore/cscore/imagewriter.py b/subprojects/robotpy-cscore/cscore/imagewriter.py index 89a5a071..7799b1b3 100644 --- a/subprojects/robotpy-cscore/cscore/imagewriter.py +++ b/subprojects/robotpy-cscore/cscore/imagewriter.py @@ -104,7 +104,7 @@ def location(self): if self._location is None: # This assures that we only log when a USB memory stick is plugged in if not os.path.exists(self.location_root): - raise IOError( + raise OSError( "Logging disabled, %s does not exist" % self.location_root ) @@ -139,7 +139,7 @@ def _run(self): last = now - except IOError as e: + except OSError as e: logger.error("Error logging images: %s", e) logger.warn("Storage thread exited") From 11e20b195de8ddc2734cbdeb7cd6e7c1c219e82f Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:32:18 +1000 Subject: [PATCH 3/6] Fix UP032 (Use f-string instead of `format` call) ruff check --select=UP032 --fix --- subprojects/robotpy-wpiutil/examples/printlog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/robotpy-wpiutil/examples/printlog.py b/subprojects/robotpy-wpiutil/examples/printlog.py index 4db4c33d..da03ef8c 100755 --- a/subprojects/robotpy-wpiutil/examples/printlog.py +++ b/subprojects/robotpy-wpiutil/examples/printlog.py @@ -60,7 +60,7 @@ # handle systemTime specially if entry.name == "systemTime" and entry.type == "int64": dt = datetime.fromtimestamp(record.getInteger() / 1000000) - print(" {:%Y-%m-%d %H:%M:%S.%f}".format(dt)) + print(f" {dt:%Y-%m-%d %H:%M:%S.%f}") continue if entry.type == "double": From d41a7ec6510902ae9b688865188a6ecd8040c234 Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:33:19 +1000 Subject: [PATCH 4/6] Fix UP004 (Class `Foo` inherits from `object`) ruff check --select=UP004 --fix --- subprojects/pyntcore/tests/test_util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/pyntcore/tests/test_util.py b/subprojects/pyntcore/tests/test_util.py index 9f5d0803..fc0d35ec 100644 --- a/subprojects/pyntcore/tests/test_util.py +++ b/subprojects/pyntcore/tests/test_util.py @@ -27,7 +27,7 @@ def test_ntproperty(nt: NetworkTableInstance): - class Foo(object): + class Foo: robotTime = ntproperty( "/SmartDashboard/robotTime", 0.0, writeDefault=False, inst=nt ) @@ -85,14 +85,14 @@ class Foo(object): def test_ntproperty_emptyarray(nt: NetworkTableInstance): with pytest.raises(TypeError): - class Foo1(object): + class Foo1: testArray = ntproperty( "/SmartDashboard/testArray", [], writeDefault=True, inst=nt ) with pytest.raises(TypeError): - class Foo2(object): + class Foo2: testArray = ntproperty( "/SmartDashboard/testArray", [], writeDefault=False, inst=nt ) @@ -106,7 +106,7 @@ def test_ntproperty_multitest(nt: NetworkTableInstance): pyfrc tests """ - class Foo(object): + class Foo: robotTime = ntproperty( "/SmartDashboard/robotTime", 0.0, writeDefault=False, inst=nt ) From 5c4d455da9d406b05073118bb5c51f07278be997 Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:38:02 +1000 Subject: [PATCH 5/6] Fix UP015 (Unnecessary mode argument) ruff check --select=UP015 --fix --- devtools/update_pyproject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/update_pyproject.py b/devtools/update_pyproject.py index d09b990b..ffa5886d 100644 --- a/devtools/update_pyproject.py +++ b/devtools/update_pyproject.py @@ -40,7 +40,7 @@ def __init__(self, ctx: Context) -> None: # and retain all the comments self.subprojects: typing.Dict[str, ProjectInfo] = {} for name, project in self.ctx.subprojects.items(): - with open(project.pyproject_path, "r") as fp: + with open(project.pyproject_path) as fp: data = tomlkit.load(fp) self.subprojects[name] = ProjectInfo( From f902f04612d1d2bcae74ce0029f7fca41b63998d Mon Sep 17 00:00:00 2001 From: David Vo Date: Mon, 15 Sep 2025 16:44:51 +1000 Subject: [PATCH 6/6] Fix UP010 (Unnecessary `__future__` import `print_function` for target Python version) --- subprojects/pyntcore/tests/test_api.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/subprojects/pyntcore/tests/test_api.py b/subprojects/pyntcore/tests/test_api.py index 4f1bd5bf..88fc7ed9 100644 --- a/subprojects/pyntcore/tests/test_api.py +++ b/subprojects/pyntcore/tests/test_api.py @@ -4,8 +4,6 @@ # works correctly # -from __future__ import print_function - import pytest import logging