Fix CI failures: linting and dependency vulnerabilities

- Apply code formatting fixes (black) to resolve test workflow failures.
- Update `pyproject.toml`, `src/requirements.txt`, and lock files to upgrade vulnerable dependencies:
  - aiohttp -> 3.13.3
  - cryptography -> 46.0.5
  - orjson -> 3.11.7 (CVE-2025-67221)
  - pillow -> 12.1.1 (CVE-2026-25990)
  - pynacl -> 1.6.2 (CVE-2025-69277)
  - starlette -> 0.52.1 (CVE-2025-62727)
  - urllib3 -> 2.6.3 (CVE-2025-66418, etc.)
  - cbor2 -> 5.8.0 (CVE-2025-68131)
  - pyasn1 -> 0.6.2 (CVE-2026-23490)
  - python-multipart -> 0.0.22 (CVE-2026-24486)
- Manually sync `requirements.lock` from `poetry.lock` as `pip-compile` is unavailable in the environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-25 19:24:01 +00:00
1 parent d42ee42a68
commit 4a1529fd1a
11 files changed
+1081 -907

No files matched your search

+28 -19
View File
@@ -2,16 +2,23 @@ import os
import subprocess
import sys
def get_all_files(extensions=['.mjs', '.js']):
def get_all_files(extensions=[".mjs", ".js"]):
files = []
for root, dirs, filenames in os.walk('.'):
if 'node_modules' in root or '.git' in root or 'artifacts' in root or 'dist' in root:
for root, dirs, filenames in os.walk("."):
if (
"node_modules" in root
or ".git" in root
or "artifacts" in root
or "dist" in root
):
continue
for filename in filenames:
if any(filename.endswith(ext) for ext in extensions):
files.append(os.path.join(root, filename))
return files
def grep_file(filepath, all_files):
filename = os.path.basename(filepath)
name_no_ext = os.path.splitext(filename)[0]
@@ -31,16 +38,16 @@ def grep_file(filepath, all_files):
# Search for filename (e.g. "foo.mjs")
result_full = subprocess.run(
['git', 'grep', '-F', filename, '--', '.'],
capture_output=True, text=True
["git", "grep", "-F", filename, "--", "."], capture_output=True, text=True
)
# Search for name without extension (e.g. "foo") if it's not "index"
result_no_ext = None
if name_no_ext != 'index':
result_no_ext = subprocess.run(
['git', 'grep', '-F', name_no_ext, '--', '.'],
capture_output=True, text=True
if name_no_ext != "index":
result_no_ext = subprocess.run(
["git", "grep", "-F", name_no_ext, "--", "."],
capture_output=True,
text=True,
)
output = result_full.stdout
@@ -52,14 +59,15 @@ def grep_file(filepath, all_files):
# Filter out self-references
count = 0
for line in lines:
if line.startswith(filepath.lstrip('./')):
if line.startswith(filepath.lstrip("./")):
continue
count += 1
return count
except Exception as e:
print(f"Error grepping {filepath}: {e}")
return 1 # Assume used on error
return 1 # Assume used on error
def main():
files = get_all_files()
@@ -68,11 +76,11 @@ def main():
# Known entry points or special files to exclude from "dead" list immediately
# These might not be imported but are used by scripts or configuration
exclusions = [
'./bin/torch-lock.mjs',
'./src/lib.mjs', # Main entry
'./src/constants.mjs', # Likely used
'./build.mjs',
'./eslint.config.mjs',
"./bin/torch-lock.mjs",
"./src/lib.mjs", # Main entry
"./src/constants.mjs", # Likely used
"./build.mjs",
"./eslint.config.mjs",
]
print(f"Scanning {len(files)} files...")
@@ -82,7 +90,7 @@ def main():
continue
# Skip test files
if '.test.' in f or '/test/' in f or '/tests/' in f:
if ".test." in f or "/test/" in f or "/tests/" in f:
continue
count = grep_file(f, files)
@@ -94,9 +102,10 @@ def main():
print("No candidates found.")
else:
print(f"Found {len(candidates)} candidates.")
with open('artifacts/candidates.txt', 'w') as f_out:
with open("artifacts/candidates.txt", "w") as f_out:
for c in candidates:
f_out.write(c + '\n')
f_out.write(c + "\n")
if __name__ == "__main__":
main()