rhiza 0.8.5__py3-none-any.whl → 0.8.7__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/models.py +25 -2
- {rhiza-0.8.5.dist-info → rhiza-0.8.7.dist-info}/METADATA +3 -1
- {rhiza-0.8.5.dist-info → rhiza-0.8.7.dist-info}/RECORD +6 -6
- {rhiza-0.8.5.dist-info → rhiza-0.8.7.dist-info}/WHEEL +0 -0
- {rhiza-0.8.5.dist-info → rhiza-0.8.7.dist-info}/entry_points.txt +0 -0
- {rhiza-0.8.5.dist-info → rhiza-0.8.7.dist-info}/licenses/LICENSE +0 -0
rhiza/models.py
CHANGED
|
@@ -11,6 +11,29 @@ from pathlib import Path
|
|
|
11
11
|
import yaml
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
def _normalize_to_list(value: str | list[str] | None) -> list[str]:
|
|
15
|
+
"""Convert a value to a list of strings.
|
|
16
|
+
|
|
17
|
+
Handles the case where YAML multi-line strings (using |) are parsed as
|
|
18
|
+
a single string instead of a list. Splits the string by newlines and
|
|
19
|
+
strips whitespace from each item.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
value: A string, list of strings, or None.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
A list of strings. Empty list if value is None or empty.
|
|
26
|
+
"""
|
|
27
|
+
if value is None:
|
|
28
|
+
return []
|
|
29
|
+
if isinstance(value, list):
|
|
30
|
+
return value
|
|
31
|
+
if isinstance(value, str):
|
|
32
|
+
# Split by newlines and filter out empty strings
|
|
33
|
+
return [item.strip() for item in value.strip().split("\n") if item.strip()]
|
|
34
|
+
return []
|
|
35
|
+
|
|
36
|
+
|
|
14
37
|
@dataclass
|
|
15
38
|
class RhizaTemplate:
|
|
16
39
|
"""Represents the structure of .github/rhiza/template.yml.
|
|
@@ -57,8 +80,8 @@ class RhizaTemplate:
|
|
|
57
80
|
template_repository=config.get("template-repository"),
|
|
58
81
|
template_branch=config.get("template-branch"),
|
|
59
82
|
template_host=config.get("template-host", "github"),
|
|
60
|
-
include=config.get("include"
|
|
61
|
-
exclude=config.get("exclude"
|
|
83
|
+
include=_normalize_to_list(config.get("include")),
|
|
84
|
+
exclude=_normalize_to_list(config.get("exclude")),
|
|
62
85
|
)
|
|
63
86
|
|
|
64
87
|
def to_yaml(self, file_path: Path) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rhiza
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.7
|
|
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
|
|
@@ -23,6 +23,8 @@ Requires-Dist: jinja2>=3.1.0
|
|
|
23
23
|
Requires-Dist: loguru>=0.7.3
|
|
24
24
|
Requires-Dist: pyyaml==6.0.3
|
|
25
25
|
Requires-Dist: typer>=0.20.0
|
|
26
|
+
Provides-Extra: tools
|
|
27
|
+
Requires-Dist: rhiza-tools>=0.1.2; extra == 'tools'
|
|
26
28
|
Description-Content-Type: text/markdown
|
|
27
29
|
|
|
28
30
|
<div align="center">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
rhiza/__init__.py,sha256=iW3niLBjwRKxcMhIV_1eb78putjUTo2tbZsadofluJk,1939
|
|
2
2
|
rhiza/__main__.py,sha256=Q02upTGaJceknkDABdCwq5_vdMdGY8Cg3ej6WZIHs_s,829
|
|
3
3
|
rhiza/cli.py,sha256=xIsyfKjSFjVLjCS7o2om5o_YLZx9lIhsI0MTMI5Zs2k,8594
|
|
4
|
-
rhiza/models.py,sha256=
|
|
4
|
+
rhiza/models.py,sha256=o_iD8P7d7RAHH6J91tSPmD6lY-2HUsCaIl8auWqm2NM,4216
|
|
5
5
|
rhiza/subprocess_utils.py,sha256=Pr5TysIKP76hc64fmqhTd6msMGn5DU43hOSR_v_GFb8,745
|
|
6
6
|
rhiza/_templates/basic/__init__.py.jinja2,sha256=gs8qN4LAKcdFd6iO9gZVLuVetODmZP_TGuEjWrbinC0,27
|
|
7
7
|
rhiza/_templates/basic/main.py.jinja2,sha256=uTCahxf9Bftao1IghHue4cSZ9YzBYmBEXeIhEmK9UXQ,362
|
|
@@ -13,8 +13,8 @@ rhiza/commands/migrate.py,sha256=pT8izKuX2eXCAkmNfcy4AU5HTB1DoOZoBXcZo2AOpXs,752
|
|
|
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.7.dist-info/METADATA,sha256=3-RuZypKMwtvoHkVRWYeeC6x8-i8HDDbV_kFmfJQanE,25395
|
|
17
|
+
rhiza-0.8.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
18
|
+
rhiza-0.8.7.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
19
|
+
rhiza-0.8.7.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
20
|
+
rhiza-0.8.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|