From 3e77049a968f9402eb5093d33550dd8792ff67db Mon Sep 17 00:00:00 2001 From: Pavol Misik Date: Tue, 20 Aug 2024 21:16:27 +0200 Subject: [PATCH] Update ruff from 0.5.2 to 0.6.1 --- Makefile | 2 +- master/buildbot/test/unit/util/test_interfaces.py | 3 +++ master/buildbot/test/util/endpoint.py | 1 + requirements-ci.txt | 2 +- worker/buildbot_worker/commands/fs.py | 1 + worker/buildbot_worker/commands/utils.py | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 51f7e75be66f..d984b3dcf450 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ rmpyc: find master worker \( -name '*.pyc' -o -name '*.pyo' \) -exec rm -v {} \; ruff: - ruff --fix . + ruff format . docker: docker-buildbot-worker docker-buildbot-master echo done diff --git a/master/buildbot/test/unit/util/test_interfaces.py b/master/buildbot/test/unit/util/test_interfaces.py index c9bf8bbfb6de..d81975e7eb9e 100644 --- a/master/buildbot/test/unit/util/test_interfaces.py +++ b/master/buildbot/test/unit/util/test_interfaces.py @@ -32,6 +32,7 @@ def myfunc2(x, y=2, *args): @self.assertArgSpecMatches(myfunc) def myfunc3(x, y=3, *args): pass + except Exception as e: error = e else: @@ -59,6 +60,7 @@ def myfunc4(x, y): @self.assertArgSpecMatches(myfunc, myfunc3) def myfunc5(x, y): pass + except Exception as e: error = e else: @@ -72,6 +74,7 @@ def myfunc5(x, y): @self.assertArgSpecMatches(myfunc, myfunc3) def myfunc6(xx, yy): pass + except Exception as e: error = e else: diff --git a/master/buildbot/test/util/endpoint.py b/master/buildbot/test/util/endpoint.py index 2421f3581332..ba06abed6e94 100644 --- a/master/buildbot/test/util/endpoint.py +++ b/master/buildbot/test/util/endpoint.py @@ -106,6 +106,7 @@ def test_get_spec(self): @self.assertArgSpecMatches(self.ep.get) def get(self, resultSpec, kwargs): pass + except trial.unittest.FailTest: @self.assertArgSpecMatches(self.ep.get) diff --git a/requirements-ci.txt b/requirements-ci.txt index f2eda2682633..c23a95ea297a 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -62,7 +62,7 @@ pytz==2024.1 PyYAML==6.0.1 requests==2.32.3 responses==0.25.3 -ruff==0.5.2 +ruff==0.6.1 s3transfer==0.10.2 service-identity==24.1.0 setuptools-trial==0.6.0 diff --git a/worker/buildbot_worker/commands/fs.py b/worker/buildbot_worker/commands/fs.py index 3b8154b14426..5c0a45e0e5b1 100644 --- a/worker/buildbot_worker/commands/fs.py +++ b/worker/buildbot_worker/commands/fs.py @@ -195,6 +195,7 @@ def eb(f): @d.addCallback def send_rc(rc): self.sendStatus([('rc', rc)]) + else: if not os.path.exists(os.path.dirname(to_path)): os.makedirs(os.path.dirname(to_path)) diff --git a/worker/buildbot_worker/commands/utils.py b/worker/buildbot_worker/commands/utils.py index dffb95ee5a63..87d7dbabfa3e 100644 --- a/worker/buildbot_worker/commands/utils.py +++ b/worker/buildbot_worker/commands/utils.py @@ -103,6 +103,7 @@ def rmdirRecursive(dir): os.chmod(full_name, 0o700) os.remove(full_name) os.rmdir(dir) + else: # use rmtree on POSIX import shutil