We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f942609 commit b792772Copy full SHA for b792772
infrahub_sdk/ctl/config.py
@@ -2,17 +2,22 @@
2
3
from __future__ import annotations
4
5
+import sys
6
from pathlib import Path
7
+from typing import TYPE_CHECKING
8
9
import typer
10
from pydantic import Field, ValidationError, field_validator
11
from pydantic_settings import BaseSettings, SettingsConfigDict
12
-try:
13
+if sys.version_info >= (3, 11):
14
import tomllib
-except ModuleNotFoundError:
15
+else:
16
import tomli as tomllib
17
18
+if TYPE_CHECKING:
19
+ import tomllib
20
+
21
DEFAULT_CONFIG_FILE = "infrahubctl.toml"
22
ENVVAR_CONFIG_FILE = "INFRAHUBCTL_CONFIG"
23
INFRAHUB_REPO_CONFIG_FILE = ".infrahub.yml"
0 commit comments