From 4c49a58e9beab05d91c1afe048e0f23cb6eb088d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Fri, 14 Aug 2026 13:47:25 -0700 Subject: [PATCH] fix(ci): support py3.10 in check_git_deps import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tomllib is stdlib only on 3.11+, so scripts/check_git_deps.py raised ModuleNotFoundError on the 3.10 test matrix leg. Because docker-validation depends on the test job, this reddened every push to main since the check landed (#104) — blocking release-please and all image publishes, so the SLS-377 torchvision fix (#101) and later merges never shipped. PR CI only runs 3.11/3.12, so it passed review; push-to-main runs the full 3.10-3.14 matrix and caught it. Guard the import with a tomli backport for <3.11 and add tomli to the dev group under the same marker. --- pyproject.toml | 3 +++ scripts/check_git_deps.py | 6 +++++- uv.lock | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b06a30a..e3c0cd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,9 @@ dev = [ "mcp>=1.0.0", "typer>=0.12.0", "rich>=14.0.0", + # tomllib is stdlib only on 3.11+; scripts/check_git_deps.py needs the + # backport to run under the 3.10 CI matrix leg. + "tomli>=2.0.0; python_version < '3.11'", ] [tool.pytest.ini_options] diff --git a/scripts/check_git_deps.py b/scripts/check_git_deps.py index e97d642..610817b 100644 --- a/scripts/check_git_deps.py +++ b/scripts/check_git_deps.py @@ -22,10 +22,14 @@ from __future__ import annotations import sys -import tomllib from pathlib import Path from typing import Any +if sys.version_info >= (3, 11): + import tomllib +else: # tomllib is stdlib only on 3.11+; tomli is the drop-in backport + import tomli as tomllib + GIT_MARKERS = ("git+", "git://") DEFAULT_PYPROJECT = "pyproject.toml" diff --git a/uv.lock b/uv.lock index de5affa..b5a3d75 100644 --- a/uv.lock +++ b/uv.lock @@ -3056,6 +3056,7 @@ dev = [ { name = "pytest-xdist" }, { name = "rich" }, { name = "ruff" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "typer" }, { name = "types-requests" }, ] @@ -3085,6 +3086,7 @@ dev = [ { name = "pytest-xdist", specifier = ">=3.5.0" }, { name = "rich", specifier = ">=14.0.0" }, { name = "ruff", specifier = ">=0.8.0" }, + { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0.0" }, { name = "typer", specifier = ">=0.12.0" }, { name = "types-requests", specifier = ">=2.25.0" }, ]