path-sync 0.3.4__tar.gz → 0.3.5__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.3.4 → path_sync-0.3.5}/PKG-INFO +7 -2
- {path_sync-0.3.4 → path_sync-0.3.5}/README.md +5 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/__init__.py +1 -1
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/cmd_copy.py +3 -3
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/validation.py +5 -2
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/sections.py +17 -6
- {path_sync-0.3.4 → path_sync-0.3.5}/pyproject.toml +9 -3
- {path_sync-0.3.4 → path_sync-0.3.5}/.gitignore +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/LICENSE +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/__main__.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/__init__.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/cmd_boot.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/cmd_validate.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/file_utils.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/git_ops.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/header.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/models.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/typer_app.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/_internal/yaml_utils.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/config.py +0 -0
- {path_sync-0.3.4 → path_sync-0.3.5}/path_sync/copy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: path-sync
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
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
|
|
@@ -13,11 +13,16 @@ Requires-Dist: gitpython>=3.1.0
|
|
|
13
13
|
Requires-Dist: pydantic>=2.0
|
|
14
14
|
Requires-Dist: pyyaml>=6.0
|
|
15
15
|
Requires-Dist: typer>=0.16.0
|
|
16
|
-
Requires-Dist: zero-3rdparty>=0.
|
|
16
|
+
Requires-Dist: zero-3rdparty>=0.102.0
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
19
19
|
# path-sync
|
|
20
20
|
|
|
21
|
+
[](https://pypi.org/project/path-sync/)
|
|
22
|
+
[](https://github.com/EspenAlbert/path-sync)
|
|
23
|
+
[](https://codecov.io/gh/EspenAlbert/path-sync)
|
|
24
|
+
[](https://espenalbert.github.io/path-sync/)
|
|
25
|
+
|
|
21
26
|
Sync files from a source repo to multiple destination repos.
|
|
22
27
|
|
|
23
28
|
## Overview
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# path-sync
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/path-sync/)
|
|
4
|
+
[](https://github.com/EspenAlbert/path-sync)
|
|
5
|
+
[](https://codecov.io/gh/EspenAlbert/path-sync)
|
|
6
|
+
[](https://espenalbert.github.io/path-sync/)
|
|
7
|
+
|
|
3
8
|
Sync files from a source repo to multiple destination repos.
|
|
4
9
|
|
|
5
10
|
## Overview
|
|
@@ -237,10 +237,10 @@ def _sync_destination(
|
|
|
237
237
|
|
|
238
238
|
# --no-checkout means "I'm already on the right branch"
|
|
239
239
|
# Prompt decline means "skip git operations for this run"
|
|
240
|
-
if opts.
|
|
241
|
-
skip_git_ops = False
|
|
242
|
-
elif opts.dry_run:
|
|
240
|
+
if opts.dry_run:
|
|
243
241
|
skip_git_ops = True
|
|
242
|
+
elif opts.no_checkout:
|
|
243
|
+
skip_git_ops = False
|
|
244
244
|
elif _prompt(f"Switch {dest.name} to {copy_branch}?", opts.no_prompt):
|
|
245
245
|
git_ops.prepare_copy_branch(
|
|
246
246
|
repo=dest_repo,
|
|
@@ -31,6 +31,7 @@ def validate_no_unauthorized_changes(
|
|
|
31
31
|
"""Find files with unauthorized changes in DO_NOT_EDIT sections.
|
|
32
32
|
|
|
33
33
|
Returns 'path:section_id' for section changes or 'path' for full-file.
|
|
34
|
+
Missing sections (user opted out) are warned but not treated as errors.
|
|
34
35
|
"""
|
|
35
36
|
repo = git_ops.get_repo(repo_root)
|
|
36
37
|
base_ref = f"origin/{default_branch}"
|
|
@@ -55,8 +56,10 @@ def validate_no_unauthorized_changes(
|
|
|
55
56
|
|
|
56
57
|
if baseline_has_sections:
|
|
57
58
|
file_skip = skip.get(rel_path, set())
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
changes = sections.changed_sections(baseline_content, current_content, path, file_skip)
|
|
60
|
+
for sid in changes.missing:
|
|
61
|
+
logger.warning(f"Section '{sid}' removed from {rel_path}, consider updating src.yaml")
|
|
62
|
+
unauthorized.extend(f"{rel_path}:{sid}" for sid in changes.modified)
|
|
60
63
|
elif current_has_sections:
|
|
61
64
|
unauthorized.append(rel_path)
|
|
62
65
|
else:
|
|
@@ -4,10 +4,11 @@ from pathlib import Path
|
|
|
4
4
|
|
|
5
5
|
from zero_3rdparty.sections import (
|
|
6
6
|
Section,
|
|
7
|
+
SectionChanges,
|
|
7
8
|
get_comment_config,
|
|
8
9
|
)
|
|
9
10
|
from zero_3rdparty.sections import (
|
|
10
|
-
|
|
11
|
+
changed_sections as _changed_sections,
|
|
11
12
|
)
|
|
12
13
|
from zero_3rdparty.sections import (
|
|
13
14
|
extract_sections as _extract_sections,
|
|
@@ -27,7 +28,8 @@ from zero_3rdparty.sections import (
|
|
|
27
28
|
|
|
28
29
|
__all__ = [
|
|
29
30
|
"Section",
|
|
30
|
-
"
|
|
31
|
+
"SectionChanges",
|
|
32
|
+
"changed_sections",
|
|
31
33
|
"extract_sections",
|
|
32
34
|
"has_sections",
|
|
33
35
|
"parse_sections",
|
|
@@ -59,14 +61,23 @@ def replace_sections(
|
|
|
59
61
|
src_sections: dict[str, str],
|
|
60
62
|
path: Path,
|
|
61
63
|
skip_sections: list[str] | None = None,
|
|
64
|
+
*,
|
|
65
|
+
keep_deleted_sections: bool = False,
|
|
62
66
|
) -> str:
|
|
63
|
-
return _replace_sections(
|
|
67
|
+
return _replace_sections(
|
|
68
|
+
dest_content,
|
|
69
|
+
src_sections,
|
|
70
|
+
TOOL_NAME,
|
|
71
|
+
get_comment_config(path),
|
|
72
|
+
skip_sections,
|
|
73
|
+
keep_deleted_sections=keep_deleted_sections,
|
|
74
|
+
)
|
|
64
75
|
|
|
65
76
|
|
|
66
|
-
def
|
|
77
|
+
def changed_sections(
|
|
67
78
|
baseline_content: str,
|
|
68
79
|
current_content: str,
|
|
69
80
|
path: Path,
|
|
70
81
|
skip: set[str] | None = None,
|
|
71
|
-
) ->
|
|
72
|
-
return
|
|
82
|
+
) -> SectionChanges:
|
|
83
|
+
return _changed_sections(baseline_content, current_content, TOOL_NAME, get_comment_config(path), skip, str(path))
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# path-sync copy -n python-template
|
|
2
2
|
|
|
3
|
-
# === OK_EDIT: path-sync header ===
|
|
4
3
|
[project]
|
|
5
4
|
name = "path-sync"
|
|
6
|
-
version = "0.3.
|
|
5
|
+
version = "0.3.5"
|
|
7
6
|
description = "Sync files from a source repo to multiple destination repos"
|
|
8
7
|
requires-python = ">=3.13"
|
|
9
8
|
license = "MIT"
|
|
@@ -29,7 +28,7 @@ dependencies = [
|
|
|
29
28
|
"pyyaml>=6.0",
|
|
30
29
|
"typer>=0.16.0",
|
|
31
30
|
"gitpython>=3.1.0",
|
|
32
|
-
"zero-3rdparty>=0.
|
|
31
|
+
"zero-3rdparty>=0.102.0",
|
|
33
32
|
]
|
|
34
33
|
|
|
35
34
|
[project.scripts]
|
|
@@ -75,6 +74,7 @@ extend-select = ["Q", "RUF100", "C90", "UP", "I", "T"]
|
|
|
75
74
|
[tool.pytest.ini_options]
|
|
76
75
|
addopts = "-s -vv --log-cli-level=INFO"
|
|
77
76
|
python_files = ["*_test.py", "test_*.py"]
|
|
77
|
+
asyncio_mode = "auto"
|
|
78
78
|
# === OK_EDIT: path-sync pytest ===
|
|
79
79
|
|
|
80
80
|
# === DO_NOT_EDIT: path-sync coverage ===
|
|
@@ -88,7 +88,9 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:"]
|
|
|
88
88
|
dev = [
|
|
89
89
|
"pyright>=1.1",
|
|
90
90
|
"pytest>=9.0",
|
|
91
|
+
"pytest-asyncio>=0.24",
|
|
91
92
|
"pytest-cov>=7.0",
|
|
93
|
+
"pytest-regressions>=2.6",
|
|
92
94
|
"ruff>=0.14",
|
|
93
95
|
]
|
|
94
96
|
# === OK_EDIT: path-sync dev ===
|
|
@@ -98,3 +100,7 @@ docs = [
|
|
|
98
100
|
"mkdocs-material>=9.5",
|
|
99
101
|
]
|
|
100
102
|
# === OK_EDIT: path-sync docs ===
|
|
103
|
+
|
|
104
|
+
# === DO_NOT_EDIT: path-sync release ===
|
|
105
|
+
release = ["pkg-ext"]
|
|
106
|
+
# === OK_EDIT: path-sync release ===
|
|
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
|