You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2025/04/10 19:28:47 UTC

(lucene) branch branch_10x updated: build(deps): bump ruff from 0.9.10 to 0.11.5 in /dev-tools/scripts (#14471)

This is an automated email from the ASF dual-hosted git repository.

rmuir pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_10x by this push:
     new 5d44a04549b build(deps): bump ruff from 0.9.10 to 0.11.5 in /dev-tools/scripts (#14471)
5d44a04549b is described below

commit 5d44a04549bf5bcc24662074359ea4bb76594baf
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Thu Apr 10 15:26:36 2025 -0400

    build(deps): bump ruff from 0.9.10 to 0.11.5 in /dev-tools/scripts (#14471)
    
    * build(deps): bump ruff from 0.9.10 to 0.11.5 in /dev-tools/scripts
    
    Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.10 to 0.11.5.
    - [Release notes](https://github.com/astral-sh/ruff/releases)
    - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/astral-sh/ruff/compare/0.9.10...0.11.5)
    
    ---
    updated-dependencies:
    - dependency-name: ruff
      dependency-version: 0.11.5
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <su...@github.com>
    
    * fix failures from new checks in the upgraded linter
    
    apply autofixes for most of the new ones: `make autofix`, disable the
    other new rule for now as Pathlib is not yet in use. Move an import to
    the typechecking block
    
    ---------
    
    Signed-off-by: dependabot[bot] <su...@github.com>
    Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
    Co-authored-by: Robert Muir <rm...@apache.org>
---
 dev-tools/scripts/githubPRs.py     |  4 ++--
 dev-tools/scripts/pyproject.toml   |  1 +
 dev-tools/scripts/releaseWizard.py | 24 ++++++++++++------------
 dev-tools/scripts/requirements.txt |  2 +-
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/dev-tools/scripts/githubPRs.py b/dev-tools/scripts/githubPRs.py
index 47853ec6632..dcecd7e9cdb 100755
--- a/dev-tools/scripts/githubPRs.py
+++ b/dev-tools/scripts/githubPRs.py
@@ -30,10 +30,10 @@ from typing import TYPE_CHECKING, Any, cast
 from github import Github
 from jinja2 import BaseLoader, Environment
 from jira import JIRA, Issue
-from jira.client import ResultList
 
 if TYPE_CHECKING:
   from github.PullRequest import PullRequest
+  from jira.client import ResultList
 
 
 def read_config():
@@ -114,7 +114,7 @@ def main():
     issue_ids.append(jira_issue_str)
     issue_to_pr[jira_issue_str] = pr
 
-  resolved_jiras = cast(ResultList[Issue], jira.search_issues(jql_str="key in (%s) AND status in ('Closed', 'Resolved')" % ", ".join(issue_ids)))
+  resolved_jiras = cast("ResultList[Issue]", jira.search_issues(jql_str="key in (%s) AND status in ('Closed', 'Resolved')" % ", ".join(issue_ids)))
   closed_jiras: list[dict[str, Any]] = []
   for issue in resolved_jiras:
     pr_title = issue_to_pr[issue.key].title
diff --git a/dev-tools/scripts/pyproject.toml b/dev-tools/scripts/pyproject.toml
index 24e5c507280..b2016446811 100644
--- a/dev-tools/scripts/pyproject.toml
+++ b/dev-tools/scripts/pyproject.toml
@@ -112,6 +112,7 @@ ignore = [
   "PTH123",  # open should be replaced by Path.open
   "PTH202",  # os.path.getsize should be replaced by Path.stat.st_size
   "PTH207",  # glob should be replaced by Path.glob or Path.rglob
+  "PTH208",  # use pathlib.Path.iterdir() instead
   "PYI024",  # use typing.NamedTuple instead of collections.namedtuple
   "RET503",  # missing explicit return at end of function able to return non-None
   "RET504",  # unnecessary assignment before return
diff --git a/dev-tools/scripts/releaseWizard.py b/dev-tools/scripts/releaseWizard.py
index 963ae88c865..b7d24323368 100755
--- a/dev-tools/scripts/releaseWizard.py
+++ b/dev-tools/scripts/releaseWizard.py
@@ -124,7 +124,7 @@ def expand_jinja(text: str, vars: dict[str, Any] | None = None):
 
   try:
     env = Environment(lstrip_blocks=True, keep_trailing_newline=False, trim_blocks=True)
-    env.filters["path_join"] = lambda paths: os.path.join(*(cast(list[str], paths)))
+    env.filters["path_join"] = lambda paths: os.path.join(*(cast("list[str]", paths)))
     env.filters["expanduser"] = lambda path: os.path.expanduser(str(path))
     env.filters["formatdate"] = lambda date: (datetime.strftime(date, "%-d %B %Y") if date and isinstance(date, datetime) else "<date>")
     template = env.from_string(str(filled), globals=global_vars)
@@ -526,7 +526,7 @@ class ReleaseState:
     lst: list[Todo] = list(filter(lambda x: x.id == id, self.todos.values()))
     if len(lst) == 1:
       return lst[0].state
-    return cast(dict[Any, Any], {})
+    return cast("dict[Any, Any]", {})
 
   def get_release_folder(self):
     folder = os.path.join(self.config_path, self.release_version)
@@ -624,7 +624,7 @@ class TodoGroup(SecretYamlObject):
   @override
   def from_yaml(cls, loader: yaml.Loader, node: yaml.MappingNode):
     fields = loader.construct_mapping(node, deep=True)
-    return TodoGroup(**cast(dict[str, Any], fields))
+    return TodoGroup(**cast("dict[str, Any]", fields))
 
   def num_done(self):
     return sum(1 for x in self.todos if x.is_done() > 0)
@@ -733,7 +733,7 @@ class Todo(SecretYamlObject):
   @override
   def from_yaml(cls, loader: yaml.Loader, node: yaml.MappingNode):
     fields = loader.construct_mapping(node, deep=True)
-    return Todo(**cast(dict[str, Any], fields))
+    return Todo(**cast("dict[str, Any]", fields))
 
   def get_vars(self):
     myvars: dict[str, str] = {}
@@ -920,10 +920,10 @@ def help():
 
 def ensure_list(o: Any):
   if o is None:
-    return cast(list[Any], [])
+    return cast("list[Any]", [])
   if not isinstance(o, list):
     return [o]
-  return cast(list[Any], o)
+  return cast("list[Any]", o)
 
 
 def open_file(filename: str):
@@ -1030,9 +1030,9 @@ def load_rc():
   lucenerc = os.path.expanduser("~/.lucenerc")
   try:
     with open(lucenerc) as fp:
-      return cast(dict[str, Any], json.load(fp))
+      return cast("dict[str, Any]", json.load(fp))
   except Exception:
-    return cast(dict[str, Any], {})
+    return cast("dict[str, Any]", {})
 
 
 def store_rc(release_root: str, release_version: str | None = None):
@@ -1552,7 +1552,7 @@ class Commands(SecretYamlObject):
   @override
   def from_yaml(cls, loader: yaml.Loader, node: yaml.MappingNode):
     fields = loader.construct_mapping(node, deep=True)
-    return Commands(**cast(dict[str, Any], fields))
+    return Commands(**cast("dict[str, Any]", fields))
 
   def run(self):  # pylint: disable=inconsistent-return-statements # TODO
     root = self.get_root_folder()
@@ -1669,7 +1669,7 @@ class Commands(SecretYamlObject):
       return success
 
   def get_root_folder(self):
-    return cast(str, self.jinjaify(self.root_folder))
+    return cast("str", self.jinjaify(self.root_folder))
 
   def get_commands_text(self):
     return self.jinjaify(self.commands_text)
@@ -1769,7 +1769,7 @@ class Command(SecretYamlObject):
   @override
   def from_yaml(cls, loader: yaml.Loader, node: yaml.MappingNode):
     fields = loader.construct_mapping(node, deep=True)
-    return Command(**cast(dict[str, Any], fields))
+    return Command(**cast("dict[str, Any]", fields))
 
   def get_comment(self):
     return str(self.jinjaify(self.comment))
@@ -1843,7 +1843,7 @@ class UserInput(SecretYamlObject):
   @override
   def from_yaml(cls, loader: yaml.Loader, node: yaml.MappingNode):
     fields = loader.construct_mapping(node, deep=True)
-    return UserInput(**cast(dict[str, Any], fields))
+    return UserInput(**cast("dict[str, Any]", fields))
 
   def run(self, dict: dict[str, Any] | None = None):
     correct = False
diff --git a/dev-tools/scripts/requirements.txt b/dev-tools/scripts/requirements.txt
index 8d83f2653eb..09181b93109 100644
--- a/dev-tools/scripts/requirements.txt
+++ b/dev-tools/scripts/requirements.txt
@@ -7,4 +7,4 @@ console-menu==0.8.0
 PyGithub==1.59.1
 jira==3.4.1
 basedpyright==1.28.5
-ruff==0.9.10
+ruff==0.11.5