Skip to content

The agent engineering platform.

fix: `scripts/` errors

Mason Daugherty6f10160a45ae
diff --git a/scripts/release_branch.py b/scripts/release_branch.py
index 91d4f3b007..a7d0c2e06c 100644
--- a/scripts/release_branch.py
+++ b/scripts/release_branch.py
@@ -3,11 +3,13 @@ python scripts/release_branch.py anthropic bagatur
"""
import glob
-import tomllib
-import toml
import subprocess
import sys
+# Ignoring errors since this script is run in a controlled environment
+import toml # type: ignore # pyright: ignore[reportMissingModuleSource]
+import tomllib # type: ignore # pyright: ignore[reportMissingImports]
+
def main(*args):
pkg = args[1]
diff --git a/scripts/update_mypy_ruff.py b/scripts/update_mypy_ruff.py
index 3bfd143969..d5e66856ff 100644
--- a/scripts/update_mypy_ruff.py
+++ b/scripts/update_mypy_ruff.py
@@ -1,12 +1,13 @@
"""python scripts/update_mypy_ruff.py"""
import glob
-import tomllib
+import re
+import subprocess
from pathlib import Path
-import toml
-import subprocess
-import re
+# Ignoring errors since this script is run in a controlled environment
+import toml # type: ignore # pyright: ignore[reportMissingModuleSource]
+import tomllib # type: ignore # pyright: ignore[reportMissingImports]
ROOT_DIR = Path(__file__).parents[1]
@@ -50,10 +51,9 @@ def main():
to_ignore = {}
for l in logs:
- if re.match("^(.*)\:(\d+)\: error:.*\[(.*)\]", l):
- path, line_no, error_type = re.match(
- "^(.*)\:(\d+)\: error:.*\[(.*)\]", l
- ).groups()
+ match = re.match(r"^(.*):(\d+): error:.*\[(.*)\]", l)
+ if match:
+ path, line_no, error_type = match.groups()
if (path, line_no) in to_ignore:
to_ignore[(path, line_no)].append(error_type)
else: