-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Component
No response
Task Description
We currently have the 'toml' package listed as an optional requirement in the SDK:
https://github.com/opsmill/infrahub-sdk-python/blob/v1.14.0/pyproject.toml#L39
Since Python 3.11 there's a module called tomllib bundled with Python and according to https://realpython.com/python311-tomllib/ it looks like its API is the same as another package called tomli.
Meaning that when we import toml here:
https://github.com/opsmill/infrahub-sdk-python/blob/v1.14.0/infrahub_sdk/ctl/config.py#L7
We could instead have:
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllibThe pyproject.toml file would need to be updated to optionally install tomli when using Python 3.9 and 3.10 and when using Python 3.11 or above we wouldn't need to install any additional toml package and as such we can remove one of the external dependencies from the SDK.