Skip to content

Commit

Permalink
feat(config): replace tomli with tomlkit
Browse files Browse the repository at this point in the history
  • Loading branch information
pivoshenko committed May 6, 2024
1 parent fa900c6 commit 4381b66
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/poetry_plugin_dotenv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pathlib import Path

import tomli
import tomlkit


CONFIG_SOURCES: dict[str, str] = {
Expand Down Expand Up @@ -39,8 +39,7 @@ class _Config:
location: str | None = None


# TODO(pivoshenko): this configuration loader is a "quick patch" solution.
# It should be considered to rewrite it
# TODO(pivoshenko): this configuration loader is a "quick patch" solution
class Config(_Config):
"""Configuration loader."""

Expand Down Expand Up @@ -87,7 +86,7 @@ def _load_config_from_toml(

if filepath.exists():
with filepath.open("rb") as toml_file:
toml = tomli.load(toml_file)
toml = tomlkit.load(toml_file)

config = toml
for key in section.split("."):
Expand All @@ -113,7 +112,7 @@ def _load_config_from_os(
def _as_bool(value: str) -> bool:
"""Given a string value that represents True or False, returns the Boolean equivalent.
Heavily inspired from distutils strtobool.
Heavily inspired from ``distutils strtobool``.
"""

try:
Expand Down

0 comments on commit 4381b66

Please sign in to comment.