From c5a393323c4de7c945c266c3e9d2459d8f7fdd18 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 26 Nov 2024 10:15:14 +0100 Subject: [PATCH 1/3] lint: specify ruff target-version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ruff` 0.8.0 (released 2024-11-22) no longer defaults to supporting Python 3.8, > Ruff now defaults to Python 3.9 instead of 3.8 if no explicit Python version > is configured using [`ruff.target-version`](https://docs.astral.sh/ruff/settings/#target-version) > or [`project.requires-python`](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#python-requires) > ([#13896](https://github.com/astral-sh/ruff/pull/13896)) > — https://github.com/astral-sh/ruff/blob/f3dac27e9aa6ac6a20fc2fb27ff2e4f5d369b076/CHANGELOG.md#080 We want to support Python 3.8 until February 2025, so we need to set `target-version`. > The minimum Python version to target, e.g., when considering automatic code > upgrades, like rewriting type annotations. Ruff will not propose changes > using features that are not available in the given version. > — https://docs.astral.sh/ruff/settings/#target-version --- python_files/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/python_files/pyproject.toml b/python_files/pyproject.toml index afb9d372285c..7fb5e18339cb 100644 --- a/python_files/pyproject.toml +++ b/python_files/pyproject.toml @@ -23,6 +23,7 @@ ignore = [ [tool.ruff] line-length = 100 +target-version = "py38" exclude = [ "**/.data", "lib", From 987deb9049f277f8226d4a72b1a60854fba1e848 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 26 Nov 2024 11:04:30 +0100 Subject: [PATCH 2/3] lint: UP031 Use format specifiers instead of percent format --- python_files/visualstudio_py_testlauncher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_files/visualstudio_py_testlauncher.py b/python_files/visualstudio_py_testlauncher.py index 575f9d4fefc2..878491083a71 100644 --- a/python_files/visualstudio_py_testlauncher.py +++ b/python_files/visualstudio_py_testlauncher.py @@ -130,7 +130,7 @@ def send_event(self, name, **args): body = {"type": "event", "seq": self.seq, "event": name, "body": args} self.seq += 1 content = json.dumps(body).encode("utf8") - headers = ("Content-Length: %d\n\n" % (len(content),)).encode("utf8") + headers = f"Content-Length: {len(content)}\n\n".encode() self.socket.send(headers) self.socket.send(content) From 57908945deb3a0e5399154f7faf6acf193b461d2 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 26 Nov 2024 11:19:25 +0100 Subject: [PATCH 3/3] unpin ruff version --- .github/actions/lint/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index 60d396e353f3..9992b442c276 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -43,7 +43,7 @@ runs: - name: Run Ruff run: | - python -m pip install -U "ruff<0.8.0" + python -m pip install -U "ruff" python -m ruff check . python -m ruff format --check working-directory: python_files