rhiza 0.5.5__py3-none-any.whl → 0.6.0__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/__init__.py +1 -1
- rhiza/cli.py +20 -5
- rhiza/commands/__init__.py +2 -2
- rhiza/commands/init.py +19 -10
- rhiza/commands/materialize.py +16 -1
- rhiza/commands/validate.py +15 -6
- rhiza/commands/welcome.py +55 -0
- rhiza/models.py +1 -1
- {rhiza-0.5.5.dist-info → rhiza-0.6.0.dist-info}/METADATA +61 -24
- rhiza-0.6.0.dist-info/RECORD +14 -0
- rhiza-0.5.5.dist-info/RECORD +0 -13
- {rhiza-0.5.5.dist-info → rhiza-0.6.0.dist-info}/WHEEL +0 -0
- {rhiza-0.5.5.dist-info → rhiza-0.6.0.dist-info}/entry_points.txt +0 -0
- {rhiza-0.5.5.dist-info → rhiza-0.6.0.dist-info}/licenses/LICENSE +0 -0
rhiza/__init__.py
CHANGED
|
@@ -29,7 +29,7 @@ Validate your configuration:
|
|
|
29
29
|
rhiza validate
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Customize `.github/template.yml`, then materialize templates into your project:
|
|
32
|
+
Customize `.github/rhiza/template.yml`, then materialize templates into your project:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
rhiza materialize
|
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=(
|
|
@@ -70,10 +71,10 @@ def init(
|
|
|
70
71
|
help="Target directory (defaults to current directory)",
|
|
71
72
|
),
|
|
72
73
|
):
|
|
73
|
-
r"""Initialize or validate .github/template.yml.
|
|
74
|
+
r"""Initialize or validate .github/rhiza/template.yml.
|
|
74
75
|
|
|
75
76
|
\b
|
|
76
|
-
Creates a default `.github/template.yml` configuration file if one
|
|
77
|
+
Creates a default `.github/rhiza/template.yml` configuration file if one
|
|
77
78
|
doesn't exist, or validates the existing configuration.
|
|
78
79
|
|
|
79
80
|
\b
|
|
@@ -116,10 +117,10 @@ def materialize(
|
|
|
116
117
|
|
|
117
118
|
\b
|
|
118
119
|
Materializes configuration files from the template repository specified
|
|
119
|
-
in .github/template.yml into your project. This command:
|
|
120
|
+
in .github/rhiza/template.yml into your project. This command:
|
|
120
121
|
|
|
121
122
|
\b
|
|
122
|
-
- Reads .github/template.yml configuration
|
|
123
|
+
- Reads .github/rhiza/template.yml configuration
|
|
123
124
|
- Performs a sparse clone of the template repository
|
|
124
125
|
- Copies specified files/directories to your project
|
|
125
126
|
- Respects exclusion patterns defined in the configuration
|
|
@@ -148,7 +149,7 @@ def validate(
|
|
|
148
149
|
):
|
|
149
150
|
r"""Validate Rhiza template configuration.
|
|
150
151
|
|
|
151
|
-
Validates the .github/template.yml file to ensure it is syntactically
|
|
152
|
+
Validates the .github/rhiza/template.yml file to ensure it is syntactically
|
|
152
153
|
correct and semantically valid.
|
|
153
154
|
|
|
154
155
|
\b
|
|
@@ -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/__init__.py
CHANGED
|
@@ -8,7 +8,7 @@ configuration templates for Python projects.
|
|
|
8
8
|
|
|
9
9
|
### init
|
|
10
10
|
|
|
11
|
-
Initialize or validate `.github/template.yml` in a target directory.
|
|
11
|
+
Initialize or validate `.github/rhiza/template.yml` in a target directory.
|
|
12
12
|
|
|
13
13
|
Creates a default configuration file if it doesn't exist, or validates
|
|
14
14
|
an existing one. The default configuration includes common Python project
|
|
@@ -29,7 +29,7 @@ is used.
|
|
|
29
29
|
|
|
30
30
|
Validate Rhiza template configuration.
|
|
31
31
|
|
|
32
|
-
Validates the `.github/template.yml` file to ensure it is syntactically
|
|
32
|
+
Validates the `.github/rhiza/template.yml` file to ensure it is syntactically
|
|
33
33
|
correct and semantically valid. Performs comprehensive validation including
|
|
34
34
|
YAML syntax checking, required field verification, field type validation,
|
|
35
35
|
and repository format verification.
|
rhiza/commands/init.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"""Command to initialize or validate .github/template.yml.
|
|
1
|
+
"""Command to initialize or validate .github/rhiza/template.yml.
|
|
2
2
|
|
|
3
3
|
This module provides the init command that creates or validates the
|
|
4
|
-
.github/template.yml file, which defines where templates come from
|
|
4
|
+
.github/rhiza/template.yml file, which defines where templates come from
|
|
5
5
|
and what paths are governed by Rhiza.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import shutil
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
|
|
10
11
|
from loguru import logger
|
|
@@ -14,9 +15,9 @@ from rhiza.models import RhizaTemplate
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def init(target: Path):
|
|
17
|
-
"""Initialize or validate .github/template.yml in the target repository.
|
|
18
|
+
"""Initialize or validate .github/rhiza/template.yml in the target repository.
|
|
18
19
|
|
|
19
|
-
Creates a default .github/template.yml file if it doesn't exist,
|
|
20
|
+
Creates a default .github/rhiza/template.yml file if it doesn't exist,
|
|
20
21
|
or validates an existing one.
|
|
21
22
|
|
|
22
23
|
Args:
|
|
@@ -27,16 +28,24 @@ def init(target: Path):
|
|
|
27
28
|
|
|
28
29
|
logger.info(f"Initializing Rhiza configuration in: {target}")
|
|
29
30
|
|
|
30
|
-
# Create .github directory if it doesn't exist
|
|
31
|
+
# Create .github/rhiza directory if it doesn't exist
|
|
31
32
|
github_dir = target / ".github"
|
|
32
|
-
|
|
33
|
+
rhiza_dir = github_dir / "rhiza"
|
|
34
|
+
rhiza_dir.mkdir(parents=True, exist_ok=True)
|
|
33
35
|
|
|
34
|
-
#
|
|
36
|
+
# check the old location and copy over if existent
|
|
37
|
+
# todo: remove this logic later
|
|
35
38
|
template_file = github_dir / "template.yml"
|
|
39
|
+
if template_file.exists():
|
|
40
|
+
# move the file into rhiza_dir
|
|
41
|
+
shutil.copyfile(template_file, rhiza_dir / "template.yml")
|
|
42
|
+
|
|
43
|
+
# Define the template file path
|
|
44
|
+
template_file = rhiza_dir / "template.yml"
|
|
36
45
|
|
|
37
46
|
if not template_file.exists():
|
|
38
47
|
# Create default template.yml
|
|
39
|
-
logger.info("Creating default .github/template.yml")
|
|
48
|
+
logger.info("Creating default .github/rhiza/template.yml")
|
|
40
49
|
|
|
41
50
|
default_template = RhizaTemplate(
|
|
42
51
|
template_repository="jebel-quant/rhiza",
|
|
@@ -53,10 +62,10 @@ def init(target: Path):
|
|
|
53
62
|
|
|
54
63
|
default_template.to_yaml(template_file)
|
|
55
64
|
|
|
56
|
-
logger.success("✓ Created .github/template.yml")
|
|
65
|
+
logger.success("✓ Created .github/rhiza/template.yml")
|
|
57
66
|
logger.info("""
|
|
58
67
|
Next steps:
|
|
59
|
-
1. Review and customize .github/template.yml to match your project needs
|
|
68
|
+
1. Review and customize .github/rhiza/template.yml to match your project needs
|
|
60
69
|
2. Run 'rhiza materialize' to inject templates into your repository
|
|
61
70
|
""")
|
|
62
71
|
|
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}")
|
|
@@ -95,13 +103,17 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
95
103
|
# -----------------------
|
|
96
104
|
valid = init(target)
|
|
97
105
|
|
|
106
|
+
# init will make sure the template_file exists at the new location!
|
|
107
|
+
|
|
98
108
|
if not valid:
|
|
99
109
|
logger.error(f"Rhiza template is invalid. {target}")
|
|
100
110
|
sys.exit(1)
|
|
101
111
|
|
|
102
|
-
template_file = target / ".github" / "template.yml"
|
|
112
|
+
template_file = target / ".github" / "rhiza" / "template.yml"
|
|
103
113
|
template = RhizaTemplate.from_yaml(template_file)
|
|
104
114
|
|
|
115
|
+
# init will make sure the template_file exists at the new location!
|
|
116
|
+
|
|
105
117
|
rhiza_repo = template.template_repository
|
|
106
118
|
rhiza_branch = template.template_branch or branch
|
|
107
119
|
rhiza_host = template.template_host or "github"
|
|
@@ -152,6 +164,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
152
164
|
check=True,
|
|
153
165
|
capture_output=True,
|
|
154
166
|
text=True,
|
|
167
|
+
env=git_env,
|
|
155
168
|
)
|
|
156
169
|
except subprocess.CalledProcessError as e:
|
|
157
170
|
logger.error(f"Failed to clone repository: {e}")
|
|
@@ -167,6 +180,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
167
180
|
check=True,
|
|
168
181
|
capture_output=True,
|
|
169
182
|
text=True,
|
|
183
|
+
env=git_env,
|
|
170
184
|
)
|
|
171
185
|
except subprocess.CalledProcessError as e:
|
|
172
186
|
logger.error(f"Failed to initialize sparse checkout: {e}")
|
|
@@ -182,6 +196,7 @@ def materialize(target: Path, branch: str, target_branch: str | None, force: boo
|
|
|
182
196
|
check=True,
|
|
183
197
|
capture_output=True,
|
|
184
198
|
text=True,
|
|
199
|
+
env=git_env,
|
|
185
200
|
)
|
|
186
201
|
except subprocess.CalledProcessError as e:
|
|
187
202
|
logger.error(f"Failed to set sparse checkout paths: {e}")
|
rhiza/commands/validate.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Command for validating Rhiza template configuration.
|
|
2
2
|
|
|
3
|
-
This module provides functionality to validate .github/template.yml files
|
|
3
|
+
This module provides functionality to validate .github/rhiza/template.yml files
|
|
4
4
|
to ensure they are syntactically correct and semantically valid.
|
|
5
5
|
"""
|
|
6
6
|
|
|
@@ -35,14 +35,23 @@ def validate(target: Path) -> bool:
|
|
|
35
35
|
|
|
36
36
|
logger.info(f"Validating template configuration in: {target}")
|
|
37
37
|
|
|
38
|
-
# Check
|
|
39
|
-
template_file = target / ".github" / "template.yml"
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
# Check one of the possible template.yml exists
|
|
39
|
+
template_file = [target / ".github" / "rhiza" / "template.yml", target / ".github" / "template.yml"]
|
|
40
|
+
|
|
41
|
+
# Check the exists
|
|
42
|
+
exists = [file.exists() for file in template_file]
|
|
43
|
+
|
|
44
|
+
if not any(exists):
|
|
45
|
+
logger.error(f"No template file found: {template_file}")
|
|
42
46
|
logger.info("Run 'rhiza init' to create a default template.yml")
|
|
43
47
|
return False
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
if exists[0]:
|
|
50
|
+
logger.success(f"Template file exists: {template_file[0]}")
|
|
51
|
+
template_file = template_file[0]
|
|
52
|
+
else:
|
|
53
|
+
logger.warning(f"Template file exists but in old location: {template_file[1]}")
|
|
54
|
+
template_file = template_file[1]
|
|
46
55
|
|
|
47
56
|
# Validate YAML syntax
|
|
48
57
|
try:
|
|
@@ -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__:<39} │
|
|
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/rhiza/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)
|
rhiza/models.py
CHANGED
|
@@ -13,7 +13,7 @@ import yaml
|
|
|
13
13
|
|
|
14
14
|
@dataclass
|
|
15
15
|
class RhizaTemplate:
|
|
16
|
-
"""Represents the structure of .github/template.yml.
|
|
16
|
+
"""Represents the structure of .github/rhiza/template.yml.
|
|
17
17
|
|
|
18
18
|
Attributes:
|
|
19
19
|
template_repository: The GitHub or GitLab repository containing templates (e.g., "jebel-quant/rhiza").
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rhiza
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
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
|
|
@@ -81,6 +81,35 @@ For more detailed information, see:
|
|
|
81
81
|
pip install rhiza
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
To update to the latest version:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install --upgrade rhiza
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Using uvx (run without installation)
|
|
91
|
+
|
|
92
|
+
[uvx](https://docs.astral.sh/uv/) is part of the `uv` package manager and allows you to run CLI tools directly without installing them:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
uvx rhiza --help
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
With uvx, you don't need to install rhiza globally. Each time you run `uvx rhiza`, it will automatically use the latest version available on PyPI. To ensure you're using the latest version, simply run your command - uvx will fetch updates as needed:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Always uses the latest version
|
|
102
|
+
uvx rhiza init
|
|
103
|
+
uvx rhiza materialize
|
|
104
|
+
uvx rhiza validate
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If you want to use a specific version:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
uvx rhiza@0.5.6 --help
|
|
111
|
+
```
|
|
112
|
+
|
|
84
113
|
### From source
|
|
85
114
|
|
|
86
115
|
```bash
|
|
@@ -112,11 +141,11 @@ rhiza --help
|
|
|
112
141
|
rhiza init
|
|
113
142
|
```
|
|
114
143
|
|
|
115
|
-
This creates a `.github/template.yml` file with default configuration.
|
|
144
|
+
This creates a `.github/rhiza/template.yml` file with default configuration.
|
|
116
145
|
|
|
117
146
|
2. **Customize the template configuration:**
|
|
118
147
|
|
|
119
|
-
Edit `.github/template.yml` to specify which files/directories to include from your template repository.
|
|
148
|
+
Edit `.github/rhiza/template.yml` to specify which files/directories to include from your template repository.
|
|
120
149
|
|
|
121
150
|
3. **Materialize templates into your project:**
|
|
122
151
|
|
|
@@ -132,13 +161,13 @@ rhiza --help
|
|
|
132
161
|
rhiza validate
|
|
133
162
|
```
|
|
134
163
|
|
|
135
|
-
This checks that your `.github/template.yml` is correctly formatted and valid.
|
|
164
|
+
This checks that your `.github/rhiza/template.yml` is correctly formatted and valid.
|
|
136
165
|
|
|
137
166
|
## Commands
|
|
138
167
|
|
|
139
168
|
### `rhiza init`
|
|
140
169
|
|
|
141
|
-
Initialize or validate `.github/template.yml` in a target directory.
|
|
170
|
+
Initialize or validate `.github/rhiza/template.yml` in a target directory.
|
|
142
171
|
|
|
143
172
|
**Usage:**
|
|
144
173
|
|
|
@@ -152,7 +181,7 @@ rhiza init [TARGET]
|
|
|
152
181
|
|
|
153
182
|
**Description:**
|
|
154
183
|
|
|
155
|
-
Creates a default `.github/template.yml` file if it doesn't exist, or validates an existing one. The default configuration includes common Python project files like `.github`, `.editorconfig`, `.gitignore`, `.pre-commit-config.yaml`, `Makefile`, and `pytest.ini`.
|
|
184
|
+
Creates a default `.github/rhiza/template.yml` file if it doesn't exist, or validates an existing one. The default configuration includes common Python project files like `.github`, `.editorconfig`, `.gitignore`, `.pre-commit-config.yaml`, `Makefile`, and `pytest.ini`.
|
|
156
185
|
|
|
157
186
|
**Examples:**
|
|
158
187
|
|
|
@@ -172,18 +201,18 @@ rhiza init ..
|
|
|
172
201
|
When creating a new template file:
|
|
173
202
|
```
|
|
174
203
|
[INFO] Initializing Rhiza configuration in: /path/to/project
|
|
175
|
-
[INFO] Creating default .github/template.yml
|
|
176
|
-
✓ Created .github/template.yml
|
|
204
|
+
[INFO] Creating default .github/rhiza/template.yml
|
|
205
|
+
✓ Created .github/rhiza/template.yml
|
|
177
206
|
|
|
178
207
|
Next steps:
|
|
179
|
-
1. Review and customize .github/template.yml to match your project needs
|
|
208
|
+
1. Review and customize .github/rhiza/template.yml to match your project needs
|
|
180
209
|
2. Run 'rhiza materialize' to inject templates into your repository
|
|
181
210
|
```
|
|
182
211
|
|
|
183
212
|
When validating an existing file:
|
|
184
213
|
```
|
|
185
214
|
[INFO] Validating template configuration in: /path/to/project
|
|
186
|
-
✓ Found template file: /path/to/project/.github/template.yml
|
|
215
|
+
✓ Found template file: /path/to/project/.github/rhiza/template.yml
|
|
187
216
|
✓ YAML syntax is valid
|
|
188
217
|
✓ Field 'template-repository' is present and valid
|
|
189
218
|
✓ Field 'include' is present and valid
|
|
@@ -218,7 +247,7 @@ rhiza materialize [OPTIONS] [TARGET]
|
|
|
218
247
|
|
|
219
248
|
Materializes template files from the configured template repository into your target project. This command:
|
|
220
249
|
|
|
221
|
-
1. Reads the `.github/template.yml` configuration
|
|
250
|
+
1. Reads the `.github/rhiza/template.yml` configuration
|
|
222
251
|
2. Performs a sparse clone of the template repository
|
|
223
252
|
3. Copies specified files/directories to your project
|
|
224
253
|
4. Respects exclusion patterns defined in the configuration
|
|
@@ -300,7 +329,7 @@ rhiza validate [TARGET]
|
|
|
300
329
|
|
|
301
330
|
**Description:**
|
|
302
331
|
|
|
303
|
-
Validates the `.github/template.yml` file to ensure it is syntactically correct and semantically valid. This performs authoritative validation including:
|
|
332
|
+
Validates the `.github/rhiza/template.yml` file to ensure it is syntactically correct and semantically valid. This performs authoritative validation including:
|
|
304
333
|
|
|
305
334
|
- Checking if the file exists
|
|
306
335
|
- Validating YAML syntax
|
|
@@ -331,7 +360,7 @@ rhiza validate ..
|
|
|
331
360
|
|
|
332
361
|
```
|
|
333
362
|
[INFO] Validating template configuration in: /path/to/project
|
|
334
|
-
✓ Found template file: /path/to/project/.github/template.yml
|
|
363
|
+
✓ Found template file: /path/to/project/.github/rhiza/template.yml
|
|
335
364
|
✓ YAML syntax is valid
|
|
336
365
|
✓ Field 'template-repository' is present and valid
|
|
337
366
|
✓ Field 'include' is present and valid
|
|
@@ -355,7 +384,7 @@ rhiza validate ..
|
|
|
355
384
|
or
|
|
356
385
|
|
|
357
386
|
```
|
|
358
|
-
[ERROR] Template file not found: /path/to/project/.github/template.yml
|
|
387
|
+
[ERROR] Template file not found: /path/to/project/.github/rhiza/template.yml
|
|
359
388
|
[INFO] Run 'rhiza materialize' or 'rhiza init' to create a default template.yml
|
|
360
389
|
```
|
|
361
390
|
|
|
@@ -363,7 +392,7 @@ or
|
|
|
363
392
|
|
|
364
393
|
## Configuration
|
|
365
394
|
|
|
366
|
-
Rhiza uses a `.github/template.yml` file to define template sources and what to include in your project.
|
|
395
|
+
Rhiza uses a `.github/rhiza/template.yml` file to define template sources and what to include in your project.
|
|
367
396
|
|
|
368
397
|
### Configuration File Format
|
|
369
398
|
|
|
@@ -504,7 +533,7 @@ git init
|
|
|
504
533
|
rhiza init
|
|
505
534
|
|
|
506
535
|
# Review the generated template.yml
|
|
507
|
-
cat .github/template.yml
|
|
536
|
+
cat .github/rhiza/template.yml
|
|
508
537
|
|
|
509
538
|
# Materialize templates
|
|
510
539
|
rhiza materialize
|
|
@@ -539,7 +568,7 @@ git commit -m "chore: update rhiza templates"
|
|
|
539
568
|
|
|
540
569
|
### Example 3: Using a custom template repository
|
|
541
570
|
|
|
542
|
-
Edit `.github/template.yml`:
|
|
571
|
+
Edit `.github/rhiza/template.yml`:
|
|
543
572
|
|
|
544
573
|
```yaml
|
|
545
574
|
template-repository: myorg/my-templates
|
|
@@ -561,7 +590,7 @@ rhiza materialize --force
|
|
|
561
590
|
|
|
562
591
|
### Example 4: Using a GitLab template repository
|
|
563
592
|
|
|
564
|
-
Edit `.github/template.yml`:
|
|
593
|
+
Edit `.github/rhiza/template.yml`:
|
|
565
594
|
|
|
566
595
|
```yaml
|
|
567
596
|
template-repository: mygroup/python-templates
|
|
@@ -701,7 +730,7 @@ Releasing and Versioning
|
|
|
701
730
|
post-release perform post-release tasks
|
|
702
731
|
|
|
703
732
|
Meta
|
|
704
|
-
sync sync with template repository as defined in .github/template.yml
|
|
733
|
+
sync sync with template repository as defined in .github/rhiza/template.yml
|
|
705
734
|
help Display this help message
|
|
706
735
|
customisations list available customisation scripts
|
|
707
736
|
update-readme update README.md with current Makefile help output
|
|
@@ -773,7 +802,7 @@ export PATH="$HOME/.local/bin:$PATH"
|
|
|
773
802
|
### Template validation fails
|
|
774
803
|
|
|
775
804
|
Check that:
|
|
776
|
-
1. Your `.github/template.yml` file exists
|
|
805
|
+
1. Your `.github/rhiza/template.yml` file exists
|
|
777
806
|
2. The YAML syntax is valid
|
|
778
807
|
3. Required fields (`template-repository` and `include`) are present
|
|
779
808
|
4. The repository format is `owner/repo`
|
|
@@ -805,11 +834,11 @@ A: Yes, as long as you have Git credentials configured that allow access to the
|
|
|
805
834
|
|
|
806
835
|
**Q: Does Rhiza support template repositories hosted outside GitHub?**
|
|
807
836
|
|
|
808
|
-
A: Yes! Rhiza supports both GitHub and GitLab repositories. Use the `template-host` field in your `.github/template.yml` to specify "github" (default) or "gitlab".
|
|
837
|
+
A: Yes! Rhiza supports both GitHub and GitLab repositories. Use the `template-host` field in your `.github/rhiza/template.yml` to specify "github" (default) or "gitlab".
|
|
809
838
|
|
|
810
839
|
**Q: How do I use a GitLab repository as a template source?**
|
|
811
840
|
|
|
812
|
-
A: Add `template-host: gitlab` to your `.github/template.yml` file. For example:
|
|
841
|
+
A: Add `template-host: gitlab` to your `.github/rhiza/template.yml` file. For example:
|
|
813
842
|
```yaml
|
|
814
843
|
template-repository: mygroup/myproject
|
|
815
844
|
template-host: gitlab
|
|
@@ -824,15 +853,23 @@ A: Not directly. However, you can run `rhiza materialize` multiple times with di
|
|
|
824
853
|
|
|
825
854
|
**Q: What's the difference between `rhiza init` and `rhiza materialize`?**
|
|
826
855
|
|
|
827
|
-
A: `init` creates or validates the `.github/template.yml` configuration file. `materialize` reads that configuration and actually copies the template files into your project.
|
|
856
|
+
A: `init` creates or validates the `.github/rhiza/template.yml` configuration file. `materialize` reads that configuration and actually copies the template files into your project.
|
|
828
857
|
|
|
829
858
|
**Q: How do I update my project's templates?**
|
|
830
859
|
|
|
831
860
|
A: Simply run `rhiza materialize --force` to fetch and overwrite with the latest versions from your template repository.
|
|
832
861
|
|
|
862
|
+
**Q: How do I update rhiza-cli itself?**
|
|
863
|
+
|
|
864
|
+
A: The update method depends on how you installed rhiza:
|
|
865
|
+
|
|
866
|
+
- **Using pip**: Run `pip install --upgrade rhiza`
|
|
867
|
+
- **Using uvx**: No action needed! `uvx` automatically uses the latest version each time you run it. Just run your command: `uvx rhiza <command>`
|
|
868
|
+
- **From source**: Run `git pull` in the repository directory and then `pip install -e .` again
|
|
869
|
+
|
|
833
870
|
**Q: Can I customize which files are included?**
|
|
834
871
|
|
|
835
|
-
A: Yes, edit the `include` and `exclude` lists in `.github/template.yml` to control exactly which files are copied.
|
|
872
|
+
A: Yes, edit the `include` and `exclude` lists in `.github/rhiza/template.yml` to control exactly which files are copied.
|
|
836
873
|
|
|
837
874
|
## Acknowledgments
|
|
838
875
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rhiza/__init__.py,sha256=iW3niLBjwRKxcMhIV_1eb78putjUTo2tbZsadofluJk,1939
|
|
2
|
+
rhiza/__main__.py,sha256=Lx0GqVZo6ymm0f18_uYB6E7_SOWwJNYjb73Vr31oLoM,236
|
|
3
|
+
rhiza/cli.py,sha256=faCIOKDzEDRvL4doLZhiIAyHUUGESGrwWLtjLjimCUY,5111
|
|
4
|
+
rhiza/models.py,sha256=fW9lofkkid-bghk2bXEgBdGbZ4scSqG726fMrVfKX_M,3454
|
|
5
|
+
rhiza/commands/__init__.py,sha256=Z5CeMh7ylX27H6dvwqRbEKzYo5pwQq-5TyTxABUSaQg,1848
|
|
6
|
+
rhiza/commands/init.py,sha256=1JFvT-Y8eYcjqhM7xaaRCBmelKlQNmxaVgyCOeDvydw,2310
|
|
7
|
+
rhiza/commands/materialize.py,sha256=aQcBp8VTBt5DPxyDC2VcgngqTdLDxqbYd5F_B2UF2_A,9534
|
|
8
|
+
rhiza/commands/validate.py,sha256=oYCZnTxr39l20jr6DhBpFtMURv7jULSV8Ii6it8KHxs,5628
|
|
9
|
+
rhiza/commands/welcome.py,sha256=gLgahbfBCBhmZPxWKywx7kYGBTMCVyyVVnly9uKdJv0,2007
|
|
10
|
+
rhiza-0.6.0.dist-info/METADATA,sha256=GrFAnXe3MUq0evyRHFQDE4Yv3mUziu2LKz0wrYFN1fQ,22523
|
|
11
|
+
rhiza-0.6.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
12
|
+
rhiza-0.6.0.dist-info/entry_points.txt,sha256=NAwZUpbXvfKv50a_Qq-PxMHl3lcjAyZO63IBeuUNgfY,45
|
|
13
|
+
rhiza-0.6.0.dist-info/licenses/LICENSE,sha256=4m5X7LhqX-6D0Ks79Ys8CLpmza8cxDG34g4S9XSNAGY,1077
|
|
14
|
+
rhiza-0.6.0.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
|