path-sync 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {path_sync-0.7.1 → path_sync-0.7.2}/PKG-INFO +1 -1
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/__init__.py +1 -1
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_copy.py +1 -1
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/models.py +19 -1
- {path_sync-0.7.1 → path_sync-0.7.2}/pyproject.toml +1 -1
- {path_sync-0.7.1 → path_sync-0.7.2}/.gitignore +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/LICENSE +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/README.md +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/__main__.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/__init__.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/auto_merge.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_boot.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_dep_update.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_options.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_validate.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/file_utils.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/git_ops.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/header.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/log_capture.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/models_dep.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/prompt_utils.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/typer_app.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/validation.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/verify.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/yaml_utils.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/config.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/copy.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/dep_update.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/sections.py +0 -0
- {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/validate_no_changes.py +0 -0
|
@@ -6,7 +6,7 @@ from enum import StrEnum
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from typing import ClassVar
|
|
8
8
|
|
|
9
|
-
from pydantic import BaseModel, Field
|
|
9
|
+
from pydantic import BaseModel, Field, model_validator
|
|
10
10
|
|
|
11
11
|
LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
|
12
12
|
|
|
@@ -166,6 +166,7 @@ class Destination(BaseModel):
|
|
|
166
166
|
default_branch: str = "main"
|
|
167
167
|
skip_sections: dict[str, list[str]] = Field(default_factory=dict)
|
|
168
168
|
skip_file_patterns: set[str] = Field(default_factory=set)
|
|
169
|
+
include_groups: list[str] = Field(default_factory=list)
|
|
169
170
|
verify: VerifyConfig | None = None
|
|
170
171
|
|
|
171
172
|
def resolved_copy_branch(self, config_name: str) -> str:
|
|
@@ -188,11 +189,28 @@ class SrcConfig(BaseModel):
|
|
|
188
189
|
header_config: HeaderConfig = Field(default_factory=HeaderConfig)
|
|
189
190
|
pr_defaults: PRDefaults = Field(default_factory=PRDefaults)
|
|
190
191
|
paths: list[PathMapping] = Field(default_factory=list)
|
|
192
|
+
path_groups: dict[str, list[PathMapping]] = Field(default_factory=dict)
|
|
191
193
|
destinations: list[Destination] = Field(default_factory=list)
|
|
192
194
|
verify: VerifyConfig | None = None
|
|
193
195
|
wrap_synced_files: bool = False
|
|
194
196
|
auto_merge: AutoMergeConfig | None = None
|
|
195
197
|
|
|
198
|
+
@model_validator(mode="after")
|
|
199
|
+
def _validate_include_groups(self) -> SrcConfig:
|
|
200
|
+
for dest in self.destinations:
|
|
201
|
+
seen: set[str] = set()
|
|
202
|
+
for group in dest.include_groups:
|
|
203
|
+
if group not in self.path_groups:
|
|
204
|
+
raise ValueError(f"Destination {dest.name!r} references unknown path_group {group!r}")
|
|
205
|
+
if group in seen:
|
|
206
|
+
raise ValueError(f"Destination {dest.name!r} has duplicate include_group {group!r}")
|
|
207
|
+
seen.add(group)
|
|
208
|
+
return self
|
|
209
|
+
|
|
210
|
+
def resolve_paths(self, dest: Destination) -> list[PathMapping]:
|
|
211
|
+
extra = [m for g in dest.include_groups for m in self.path_groups[g]]
|
|
212
|
+
return self.paths + extra if extra else self.paths
|
|
213
|
+
|
|
196
214
|
def find_destination(self, name: str) -> Destination:
|
|
197
215
|
for dest in self.destinations:
|
|
198
216
|
if dest.name == name:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|