rhiza 0.10.1__py3-none-any.whl → 0.10.2__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/bundle_resolver.py +7 -7
- rhiza/commands/materialize.py +3 -3
- rhiza/models.py +4 -4
- {rhiza-0.10.1.dist-info → rhiza-0.10.2.dist-info}/METADATA +1 -1
- {rhiza-0.10.1.dist-info → rhiza-0.10.2.dist-info}/RECORD +8 -8
- {rhiza-0.10.1.dist-info → rhiza-0.10.2.dist-info}/WHEEL +0 -0
- {rhiza-0.10.1.dist-info → rhiza-0.10.2.dist-info}/entry_points.txt +0 -0
- {rhiza-0.10.1.dist-info → rhiza-0.10.2.dist-info}/licenses/LICENSE +0 -0
rhiza/bundle_resolver.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Bundle resolution logic for template configuration.
|
|
2
2
|
|
|
3
3
|
This module provides functions to load and resolve bundle configurations
|
|
4
|
-
from the template repository's
|
|
4
|
+
from the template repository's template-bundles.yml file.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from pathlib import Path
|
|
@@ -10,19 +10,19 @@ from rhiza.models import RhizaBundles, RhizaTemplate
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def load_bundles_from_clone(tmp_dir: Path) -> RhizaBundles | None:
|
|
13
|
-
"""Load .rhiza/
|
|
13
|
+
"""Load .rhiza/template-bundles.yml from cloned template repo.
|
|
14
14
|
|
|
15
15
|
Args:
|
|
16
16
|
tmp_dir: Path to the cloned template repository.
|
|
17
17
|
|
|
18
18
|
Returns:
|
|
19
|
-
RhizaBundles if
|
|
19
|
+
RhizaBundles if template-bundles.yml exists, None otherwise.
|
|
20
20
|
|
|
21
21
|
Raises:
|
|
22
|
-
yaml.YAMLError: If
|
|
23
|
-
ValueError: If
|
|
22
|
+
yaml.YAMLError: If template-bundles.yml is malformed.
|
|
23
|
+
ValueError: If template-bundles.yml is invalid.
|
|
24
24
|
"""
|
|
25
|
-
bundles_file = tmp_dir / ".rhiza" / "
|
|
25
|
+
bundles_file = tmp_dir / ".rhiza" / "template-bundles.yml"
|
|
26
26
|
if not bundles_file.exists():
|
|
27
27
|
return None
|
|
28
28
|
return RhizaBundles.from_yaml(bundles_file)
|
|
@@ -54,7 +54,7 @@ def resolve_include_paths(
|
|
|
54
54
|
# Resolve templates to paths if specified
|
|
55
55
|
if template.templates:
|
|
56
56
|
if not bundles_config:
|
|
57
|
-
msg = "Template uses templates but
|
|
57
|
+
msg = "Template uses templates but template-bundles.yml not found in template repository"
|
|
58
58
|
raise ValueError(msg)
|
|
59
59
|
paths.extend(bundles_config.resolve_to_paths(template.templates))
|
|
60
60
|
|
rhiza/commands/materialize.py
CHANGED
|
@@ -121,7 +121,7 @@ def _validate_and_load_template(target: Path, branch: str) -> tuple[RhizaTemplat
|
|
|
121
121
|
excluded_paths = template.exclude
|
|
122
122
|
|
|
123
123
|
# Note: We'll resolve templates to paths after cloning the template repo,
|
|
124
|
-
# since we need access to
|
|
124
|
+
# since we need access to template-bundles.yml from the template
|
|
125
125
|
include_paths = template.include
|
|
126
126
|
|
|
127
127
|
# Validate that we have either templates or include paths
|
|
@@ -545,11 +545,11 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
545
545
|
logger.debug(f"Temporary directory: {tmp_dir}")
|
|
546
546
|
|
|
547
547
|
try:
|
|
548
|
-
# Clone with initial minimal checkout to load
|
|
548
|
+
# Clone with initial minimal checkout to load template-bundles.yml if needed
|
|
549
549
|
initial_paths = [".rhiza"] if template.templates else include_paths
|
|
550
550
|
_clone_template_repository(tmp_dir, git_url, rhiza_branch, initial_paths, git_executable, git_env)
|
|
551
551
|
|
|
552
|
-
# Load
|
|
552
|
+
# Load template-bundles.yml and resolve templates to paths if using template mode
|
|
553
553
|
if template.templates:
|
|
554
554
|
logger.info("Resolving templates to file paths...")
|
|
555
555
|
try:
|
rhiza/models.py
CHANGED
|
@@ -64,7 +64,7 @@ def _normalize_to_list(value: str | list[str] | None) -> list[str]:
|
|
|
64
64
|
|
|
65
65
|
@dataclass
|
|
66
66
|
class BundleDefinition:
|
|
67
|
-
"""Represents a single bundle from
|
|
67
|
+
"""Represents a single bundle from template-bundles.yml.
|
|
68
68
|
|
|
69
69
|
Attributes:
|
|
70
70
|
name: The bundle identifier (e.g., "core", "tests", "github").
|
|
@@ -87,7 +87,7 @@ class BundleDefinition:
|
|
|
87
87
|
|
|
88
88
|
@dataclass
|
|
89
89
|
class RhizaBundles:
|
|
90
|
-
"""Represents the structure of
|
|
90
|
+
"""Represents the structure of template-bundles.yml.
|
|
91
91
|
|
|
92
92
|
Attributes:
|
|
93
93
|
version: Version string of the bundles configuration format.
|
|
@@ -102,7 +102,7 @@ class RhizaBundles:
|
|
|
102
102
|
"""Load RhizaBundles from a YAML file.
|
|
103
103
|
|
|
104
104
|
Args:
|
|
105
|
-
file_path: Path to the
|
|
105
|
+
file_path: Path to the template-bundles.yml file.
|
|
106
106
|
|
|
107
107
|
Returns:
|
|
108
108
|
The loaded bundles configuration.
|
|
@@ -163,7 +163,7 @@ class RhizaBundles:
|
|
|
163
163
|
# Validate all bundles exist
|
|
164
164
|
for name in bundle_names:
|
|
165
165
|
if name not in self.bundles:
|
|
166
|
-
raise ValueError(f"Bundle '{name}' not found in
|
|
166
|
+
raise ValueError(f"Bundle '{name}' not found in template-bundles.yml") # noqa: TRY003
|
|
167
167
|
|
|
168
168
|
resolved: list[str] = []
|
|
169
169
|
visiting: set[str] = set()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rhiza
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.2
|
|
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
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
rhiza/__init__.py,sha256=4-Dy7AKbJneQNBfv30WhSsUin4y-g4Yp4veO6-YdjVg,1926
|
|
2
2
|
rhiza/__main__.py,sha256=GlTahVC8F6fKEpMw_nZyhp4PB-fyC9UQ_RjTZcpD9P4,837
|
|
3
|
-
rhiza/bundle_resolver.py,sha256=
|
|
3
|
+
rhiza/bundle_resolver.py,sha256=hFdPqoJrPv0_63eDcojg46XAWzNHKqBzIy9xq01jUxs,2293
|
|
4
4
|
rhiza/cli.py,sha256=y2qzFbrd29-j5OXslM96hZB9vDLvLv5FBnR9SnDdQWE,10613
|
|
5
|
-
rhiza/models.py,sha256
|
|
5
|
+
rhiza/models.py,sha256=p6ILDwPR6p-cnaqPQTvPGHjBrg6_oF0s1XpBEwh-7hE,10839
|
|
6
6
|
rhiza/subprocess_utils.py,sha256=Pr5TysIKP76hc64fmqhTd6msMGn5DU43hOSR_v_GFb8,745
|
|
7
7
|
rhiza/_templates/basic/__init__.py.jinja2,sha256=gs8qN4LAKcdFd6iO9gZVLuVetODmZP_TGuEjWrbinC0,27
|
|
8
8
|
rhiza/_templates/basic/main.py.jinja2,sha256=uTCahxf9Bftao1IghHue4cSZ9YzBYmBEXeIhEmK9UXQ,362
|
|
9
9
|
rhiza/_templates/basic/pyproject.toml.jinja2,sha256=Mizpnnd_kFQd-pCWOxG-KWhvg4_ZhZaQppTt2pz0WOc,695
|
|
10
10
|
rhiza/commands/__init__.py,sha256=DV1nlcXxeeHXmHobVcfOsGeiZBZ55Xz1mud073AXDGc,1839
|
|
11
11
|
rhiza/commands/init.py,sha256=fD_Nc-EtNo9Fb0PVRLkN2RYMteVv_BUTinAa2jz0_Q4,10745
|
|
12
|
-
rhiza/commands/materialize.py,sha256=
|
|
12
|
+
rhiza/commands/materialize.py,sha256=M06L8Hv0jBRYywN3aol7B2NHpVfDUpf5ZS_1IvO9qnQ,22256
|
|
13
13
|
rhiza/commands/migrate.py,sha256=A5t4nw7CrdtILCwuSoAqtmM0LpMK8KmX87gzlNgi7fQ,7522
|
|
14
14
|
rhiza/commands/summarise.py,sha256=vgc7M3dwuGjUuVs3XKQr2_g3qURnQH_R3eFoSSrnOro,11758
|
|
15
15
|
rhiza/commands/uninstall.py,sha256=6oO7kdv11Bq4JXjrBg9rsFtoRgttQ4m30zGr6NhZrkQ,7479
|
|
16
16
|
rhiza/commands/validate.py,sha256=_yGx7ARk5K4hqfwzPpJg_7JoG4un0lqHJYJU-4cmYvI,13948
|
|
17
17
|
rhiza/commands/welcome.py,sha256=VknKaUh-bD6dM-zcD1eP4H-D_npyezpfF3bTSl_0Dio,2383
|
|
18
|
-
rhiza-0.10.
|
|
19
|
-
rhiza-0.10.
|
|
20
|
-
rhiza-0.10.
|
|
21
|
-
rhiza-0.10.
|
|
22
|
-
rhiza-0.10.
|
|
18
|
+
rhiza-0.10.2.dist-info/METADATA,sha256=oEUuORww-0h91ccQmOWqhyhI4WbyGqAMaM3ouyRurf4,26306
|
|
19
|
+
rhiza-0.10.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
20
|
+
rhiza-0.10.2.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
21
|
+
rhiza-0.10.2.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
22
|
+
rhiza-0.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|