Skip to content

Commit

Permalink
feat: add support for the [tool.dotenv] section in TOML configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pivoshenko committed Feb 9, 2025
1 parent ea0fe3c commit fe7185e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/poetry_plugin_dotenv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import tomlkit


CONFIG_SOURCES: dict[str, str] = {
"pyproject.toml": "tool.poetry.plugins.dotenv",
"os": "POETRY_PLUGIN_DOTENV_",
}
CONFIG_SOURCES: list[tuple[str, str]] = [
("pyproject.toml", "tool.poetry.plugins.dotenv"),
("pyproject.toml", "tool.dotenv"),
("os", "POETRY_PLUGIN_DOTENV_"),
]

_STR_BOOLEAN_MAPPING: dict[str, bool] = {
"y": True,
Expand Down Expand Up @@ -47,7 +48,7 @@ def __init__(self, working_dir: str) -> None:
super().__init__()

source_config = {}
for config_source, section in CONFIG_SOURCES.items():
for (config_source, section) in CONFIG_SOURCES:
if config_source.endswith(".toml"):
config = _load_config_from_toml(os.path.join(working_dir, config_source), section)

Expand Down

0 comments on commit fe7185e

Please sign in to comment.