mirror of
https://github.com/safishamsi/graphify.git
synced 2026-09-21 21:16:31 +00:00
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:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user