From 634a488ed6348d5aef5f1ecc9e3711536c5f4a1b Mon Sep 17 00:00:00 2001 From: robcxyz Date: Sun, 7 Jan 2024 21:31:23 -0800 Subject: [PATCH] chore: fix toml imports with extra requires --- providers/toml/hooks/tomls.py | 5 ++++- providers/toml/requirements.txt | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 providers/toml/requirements.txt diff --git a/providers/toml/hooks/tomls.py b/providers/toml/hooks/tomls.py index 8faf239a..ab07ea66 100644 --- a/providers/toml/hooks/tomls.py +++ b/providers/toml/hooks/tomls.py @@ -1,7 +1,10 @@ import os from typing import Union -import tomli as toml +try: + import tomllib as toml +except ImportError: + import tomli as toml from tackle import BaseHook, Field diff --git a/providers/toml/requirements.txt b/providers/toml/requirements.txt new file mode 100644 index 00000000..9472a187 --- /dev/null +++ b/providers/toml/requirements.txt @@ -0,0 +1,2 @@ +# this is temporary - py3.11 has this included +tomli \ No newline at end of file