rhiza 0.8.7__py3-none-any.whl → 0.8.8__py3-none-any.whl
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.
- rhiza/commands/materialize.py +21 -0
- {rhiza-0.8.7.dist-info → rhiza-0.8.8.dist-info}/METADATA +1 -1
- {rhiza-0.8.7.dist-info → rhiza-0.8.8.dist-info}/RECORD +6 -6
- {rhiza-0.8.7.dist-info → rhiza-0.8.8.dist-info}/WHEEL +0 -0
- {rhiza-0.8.7.dist-info → rhiza-0.8.8.dist-info}/entry_points.txt +0 -0
- {rhiza-0.8.7.dist-info → rhiza-0.8.8.dist-info}/licenses/LICENSE +0 -0
rhiza/commands/materialize.py
CHANGED
|
@@ -251,6 +251,19 @@ def _copy_files_to_target(
|
|
|
251
251
|
# Create set of excluded files
|
|
252
252
|
logger.debug("Expanding excluded paths to individual files")
|
|
253
253
|
excluded_files = {f.resolve() for f in __expand_paths(tmp_dir, excluded_paths)}
|
|
254
|
+
|
|
255
|
+
# Always exclude .rhiza/template.yml to prevent overwriting local configuration
|
|
256
|
+
# Also exclude .rhiza/history to prevent overwriting local history with template history
|
|
257
|
+
rhiza_dir = tmp_dir / ".rhiza"
|
|
258
|
+
template_config = (rhiza_dir / "template.yml").resolve()
|
|
259
|
+
upstream_history = (rhiza_dir / "history").resolve()
|
|
260
|
+
|
|
261
|
+
if template_config.is_file():
|
|
262
|
+
excluded_files.add(template_config)
|
|
263
|
+
|
|
264
|
+
if upstream_history.is_file():
|
|
265
|
+
excluded_files.add(upstream_history)
|
|
266
|
+
|
|
254
267
|
if excluded_files:
|
|
255
268
|
logger.info(f"Excluding {len(excluded_files)} file(s) based on exclude patterns")
|
|
256
269
|
|
|
@@ -336,9 +349,17 @@ def _clean_orphaned_files(target: Path, materialized_files: list[Path]) -> None:
|
|
|
336
349
|
currently_materialized_files = set(materialized_files)
|
|
337
350
|
orphaned_files = previously_tracked_files - currently_materialized_files
|
|
338
351
|
|
|
352
|
+
# Protected files that should never be deleted automatically
|
|
353
|
+
# even if they are orphaned (e.g. user chose to stop tracking them)
|
|
354
|
+
protected_files = {Path(".rhiza/template.yml")}
|
|
355
|
+
|
|
339
356
|
if orphaned_files:
|
|
340
357
|
logger.info(f"Found {len(orphaned_files)} orphaned file(s) no longer maintained by template")
|
|
341
358
|
for file_path in sorted(orphaned_files):
|
|
359
|
+
if file_path in protected_files:
|
|
360
|
+
logger.info(f"Skipping protected file: {file_path}")
|
|
361
|
+
continue
|
|
362
|
+
|
|
342
363
|
full_path = target / file_path
|
|
343
364
|
if full_path.exists():
|
|
344
365
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rhiza
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.8
|
|
4
4
|
Summary: Reusable configuration templates for modern Python projects
|
|
5
5
|
Project-URL: Homepage, https://github.com/jebel-quant/rhiza-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/jebel-quant/rhiza-cli
|
|
@@ -8,13 +8,13 @@ rhiza/_templates/basic/main.py.jinja2,sha256=uTCahxf9Bftao1IghHue4cSZ9YzBYmBEXeI
|
|
|
8
8
|
rhiza/_templates/basic/pyproject.toml.jinja2,sha256=Mizpnnd_kFQd-pCWOxG-KWhvg4_ZhZaQppTt2pz0WOc,695
|
|
9
9
|
rhiza/commands/__init__.py,sha256=Z5CeMh7ylX27H6dvwqRbEKzYo5pwQq-5TyTxABUSaQg,1848
|
|
10
10
|
rhiza/commands/init.py,sha256=73MLPLp-M8U4fP8J5RXghS6FsZjx2PpeeBbKRZvLQ7U,8882
|
|
11
|
-
rhiza/commands/materialize.py,sha256=
|
|
11
|
+
rhiza/commands/materialize.py,sha256=U6MouBNrg_GjYIPD0vBb3nacFBKGP4l8RD-HH0u-mYk,18538
|
|
12
12
|
rhiza/commands/migrate.py,sha256=pT8izKuX2eXCAkmNfcy4AU5HTB1DoOZoBXcZo2AOpXs,7520
|
|
13
13
|
rhiza/commands/uninstall.py,sha256=MJbQtmdTgbzMvQz0gGLW3aw6S1dSV8nLv0SqWSDpyPk,7469
|
|
14
14
|
rhiza/commands/validate.py,sha256=pg7SpgavvrjDyuZIphJ_GOMnXkwdVs9WtL2caa1XjcM,10811
|
|
15
15
|
rhiza/commands/welcome.py,sha256=w3BziR042o6oYincd3EqDsFzF6qqInU7iYhWjF3yJqY,2382
|
|
16
|
-
rhiza-0.8.
|
|
17
|
-
rhiza-0.8.
|
|
18
|
-
rhiza-0.8.
|
|
19
|
-
rhiza-0.8.
|
|
20
|
-
rhiza-0.8.
|
|
16
|
+
rhiza-0.8.8.dist-info/METADATA,sha256=PGkXXTlS2XGjxAm5ODJmDvrRerXnEmG1ZoUcJvYhiyo,25395
|
|
17
|
+
rhiza-0.8.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
18
|
+
rhiza-0.8.8.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
19
|
+
rhiza-0.8.8.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
20
|
+
rhiza-0.8.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|