rhiza 0.5.5__py3-none-any.whl → 0.5.6__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/cli.py +15 -0
- rhiza/commands/materialize.py +11 -0
- rhiza/commands/welcome.py +55 -0
- {rhiza-0.5.5.dist-info → rhiza-0.5.6.dist-info}/METADATA +1 -1
- rhiza-0.5.6.dist-info/RECORD +14 -0
- rhiza-0.5.5.dist-info/RECORD +0 -13
- {rhiza-0.5.5.dist-info → rhiza-0.5.6.dist-info}/WHEEL +0 -0
- {rhiza-0.5.5.dist-info → rhiza-0.5.6.dist-info}/entry_points.txt +0 -0
- {rhiza-0.5.5.dist-info → rhiza-0.5.6.dist-info}/licenses/LICENSE +0 -0
rhiza/cli.py
CHANGED
|
@@ -12,6 +12,7 @@ from rhiza import __version__
|
|
|
12
12
|
from rhiza.commands import init as init_cmd
|
|
13
13
|
from rhiza.commands import materialize as materialize_cmd
|
|
14
14
|
from rhiza.commands import validate as validate_cmd
|
|
15
|
+
from rhiza.commands.welcome import welcome as welcome_cmd
|
|
15
16
|
|
|
16
17
|
app = typer.Typer(
|
|
17
18
|
help=(
|
|
@@ -171,3 +172,17 @@ def validate(
|
|
|
171
172
|
"""
|
|
172
173
|
if not validate_cmd(target):
|
|
173
174
|
raise typer.Exit(code=1)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
@app.command()
|
|
178
|
+
def welcome():
|
|
179
|
+
r"""Display a friendly welcome message and explain what Rhiza is.
|
|
180
|
+
|
|
181
|
+
Shows a welcome message, explains Rhiza's purpose, key features,
|
|
182
|
+
and provides guidance on getting started with the tool.
|
|
183
|
+
|
|
184
|
+
\b
|
|
185
|
+
Examples:
|
|
186
|
+
rhiza welcome
|
|
187
|
+
"""
|
|
188
|
+
welcome_cmd()
|
rhiza/commands/materialize.py
CHANGED
|
@@ -6,6 +6,7 @@ into the target Git repository, and records managed files in
|
|
|
6
6
|
`.rhiza.history`. Use this to take a one-shot snapshot of template files.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
import os
|
|
9
10
|
import shutil
|
|
10
11
|
import subprocess
|
|
11
12
|
import sys
|
|
@@ -56,6 +57,10 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
56
57
|
logger.info(f"Target repository: {target}")
|
|
57
58
|
logger.info(f"Rhiza branch: {branch}")
|
|
58
59
|
|
|
60
|
+
# Set environment to prevent git from prompting for credentials
|
|
61
|
+
git_env = os.environ.copy()
|
|
62
|
+
git_env["GIT_TERMINAL_PROMPT"] = "0"
|
|
63
|
+
|
|
59
64
|
# -----------------------
|
|
60
65
|
# Handle target branch creation/checkout if specified
|
|
61
66
|
# -----------------------
|
|
@@ -68,6 +73,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
68
73
|
cwd=target,
|
|
69
74
|
capture_output=True,
|
|
70
75
|
text=True,
|
|
76
|
+
env=git_env,
|
|
71
77
|
)
|
|
72
78
|
|
|
73
79
|
if result.returncode == 0:
|
|
@@ -77,6 +83,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
77
83
|
["git", "checkout", target_branch],
|
|
78
84
|
cwd=target,
|
|
79
85
|
check=True,
|
|
86
|
+
env=git_env,
|
|
80
87
|
)
|
|
81
88
|
else:
|
|
82
89
|
# Branch doesn't exist, create and checkout
|
|
@@ -85,6 +92,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
85
92
|
["git", "checkout", "-b", target_branch],
|
|
86
93
|
cwd=target,
|
|
87
94
|
check=True,
|
|
95
|
+
env=git_env,
|
|
88
96
|
)
|
|
89
97
|
except subprocess.CalledProcessError as e:
|
|
90
98
|
logger.error(f"Failed to create/checkout branch '{target_branch}': {e}")
|
|
@@ -152,6 +160,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
152
160
|
check=True,
|
|
153
161
|
capture_output=True,
|
|
154
162
|
text=True,
|
|
163
|
+
env=git_env,
|
|
155
164
|
)
|
|
156
165
|
except subprocess.CalledProcessError as e:
|
|
157
166
|
logger.error(f"Failed to clone repository: {e}")
|
|
@@ -167,6 +176,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
167
176
|
check=True,
|
|
168
177
|
capture_output=True,
|
|
169
178
|
text=True,
|
|
179
|
+
env=git_env,
|
|
170
180
|
)
|
|
171
181
|
except subprocess.CalledProcessError as e:
|
|
172
182
|
logger.error(f"Failed to initialize sparse checkout: {e}")
|
|
@@ -182,6 +192,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
182
192
|
check=True,
|
|
183
193
|
capture_output=True,
|
|
184
194
|
text=True,
|
|
195
|
+
env=git_env,
|
|
185
196
|
)
|
|
186
197
|
except subprocess.CalledProcessError as e:
|
|
187
198
|
logger.error(f"Failed to set sparse checkout paths: {e}")
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# This file is part of the jebel-quant/rhiza repository
|
|
2
|
+
# (https://github.com/jebel-quant/rhiza).
|
|
3
|
+
#
|
|
4
|
+
"""Command to display a welcome message and explain Rhiza.
|
|
5
|
+
|
|
6
|
+
This module provides the welcome command that displays a friendly greeting
|
|
7
|
+
and explains what Rhiza is and how it can help manage configuration templates.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from rhiza import __version__
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def welcome():
|
|
14
|
+
"""Display a welcome message and explain what Rhiza is.
|
|
15
|
+
|
|
16
|
+
Shows a friendly greeting, explains Rhiza's purpose, and provides
|
|
17
|
+
next steps for getting started with the tool.
|
|
18
|
+
"""
|
|
19
|
+
welcome_message = f"""
|
|
20
|
+
╭───────────────────────────────────────────────────────────────╮
|
|
21
|
+
│ │
|
|
22
|
+
│ 🌿 Welcome to Rhiza v{__version__:<43} │
|
|
23
|
+
│ │
|
|
24
|
+
╰───────────────────────────────────────────────────────────────╯
|
|
25
|
+
|
|
26
|
+
Rhiza helps you maintain consistent configuration across multiple
|
|
27
|
+
Python projects using reusable templates stored in a central repository.
|
|
28
|
+
|
|
29
|
+
✨ What Rhiza can do for you:
|
|
30
|
+
|
|
31
|
+
• Initialize projects with standard configuration templates
|
|
32
|
+
• Materialize (inject) templates into target repositories
|
|
33
|
+
• Validate template configurations
|
|
34
|
+
• Keep project configurations synchronized
|
|
35
|
+
|
|
36
|
+
🚀 Getting started:
|
|
37
|
+
|
|
38
|
+
1. Initialize a project:
|
|
39
|
+
$ rhiza init
|
|
40
|
+
|
|
41
|
+
2. Customize .github/template.yml to match your needs
|
|
42
|
+
|
|
43
|
+
3. Materialize templates into your project:
|
|
44
|
+
$ rhiza materialize
|
|
45
|
+
|
|
46
|
+
📚 Learn more:
|
|
47
|
+
|
|
48
|
+
• View all commands: rhiza --help
|
|
49
|
+
• Project repository: https://github.com/jebel-quant/rhiza-cli
|
|
50
|
+
• Documentation: https://jebel-quant.github.io/rhiza-cli/
|
|
51
|
+
|
|
52
|
+
Happy templating! 🎉
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
print(welcome_message)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rhiza
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
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
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rhiza/__init__.py,sha256=1jfkGAONm7dH4KwYjvNEyuxrQ-1m2YncxREYCJnTrHA,1933
|
|
2
|
+
rhiza/__main__.py,sha256=Lx0GqVZo6ymm0f18_uYB6E7_SOWwJNYjb73Vr31oLoM,236
|
|
3
|
+
rhiza/cli.py,sha256=Jqe285OWOvbvembO5DXTVITfnFefsjVGZCJuK3EKRT8,5081
|
|
4
|
+
rhiza/models.py,sha256=R2nu_bf-j-U0kPfQXg6u-MSykrdGO9ixOzZoWy8mLCc,3448
|
|
5
|
+
rhiza/commands/__init__.py,sha256=lIkN15MIat-wn9CB1cgUjTzTUQB95LBBAKFK1sGHdCc,1836
|
|
6
|
+
rhiza/commands/init.py,sha256=QsOV_VBnRfSPebydH-fMe3haadboNIAYlOpAIYHtgUs,1936
|
|
7
|
+
rhiza/commands/materialize.py,sha256=FUStZGUr2oDEC-M8V61JnV3W7USj-VS0EHI10a0Mn6Y,9378
|
|
8
|
+
rhiza/commands/validate.py,sha256=_0t9kfylMncm9JmKULn5e7V71XcQdFjlrtuOqZeshPM,5282
|
|
9
|
+
rhiza/commands/welcome.py,sha256=GpDbRSIUigaxS7Di9RIpl2jCOFOlhlQT2vNvCzBR-8U,2001
|
|
10
|
+
rhiza-0.5.6.dist-info/METADATA,sha256=PI_8F886fva98V4uq_toyZ9O8gC8tnOPy-FPSUn0eE4,21278
|
|
11
|
+
rhiza-0.5.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
12
|
+
rhiza-0.5.6.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
13
|
+
rhiza-0.5.6.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
14
|
+
rhiza-0.5.6.dist-info/RECORD,,
|
rhiza-0.5.5.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
rhiza/__init__.py,sha256=1jfkGAONm7dH4KwYjvNEyuxrQ-1m2YncxREYCJnTrHA,1933
|
|
2
|
-
rhiza/__main__.py,sha256=Lx0GqVZo6ymm0f18_uYB6E7_SOWwJNYjb73Vr31oLoM,236
|
|
3
|
-
rhiza/cli.py,sha256=orVHOn569qHm-TffRLpSoJlF5x59dNfQsC2pX7VppYA,4721
|
|
4
|
-
rhiza/models.py,sha256=R2nu_bf-j-U0kPfQXg6u-MSykrdGO9ixOzZoWy8mLCc,3448
|
|
5
|
-
rhiza/commands/__init__.py,sha256=lIkN15MIat-wn9CB1cgUjTzTUQB95LBBAKFK1sGHdCc,1836
|
|
6
|
-
rhiza/commands/init.py,sha256=QsOV_VBnRfSPebydH-fMe3haadboNIAYlOpAIYHtgUs,1936
|
|
7
|
-
rhiza/commands/materialize.py,sha256=5kpeLSiuAb9MIDvDRZboHRXy2JCUMmpJgF-lvwoawO4,9044
|
|
8
|
-
rhiza/commands/validate.py,sha256=_0t9kfylMncm9JmKULn5e7V71XcQdFjlrtuOqZeshPM,5282
|
|
9
|
-
rhiza-0.5.5.dist-info/METADATA,sha256=auu4yvBXlw4MIdZzUE8YDMNr2Mjj3bmC4zgH88qefJ4,21278
|
|
10
|
-
rhiza-0.5.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
11
|
-
rhiza-0.5.5.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
12
|
-
rhiza-0.5.5.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
13
|
-
rhiza-0.5.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|