Skip to content

Commit c6049a4

Browse files
authored
Merge pull request #151 from Aharoni-Lab/config-debug
debug: CI/CD breaking config
2 parents df96878 + 25c57cf commit c6049a4

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: pip install -e ".[tests]"
3131

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

3535
- name: Upload coverage to Codecov
3636
uses: codecov/codecov-action@v4

pdm.lock

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434
"pyyaml>=6.0.2",
3535
"typer>=0.15.3",
3636
"xarray-validate>=0.0.2",
37-
"noob @ git+https://github.com/miniscope/noob.git@scheduler-optimize",
37+
"noob @ git+https://github.com/miniscope/noob.git",
3838
"natsort>=8.4.0",
3939
]
4040
keywords = [

src/cala/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LogConfig(BaseModel):
3636
"""
3737
Severity for stream-based logging. If unset, use ``level``
3838
"""
39-
dir: Path = _dirs.user_log_dir
39+
dir: Path = Path(_dirs.user_log_dir)
4040
"""
4141
Directory where logs are stored.
4242
"""
@@ -48,6 +48,7 @@ class LogConfig(BaseModel):
4848
"""
4949
Maximum size of log files (bytes)
5050
"""
51+
model_config = SettingsConfigDict(validate_default=True)
5152

5253
@field_validator("level", "level_file", "level_stdout", mode="before")
5354
@classmethod
@@ -75,6 +76,7 @@ class Config(BaseSettings, YAMLMixin):
7576
nested_model_default_partial_update=True,
7677
yaml_file="cala_config.yaml",
7778
pyproject_toml_table_header=("tool", "cala", "config"),
79+
validate_default=True,
7880
)
7981

8082
logs: LogConfig = LogConfig()

src/cala/logging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def _init_root(
115115
stream_handlers = [
116116
handler for handler in root_logger.handlers if isinstance(handler, RichHandler)
117117
]
118-
119118
if log_dir is not False and not file_handlers:
120119
root_logger.addHandler(
121120
_file_handler(

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def test_config(tmp_path):
88
"""
99
Config should be able to make directories and set sensible defaults
1010
"""
11-
config = Config(user_dir=tmp_path)
11+
config = Config(user_dir=tmp_path, logs={"dir": tmp_path / "log"})
1212
assert config.user_dir.exists()
1313
assert config.logs.dir.exists()
1414

0 commit comments

Comments
 (0)