From adfe8f079445981381270a2f2d3b0e7fc05db9db Mon Sep 17 00:00:00 2001 From: Safi Date: Tue, 2 Jun 2026 21:12:43 +0100 Subject: [PATCH] make skillgen's toml import work on Python 3.10 gen.py imported tomllib unconditionally, but that is 3.11+ stdlib only and graphify supports (and CI tests) 3.10 - so importing tools.skillgen.gen, and thus collecting test_skillgen.py, crashed the 3.10 test job with ModuleNotFoundError. Fall back to the tomli backport on <3.11 and add tomli to the dev group under that marker. Verified the fallback loads and parses with tomllib forced absent. Co-Authored-By: Claude Opus 4.8 --- pyproject.toml | 1 + tools/skillgen/gen.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 00f6ee39..a2d2064f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,7 @@ dev = [ "safety>=3.7.0", "setuptools>=82.0.1", "wheel>=0.47.0", + "tomli>=2.0 ; python_version < '3.11'", ] [tool.uv] diff --git a/tools/skillgen/gen.py b/tools/skillgen/gen.py index b91505c1..7e9c80aa 100644 --- a/tools/skillgen/gen.py +++ b/tools/skillgen/gen.py @@ -27,7 +27,10 @@ import argparse import re import subprocess import sys -import tomllib +try: + import tomllib # Python 3.11+ stdlib +except ModuleNotFoundError: # Python 3.10 - graphify supports >=3.10 + import tomli as tomllib # type: ignore[no-redef] from dataclasses import dataclass, field from pathlib import Path