Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: pip install -e ".[tests]"

- name: Run tests with coverage
run: pytest --cov=cala --cov-report=xml
run: pytest --log-cli-level=DEBUG --cov=cala --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
7 changes: 3 additions & 4 deletions pdm.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies = [
"pyyaml>=6.0.2",
"typer>=0.15.3",
"xarray-validate>=0.0.2",
"noob @ git+https://github.com/miniscope/noob.git@scheduler-optimize",
"noob @ git+https://github.com/miniscope/noob.git",
"natsort>=8.4.0",
]
keywords = [
Expand Down
4 changes: 3 additions & 1 deletion src/cala/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LogConfig(BaseModel):
"""
Severity for stream-based logging. If unset, use ``level``
"""
dir: Path = _dirs.user_log_dir
dir: Path = Path(_dirs.user_log_dir)
"""
Directory where logs are stored.
"""
Expand All @@ -48,6 +48,7 @@ class LogConfig(BaseModel):
"""
Maximum size of log files (bytes)
"""
model_config = SettingsConfigDict(validate_default=True)

@field_validator("level", "level_file", "level_stdout", mode="before")
@classmethod
Expand Down Expand Up @@ -75,6 +76,7 @@ class Config(BaseSettings, YAMLMixin):
nested_model_default_partial_update=True,
yaml_file="cala_config.yaml",
pyproject_toml_table_header=("tool", "cala", "config"),
validate_default=True,
)

logs: LogConfig = LogConfig()
Expand Down
1 change: 0 additions & 1 deletion src/cala/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def _init_root(
stream_handlers = [
handler for handler in root_logger.handlers if isinstance(handler, RichHandler)
]

if log_dir is not False and not file_handlers:
root_logger.addHandler(
_file_handler(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_config(tmp_path):
"""
Config should be able to make directories and set sensible defaults
"""
config = Config(user_dir=tmp_path)
config = Config(user_dir=tmp_path, logs={"dir": tmp_path / "log"})
assert config.user_dir.exists()
assert config.logs.dir.exists()

Expand Down