Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ jobs:

- name: Upload coverage data
if: always() && matrix.session == 'tests'
uses: "actions/upload-artifact@v3"
uses: actions/upload-artifact@v4
with:
name: coverage-data
path: ".coverage.*"

- name: Upload documentation
if: matrix.session == 'docs-build'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ dmypy.json
cython_debug/s

.DS_Store

# vscode
.vscode
104 changes: 83 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ Changelog = "https://github.com/dbatten5/maison/releases"
[tool.poetry.dependencies]
python = "^3.9.1"
click = "^8.0.1"
toml = "^0.10.2"
rtoml = "^0.12.0"
jinja2 = "^3.1.6"
starlette = "^0.40.0"
virtualenv = "^20.26.6"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.0"
Expand Down
6 changes: 3 additions & 3 deletions src/maison/config_sources/toml_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any
from typing import Dict

import toml
import rtoml

from ..errors import BadTomlError
from .base_source import BaseSource
Expand Down Expand Up @@ -32,8 +32,8 @@ def _load_file(self) -> Dict[Any, Any]:
BadTomlError: If toml cannot be parsed
"""
try:
return dict(toml.load(self.filepath))
except toml.decoder.TomlDecodeError as exc:
return dict(rtoml.load(self.filepath))
except rtoml.TomlParsingError as exc:
raise BadTomlError(
f"Error trying to load toml file '{self.filepath}'"
) from exc
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Optional

import pytest
import toml
import rtoml


@pytest.fixture(name="create_tmp_file")
Expand All @@ -31,7 +31,7 @@ def _create_toml(
content: Optional[Dict[str, Any]] = None,
) -> Path:
content = content or {}
config_toml = toml.dumps(content)
config_toml = rtoml.dumps(content)
return create_tmp_file(content=config_toml, filename=filename)

return _create_toml
Expand Down
Loading