ci: add pre-commit and tests workflows
This commit is contained in:
parent
ee43046e59
commit
bdb5c984fa
13 changed files with 339 additions and 297 deletions
|
|
@ -71,19 +71,14 @@ def notebooks_path(tmp_path) -> Path:
|
|||
|
||||
@pytest.fixture()
|
||||
def settings(notebooks_path: Path, halig_ssh_path) -> Settings:
|
||||
return Settings(
|
||||
notebooks_root_path=notebooks_path,
|
||||
identity_paths=[halig_ssh_path / "id_ed25519"],
|
||||
recipient_paths=[halig_ssh_path / "id_ed25519.pub"]
|
||||
)
|
||||
return Settings(notebooks_root_path=notebooks_path,identity_paths=[halig_ssh_path / "id_ed25519"],recipient_paths=[halig_ssh_path / "id_ed25519.pub"])
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def settings_file_path(halig_config_path: Path, notebooks_path: Path) -> Path:
|
||||
def settings_file_path(settings, halig_config_path: Path, notebooks_path: Path) -> Path:
|
||||
yaml_file = halig_config_path / "halig.yml"
|
||||
yaml_file.touch()
|
||||
s = Settings(notebooks_root_path=notebooks_path)
|
||||
# `.dict()` doesn't serialize some fields that yaml doesn't understand
|
||||
s = Settings(notebooks_root_path=notebooks_path, identity_paths=settings.identity_paths, recipient_paths=settings.recipient_paths)
|
||||
serialized = json.loads(s.model_dump_json())
|
||||
with yaml_file.open("w") as f:
|
||||
yaml.safe_dump(serialized, f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue