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 <noreply@anthropic.com>
This commit is contained in:
Safi
2026-06-02 21:12:43 +01:00
co-authored by Claude Opus 4.8
parent 6137cdba43
commit adfe8f0794
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -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]
+4 -1
View File
@@ -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