Skip to content

Commit c561415

Browse files
author
Dev Engineer
committed
fix: add tomli dependency for Python 3.10 compatibility
- Add tomli>=2.0 as conditional dependency for Python < 3.11 - Fix test_edge_cases.py to use try/except import for tomllib/tomli - This fixes CI failures on Python 3.10 where tomllib is not in stdlib
1 parent 3083e1a commit c561415

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dev = [
3838
"pytest>=7.0",
3939
"pytest-cov>=4.0",
4040
"ruff>=0.4.0",
41+
"tomli>=2.0; python_version < '3.11'",
4142
]
4243
# Duplicate license entries removed.
4344

tests/test_edge_cases.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
from io import StringIO
1010
from pathlib import Path
1111

12-
import tomllib
12+
try:
13+
import tomllib
14+
except ImportError:
15+
import tomli as tomllib
1316
from rich.console import Console
1417

1518
from deploydiff.cli import _load_plan, _render_costs

0 commit comments

Comments
 (0)