Skip to content

Commit

Permalink
fix mypy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygoy committed Feb 2, 2024
1 parent f76038b commit e34ab96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 8 additions & 6 deletions screenpy/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def _parse_pyproject_toml(self) -> dict[str, Any]:
with pyproject_path.open("rb") as f:
pyproject_toml = tomllib.load(f)
toml_config: dict[str, Any] = pyproject_toml.get("tool", {})
tool_steps = self.config["tool_path"].split(".")
if hasattr(self.settings_cls, "_tool_path"):
tool_path = self.settings_cls._tool_path.get_default()
else:
tool_path = ""
tool_steps = tool_path.split(".")
for subtool in tool_steps:
toml_config = toml_config.get(subtool, {})

Expand Down Expand Up @@ -82,8 +86,7 @@ def prepare_field_value(
field_name: str, # noqa: ARG002
field: FieldInfo, # noqa: ARG002
value: Any, # noqa: ANN401
*,
value_is_complex: bool, # noqa: ARG002
value_is_complex: bool, # noqa: ARG002, FBT001
) -> Any: # noqa: ANN401
"""Return the value as-is, we do not need to prepare it.
Expand Down Expand Up @@ -117,9 +120,8 @@ class ScreenPySettings(BaseSettings):
SCREENPY_TIMEOUT=60 # sets the default timeout length to 60 seconds
"""

model_config = SettingsConfigDict(
tool_path="screenpy", env_prefix="SCREENPY_", frozen=False
)
_tool_path = "screenpy"
model_config = SettingsConfigDict(env_prefix="SCREENPY_", frozen=False)

TIMEOUT: float = 20
"""
Expand Down
5 changes: 2 additions & 3 deletions screenpy/narration/stdout_adapter/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ class StdOutAdapterSettings(ScreenPySettings):
SCREENPY_STDOUTADAPTER_INDENT_CHAR=">" # sets the indent char to >
"""

model_config = SettingsConfigDict(
tool_path="screenpy.stdoutadapter", env_prefix="SCREENPY_STDOUTADAPTER_"
)
_tool_path = "screenpy.stdoutadapter"
model_config = SettingsConfigDict(env_prefix="SCREENPY_STDOUTADAPTER_")

INDENT_LOGS: bool = True
"""Whether or not to use indentation in logging."""
Expand Down

0 comments on commit e34ab96

Please sign in to comment.