From 66c1c0d24c0443d837ed2d71bd851e5908f5db2c Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 8 Aug 2025 19:23:08 -0500 Subject: [PATCH] Update the target Python version for Ruff to 3.7 in the `uv` module (#15183) This fixes our Ruff target Python version for our Python module, which avoids it enforcing things that break compatibility like https://github.com/astral-sh/uv/issues/15176 --------- Co-authored-by: arielle --- python/ruff.toml | 2 ++ python/uv/_find_uv.py | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 python/ruff.toml diff --git a/python/ruff.toml b/python/ruff.toml new file mode 100644 index 000000000..6ea05ff89 --- /dev/null +++ b/python/ruff.toml @@ -0,0 +1,2 @@ +# It is important to retain compatibility here. +target-version = "py37" diff --git a/python/uv/_find_uv.py b/python/uv/_find_uv.py index 12762e50c..ebe6b8d5a 100644 --- a/python/uv/_find_uv.py +++ b/python/uv/_find_uv.py @@ -76,11 +76,7 @@ def _matching_parents(path: str | None, match: str) -> str | None: if not all( fnmatch(part, match_part) - for part, match_part in ( - zip(reversed(parts), reversed(match_parts), strict=False) - if sys.version_info >= (3, 10) - else zip(reversed(parts), reversed(match_parts)) # noqa: B905 - ) + for part, match_part in zip(reversed(parts), reversed(match_parts)) ): return None