From d70900037cdae161ebfa0ea163bdc887fb9e8a31 Mon Sep 17 00:00:00 2001 From: Damian Shaw Date: Sun, 26 Jan 2025 11:27:38 -0500 Subject: [PATCH 1/3] Enable linting rule FA102 --- build-project.py | 3 ++- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-project.py b/build-project.py index 5f7cc204218..2108669ca6f 100755 --- a/build-project.py +++ b/build-project.py @@ -7,13 +7,14 @@ from os import PathLike from pathlib import Path from types import SimpleNamespace +from typing import Union class EnvBuilder(venv.EnvBuilder): """A subclass of venv.EnvBuilder that exposes the python executable command.""" def ensure_directories( - self, env_dir: str | bytes | PathLike[str] | PathLike[bytes] + self, env_dir: Union[str, bytes, "PathLike[str]", "PathLike[bytes]"] ) -> SimpleNamespace: context = super().ensure_directories(env_dir) self.env_exec_cmd = context.env_exec_cmd diff --git a/pyproject.toml b/pyproject.toml index 5d8dde277be..17f5effb2ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -184,6 +184,7 @@ select = [ "W", "RUF100", "UP", + "FA102", ] [tool.ruff.lint.isort] From 50b2f8c8a1d9dbd86c361de870e03d52d21a0f0e Mon Sep 17 00:00:00 2001 From: Damian Shaw Date: Sun, 26 Jan 2025 11:34:40 -0500 Subject: [PATCH 2/3] NEWS ENTRY --- news/13182.trivial.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/13182.trivial.rst diff --git a/news/13182.trivial.rst b/news/13182.trivial.rst new file mode 100644 index 00000000000..c2a4d5b79e5 --- /dev/null +++ b/news/13182.trivial.rst @@ -0,0 +1 @@ +Enabling linting rule FA102. From 2d42f9a472cabc20b6054e308a9affb11c388e09 Mon Sep 17 00:00:00 2001 From: Richard Si Date: Sun, 26 Jan 2025 12:16:16 -0500 Subject: [PATCH 3/3] Add comment to Ruff config --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 17f5effb2ae..ed79101bf06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -184,7 +184,7 @@ select = [ "W", "RUF100", "UP", - "FA102", + "FA102", # future-required-type-annotation ] [tool.ruff.lint.isort]