Skip to content

Commit

Permalink
Add tomli import to support python<3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rffontenelle committed Aug 3, 2024
1 parent 1fbd5d0 commit e3e08eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion babel_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
import subprocess
from pathlib import Path

import tomllib
try:
import tomllib
except ImportError:
try:
import tomli as tomllib
except ImportError as ie:
raise ImportError(
"tomli or tomllib is required to parse pyproject.toml"
) from ie

PROJECT_DIR = Path(__file__).resolve().parent

Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# for babel_runner.py
setuptools
Babel
Jinja2
tomli; python_version < "3.10"

0 comments on commit e3e08eb

Please sign in to comment.