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.
Files changed (30) hide show
  1. {path_sync-0.7.1 → path_sync-0.7.2}/PKG-INFO +1 -1
  2. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/__init__.py +1 -1
  3. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_copy.py +1 -1
  4. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/models.py +19 -1
  5. {path_sync-0.7.1 → path_sync-0.7.2}/pyproject.toml +1 -1
  6. {path_sync-0.7.1 → path_sync-0.7.2}/.gitignore +0 -0
  7. {path_sync-0.7.1 → path_sync-0.7.2}/LICENSE +0 -0
  8. {path_sync-0.7.1 → path_sync-0.7.2}/README.md +0 -0
  9. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/__main__.py +0 -0
  10. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/__init__.py +0 -0
  11. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/auto_merge.py +0 -0
  12. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_boot.py +0 -0
  13. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_dep_update.py +0 -0
  14. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_options.py +0 -0
  15. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/cmd_validate.py +0 -0
  16. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/file_utils.py +0 -0
  17. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/git_ops.py +0 -0
  18. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/header.py +0 -0
  19. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/log_capture.py +0 -0
  20. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/models_dep.py +0 -0
  21. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/prompt_utils.py +0 -0
  22. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/typer_app.py +0 -0
  23. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/validation.py +0 -0
  24. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/verify.py +0 -0
  25. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/_internal/yaml_utils.py +0 -0
  26. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/config.py +0 -0
  27. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/copy.py +0 -0
  28. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/dep_update.py +0 -0
  29. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/sections.py +0 -0
  30. {path_sync-0.7.1 → path_sync-0.7.2}/path_sync/validate_no_changes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: path-sync
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Sync files from a source repo to multiple destination repos
5
5
  Author-email: EspenAlbert <espen.albert1@gmail.com>
6
6
  License-Expression: MIT
@@ -5,7 +5,7 @@ from path_sync import dep_update
5
5
  from path_sync import validate_no_changes
6
6
  from path_sync import config
7
7
 
8
- VERSION = "0.7.1"
8
+ VERSION = "0.7.2"
9
9
  __all__ = [
10
10
  "copy",
11
11
  "dep_update",
@@ -300,7 +300,7 @@ def _sync_paths(
300
300
  opts: CopyOptions,
301
301
  ) -> SyncResult:
302
302
  result = SyncResult()
303
- for mapping in config.paths:
303
+ for mapping in config.resolve_paths(dest):
304
304
  changes, paths = _sync_path(
305
305
  mapping,
306
306
  src_root,
@@ -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:
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "path-sync"
5
- version = "0.7.1"
5
+ version = "0.7.2"
6
6
  description = "Sync files from a source repo to multiple destination repos"
7
7
  requires-python = ">=3.13"
8
8
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes