rhiza 0.5.0__tar.gz → 0.5.2__tar.gz

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.
Files changed (67) hide show
  1. rhiza-0.5.2/.github/README.md +33 -0
  2. rhiza-0.5.2/.github/TOKEN_SETUP.md +102 -0
  3. rhiza-0.5.2/.github/workflows/sync.yml +139 -0
  4. rhiza-0.5.2/.rhiza.history +45 -0
  5. {rhiza-0.5.0 → rhiza-0.5.2}/CLI.md +36 -0
  6. {rhiza-0.5.0 → rhiza-0.5.2}/Makefile +2 -2
  7. {rhiza-0.5.0 → rhiza-0.5.2}/PKG-INFO +7 -2
  8. {rhiza-0.5.0 → rhiza-0.5.2}/README.md +5 -0
  9. {rhiza-0.5.0 → rhiza-0.5.2}/USAGE.md +30 -0
  10. {rhiza-0.5.0 → rhiza-0.5.2}/pyproject.toml +2 -2
  11. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/__init__.py +1 -3
  12. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/cli.py +3 -3
  13. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/commands/__init__.py +4 -0
  14. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/commands/init.py +2 -4
  15. rhiza-0.5.2/src/rhiza/commands/materialize.py +181 -0
  16. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/commands/validate.py +2 -6
  17. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/models.py +13 -28
  18. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_commands/test_materialize.py +104 -0
  19. {rhiza-0.5.0 → rhiza-0.5.2}/uv.lock +5 -5
  20. rhiza-0.5.0/.github/scripts/sync.sh +0 -310
  21. rhiza-0.5.0/.github/workflows/sync.yml +0 -41
  22. rhiza-0.5.0/src/rhiza/commands/materialize.py +0 -140
  23. {rhiza-0.5.0 → rhiza-0.5.2}/.editorconfig +0 -0
  24. {rhiza-0.5.0 → rhiza-0.5.2}/.github/actions/setup-project/action.yml +0 -0
  25. {rhiza-0.5.0 → rhiza-0.5.2}/.github/copilot-instructions.md +0 -0
  26. {rhiza-0.5.0 → rhiza-0.5.2}/.github/renovate.json +0 -0
  27. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/book.sh +0 -0
  28. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/bump.sh +0 -0
  29. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/customisations/build-extras.sh +0 -0
  30. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/customisations/post-release.sh +0 -0
  31. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/marimushka.sh +0 -0
  32. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/release.sh +0 -0
  33. {rhiza-0.5.0 → rhiza-0.5.2}/.github/scripts/update-readme-help.sh +0 -0
  34. {rhiza-0.5.0 → rhiza-0.5.2}/.github/template.yml +0 -0
  35. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/book.yml +0 -0
  36. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/ci.yml +0 -0
  37. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/deptry.yml +0 -0
  38. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/marimo.yml +0 -0
  39. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/pre-commit.yml +0 -0
  40. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/release.yml +0 -0
  41. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/scripts/version_matrix.py +0 -0
  42. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/scripts/version_max.py +0 -0
  43. {rhiza-0.5.0 → rhiza-0.5.2}/.github/workflows/structure.yml +0 -0
  44. {rhiza-0.5.0 → rhiza-0.5.2}/.gitignore +0 -0
  45. {rhiza-0.5.0 → rhiza-0.5.2}/.pre-commit-config.yaml +0 -0
  46. {rhiza-0.5.0 → rhiza-0.5.2}/CODE_OF_CONDUCT.md +0 -0
  47. {rhiza-0.5.0 → rhiza-0.5.2}/CONTRIBUTING.md +0 -0
  48. {rhiza-0.5.0 → rhiza-0.5.2}/LICENSE +0 -0
  49. {rhiza-0.5.0 → rhiza-0.5.2}/book/marimo/.gitkeep +0 -0
  50. {rhiza-0.5.0 → rhiza-0.5.2}/pytest.ini +0 -0
  51. {rhiza-0.5.0 → rhiza-0.5.2}/ruff.toml +0 -0
  52. {rhiza-0.5.0 → rhiza-0.5.2}/src/rhiza/__main__.py +0 -0
  53. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_cli_commands.py +0 -0
  54. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_commands/test_init.py +0 -0
  55. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_commands/test_validate.py +0 -0
  56. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_models.py +0 -0
  57. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/README.md +0 -0
  58. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/conftest.py +0 -0
  59. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_bump_script.py +0 -0
  60. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_docstrings.py +0 -0
  61. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_git_repo_fixture.py +0 -0
  62. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_makefile.py +0 -0
  63. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_marimushka_script.py +0 -0
  64. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_readme.py +0 -0
  65. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_release_script.py +0 -0
  66. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_structure.py +0 -0
  67. {rhiza-0.5.0 → rhiza-0.5.2}/tests/test_rhiza/test_updatereadme_script.py +0 -0
@@ -0,0 +1,33 @@
1
+ # GitHub Configuration
2
+
3
+ This directory contains the GitHub-specific configuration for the repository.
4
+
5
+ ## Important Documentation
6
+
7
+ - **[TOKEN_SETUP.md](TOKEN_SETUP.md)** - Instructions for setting up the `PAT_TOKEN` secret required for the SYNC workflow
8
+
9
+ ## Workflows
10
+
11
+ The repository uses several automated workflows:
12
+
13
+ - **SYNC** (`workflows/sync.yml`) - Synchronizes with the template repository
14
+ - **Requires:** `PAT_TOKEN` secret with `workflow` scope when modifying workflow files
15
+ - See [TOKEN_SETUP.md](TOKEN_SETUP.md) for configuration
16
+ - **CI** (`workflows/ci.yml`) - Continuous integration tests
17
+ - **Pre-commit** (`workflows/pre-commit.yml`) - Code quality checks
18
+ - **Book** (`workflows/book.yml`) - Documentation deployment
19
+ - **Release** (`workflows/release.yml`) - Package publishing
20
+ - **Deptry** (`workflows/deptry.yml`) - Dependency checks
21
+ - **Marimo** (`workflows/marimo.yml`) - Interactive notebooks
22
+
23
+ ## Template Synchronization
24
+
25
+ This repository is synchronized with the template repository defined in `template.yml`.
26
+
27
+ The synchronization includes:
28
+ - GitHub workflows and actions
29
+ - Development tools configuration (`.editorconfig`, `ruff.toml`, etc.)
30
+ - Testing infrastructure
31
+ - Documentation templates
32
+
33
+ See `template.yml` for the complete list of synchronized files and exclusions.
@@ -0,0 +1,102 @@
1
+ # GitHub Personal Access Token (PAT) Setup
2
+
3
+ This document explains how to set up a Personal Access Token (PAT) for the repository's automated workflows.
4
+
5
+ ## Why is PAT_TOKEN needed?
6
+
7
+ The repository uses the `SYNC` workflow (`.github/workflows/sync.yml`) to automatically synchronize with a template repository. When this workflow modifies files in `.github/workflows/`, GitHub requires special permissions that the default `GITHUB_TOKEN` doesn't have.
8
+
9
+ According to GitHub's security policy:
10
+ - The default `GITHUB_TOKEN` **cannot** create or update workflow files (`.github/workflows/*.yml`)
11
+ - A Personal Access Token with the `workflow` scope **is required** to push changes to workflow files
12
+
13
+ ## Creating a PAT with workflow scope
14
+
15
+ Follow these steps to create a properly scoped Personal Access Token:
16
+
17
+ ### 1. Navigate to GitHub Settings
18
+
19
+ 1. Go to [GitHub.com](https://github.com)
20
+ 2. Click your profile picture (top-right corner)
21
+ 3. Click **Settings**
22
+ 4. Scroll down and click **Developer settings** (bottom of left sidebar)
23
+ 5. Click **Personal access tokens** → **Tokens (classic)**
24
+
25
+ ### 2. Generate a new token
26
+
27
+ 1. Click **Generate new token** → **Generate new token (classic)**
28
+ 2. Give your token a descriptive name, e.g., `TinyCTA Workflow Sync Token`
29
+ 3. Set an expiration date (recommended: 90 days or less for security)
30
+
31
+ ### 3. Select the required scopes
32
+
33
+ **Required scopes:**
34
+ - ✅ `repo` (Full control of private repositories)
35
+ - This automatically includes all repo sub-scopes
36
+ - ✅ `workflow` (Update GitHub Action workflows)
37
+ - **This is critical** - without this scope, pushing workflow changes will fail
38
+
39
+ **Optional but recommended:**
40
+ - `write:packages` (if the workflow publishes packages)
41
+
42
+ ### 4. Generate and copy the token
43
+
44
+ 1. Click **Generate token** at the bottom
45
+ 2. **Important:** Copy the token immediately - you won't be able to see it again!
46
+ 3. Store it securely (e.g., in a password manager)
47
+
48
+ ### 5. Add the token to repository secrets
49
+
50
+ 1. Navigate to your repository on GitHub
51
+ 2. Click **Settings** tab
52
+ 3. Click **Secrets and variables** → **Actions** (left sidebar)
53
+ 4. Click **New repository secret**
54
+ 5. Name: `PAT_TOKEN`
55
+ 6. Value: Paste the token you copied
56
+ 7. Click **Add secret**
57
+
58
+ ## Verifying the setup
59
+
60
+ After adding the `PAT_TOKEN` secret:
61
+
62
+ 1. Navigate to **Actions** tab in your repository
63
+ 2. Find the **SYNC** workflow
64
+ 3. Click **Run workflow** to manually trigger it
65
+ 4. If workflow files are modified, the workflow should successfully push them
66
+
67
+ ## Troubleshooting
68
+
69
+ ### Error: "refusing to allow a GitHub App to create or update workflow"
70
+
71
+ This error means either:
72
+ - The `PAT_TOKEN` secret is not set
73
+ - The `PAT_TOKEN` exists but lacks the `workflow` scope
74
+
75
+ **Solution:** Create a new token with the `workflow` scope and update the `PAT_TOKEN` secret.
76
+
77
+ ### Error: "push_succeeded=false"
78
+
79
+ This usually indicates:
80
+ - The token has expired
81
+ - The token was revoked
82
+ - The token lacks necessary permissions
83
+
84
+ **Solution:** Generate a new token following the steps above and update the secret.
85
+
86
+ ## Security best practices
87
+
88
+ 1. **Limit scope:** Only grant the minimum required scopes (`repo` and `workflow`)
89
+ 2. **Set expiration:** Use short-lived tokens (30-90 days) and rotate them regularly
90
+ 3. **Monitor usage:** Regularly review your token usage in GitHub settings
91
+ 4. **Revoke unused tokens:** Delete tokens that are no longer needed
92
+ 5. **Use separate tokens:** Don't reuse tokens across multiple projects
93
+
94
+ ## Alternative: GitHub App (Advanced)
95
+
96
+ For organizations, consider using a GitHub App instead of PAT:
97
+ - More secure and granular permissions
98
+ - Better audit logging
99
+ - No expiration issues
100
+ - Requires more setup complexity
101
+
102
+ Refer to [GitHub's documentation](https://docs.github.com/en/apps) for details on creating GitHub Apps.
@@ -0,0 +1,139 @@
1
+ name: SYNC
2
+ # This workflow synchronizes the repository with its template.
3
+ # IMPORTANT: When workflow files (.github/workflows/*.yml) are modified,
4
+ # a Personal Access Token (PAT) with 'workflow' scope is required.
5
+ # The PAT_TOKEN secret must be set in repository secrets.
6
+ # See .github/TOKEN_SETUP.md for setup instructions.
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+
12
+ on:
13
+ workflow_dispatch:
14
+ inputs:
15
+ create-pr:
16
+ description: "Create a pull request"
17
+ type: boolean
18
+ default: true
19
+ schedule:
20
+ - cron: '0 0 * * 1' # Weekly on Monday
21
+
22
+ jobs:
23
+ sync:
24
+ if: ${{ github.repository != 'jebel-quant/rhiza' && github.ref_name != 'rhiza_update' }}
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v6
30
+ with:
31
+ token: ${{ secrets.PAT_TOKEN }}
32
+ fetch-depth: 0
33
+
34
+ - name: Check PAT_TOKEN configuration
35
+ shell: bash
36
+ env:
37
+ PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
38
+ run: |
39
+ if [ -z "$PAT_TOKEN" ]; then
40
+ echo "::warning::PAT_TOKEN secret is not configured."
41
+ echo "::warning::If this sync modifies workflow files, the push will fail."
42
+ echo "::warning::See .github/TOKEN_SETUP.md for setup instructions."
43
+ else
44
+ echo "✓ PAT_TOKEN is configured."
45
+ fi
46
+
47
+ - name: Install uv
48
+ uses: astral-sh/setup-uv@v7
49
+
50
+ - name: Validate repository
51
+ shell: bash
52
+ run: |
53
+ uvx rhiza validate .
54
+
55
+ - name: Sync template
56
+ id: sync
57
+ shell: bash
58
+ env:
59
+ PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
60
+ run: |
61
+ set -euo pipefail
62
+
63
+ git checkout -B rhiza_update
64
+
65
+ uvx rhiza materialize --force .
66
+
67
+ git add -A
68
+
69
+ if git diff --cached --quiet; then
70
+ echo "No changes detected."
71
+ {
72
+ echo "changes_detected=false"
73
+ echo "workflows_changed=false"
74
+ echo "push_succeeded=false"
75
+ } >> "$GITHUB_OUTPUT"
76
+ exit 0
77
+ fi
78
+
79
+ echo "changes_detected=true" >> "$GITHUB_OUTPUT"
80
+
81
+ workflows_changed=false
82
+ can_push=true
83
+
84
+ if git diff --cached --name-only | grep -q '^\.github/workflows/'; then
85
+ workflows_changed=true
86
+ echo "workflows_changed=true" >> "$GITHUB_OUTPUT"
87
+ echo "⚠️ Workflow files modified."
88
+ echo ""
89
+ echo "ℹ️ Pushing workflow changes requires a PAT with 'workflow' scope."
90
+
91
+ if [ -n "$PAT_TOKEN" ]; then
92
+ git remote set-url origin \
93
+ "https://x-access-token:${PAT_TOKEN}@github.com/${{ github.repository }}.git"
94
+ echo "✓ Using PAT_TOKEN for authentication."
95
+ else
96
+ echo "::error::Workflow files changed but PAT_TOKEN secret is not set."
97
+ echo "::error::GitHub's security policy requires a Personal Access Token with 'workflow' scope to push workflow changes."
98
+ echo "::error::See .github/TOKEN_SETUP.md for instructions on creating and configuring the PAT_TOKEN secret."
99
+ can_push=false
100
+ fi
101
+ else
102
+ echo "workflows_changed=false" >> "$GITHUB_OUTPUT"
103
+ fi
104
+
105
+ git config user.name "github-actions[bot]"
106
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
107
+
108
+ git commit -m "chore: Update via rhiza"
109
+
110
+ if [ "$can_push" = true ]; then
111
+ if git push origin HEAD:rhiza_update --force-with-lease; then
112
+ echo "push_succeeded=true" >> "$GITHUB_OUTPUT"
113
+ else
114
+ echo "push_succeeded=false" >> "$GITHUB_OUTPUT"
115
+ echo "::error::Failed to push branch 'rhiza_update'."
116
+ echo "::error::If workflow files were changed, this is likely because:"
117
+ echo "::error:: 1. PAT_TOKEN secret is not set, OR"
118
+ echo "::error:: 2. PAT_TOKEN lacks the 'workflow' scope"
119
+ echo "::error::See .github/TOKEN_SETUP.md for setup instructions."
120
+ exit 1
121
+ fi
122
+ else
123
+ echo "push_succeeded=false" >> "$GITHUB_OUTPUT"
124
+ fi
125
+
126
+ - name: Create pull request
127
+ if: ${{ inputs.create-pr && steps.sync.outputs.changes_detected == 'true' && steps.sync.outputs.push_succeeded == 'true' }}
128
+ uses: peter-evans/create-pull-request@v8
129
+ with:
130
+ token: ${{ secrets.PAT_TOKEN || github.token }}
131
+ base: ${{ github.event.repository.default_branch }}
132
+ branch: rhiza_update
133
+ delete-branch: false
134
+ title: "chore: Update via rhiza"
135
+ body: |
136
+ This pull request synchronizes the repository with its template.
137
+
138
+ Changes were generated automatically using **rhiza**.
139
+
@@ -0,0 +1,45 @@
1
+ # Rhiza Template History
2
+ # This file lists all files managed by the Rhiza template.
3
+ # Template repository: jebel-quant/rhiza
4
+ # Template branch: main
5
+ #
6
+ # Files under template control:
7
+ .editorconfig
8
+ .github/README.md
9
+ .github/TOKEN_SETUP.md
10
+ .github/actions/setup-project/action.yml
11
+ .github/renovate.json
12
+ .github/scripts/book.sh
13
+ .github/scripts/bump.sh
14
+ .github/scripts/customisations/build-extras.sh
15
+ .github/scripts/customisations/post-release.sh
16
+ .github/scripts/marimushka.sh
17
+ .github/scripts/release.sh
18
+ .github/scripts/update-readme-help.sh
19
+ .github/workflows/book.yml
20
+ .github/workflows/ci.yml
21
+ .github/workflows/deptry.yml
22
+ .github/workflows/marimo.yml
23
+ .github/workflows/pre-commit.yml
24
+ .github/workflows/release.yml
25
+ .github/workflows/scripts/version_matrix.py
26
+ .github/workflows/scripts/version_max.py
27
+ .github/workflows/sync.yml
28
+ .gitignore
29
+ .pre-commit-config.yaml
30
+ CODE_OF_CONDUCT.md
31
+ CONTRIBUTING.md
32
+ Makefile
33
+ pytest.ini
34
+ ruff.toml
35
+ tests/test_rhiza/README.md
36
+ tests/test_rhiza/conftest.py
37
+ tests/test_rhiza/test_bump_script.py
38
+ tests/test_rhiza/test_docstrings.py
39
+ tests/test_rhiza/test_git_repo_fixture.py
40
+ tests/test_rhiza/test_makefile.py
41
+ tests/test_rhiza/test_marimushka_script.py
42
+ tests/test_rhiza/test_readme.py
43
+ tests/test_rhiza/test_release_script.py
44
+ tests/test_rhiza/test_structure.py
45
+ tests/test_rhiza/test_updatereadme_script.py
@@ -83,6 +83,7 @@ rhiza materialize -b main -y # Short form
83
83
  - Copies only specified files/directories
84
84
  - Respects exclude patterns
85
85
  - Skips existing files unless `--force` is used
86
+ - Creates `.rhiza.history` file listing all files under template control
86
87
 
87
88
  ---
88
89
 
@@ -119,6 +120,41 @@ rhiza validate .. # Validate parent directory
119
120
 
120
121
  ---
121
122
 
123
+ ## Generated Files
124
+
125
+ ### .rhiza.history
126
+
127
+ After running `rhiza materialize`, a `.rhiza.history` file is created in the project root. This file:
128
+
129
+ - Lists all files managed by the template
130
+ - Includes metadata about the template repository and branch
131
+ - Is regenerated each time `rhiza materialize` runs
132
+ - Should be committed to version control
133
+
134
+ **Example:**
135
+ ```
136
+ # Rhiza Template History
137
+ # This file lists all files managed by the Rhiza template.
138
+ # Template repository: jebel-quant/rhiza
139
+ # Template branch: main
140
+ #
141
+ # Files under template control:
142
+ .editorconfig
143
+ .gitignore
144
+ Makefile
145
+ ```
146
+
147
+ **Usage:**
148
+ ```bash
149
+ # View tracked files
150
+ cat .rhiza.history
151
+
152
+ # Check if a file is managed by template
153
+ grep "myfile.txt" .rhiza.history
154
+ ```
155
+
156
+ ---
157
+
122
158
  ## Configuration File Reference
123
159
 
124
160
  ### Location
@@ -196,8 +196,8 @@ post-release: install-uv ## perform post-release tasks
196
196
  fi
197
197
 
198
198
  ##@ Meta
199
- sync: ## sync with template repository as defined in .github/template.yml
200
- @UVX_BIN rhisa inject .
199
+ sync: install-uv ## sync with template repository as defined in .github/template.yml
200
+ @${UVX_BIN} rhiza materialize .
201
201
 
202
202
  help: ## Display this help message
203
203
  +@printf "$(BOLD)Usage:$(RESET)\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rhiza
3
- Version: 0.5.0
3
+ Version: 0.5.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
@@ -25,7 +25,7 @@ Requires-Dist: typer>=0.20.0
25
25
  Provides-Extra: dev
26
26
  Requires-Dist: marimo==0.18.4; extra == 'dev'
27
27
  Requires-Dist: pdoc>=16.0.0; extra == 'dev'
28
- Requires-Dist: pre-commit==4.5.0; extra == 'dev'
28
+ Requires-Dist: pre-commit==4.5.1; extra == 'dev'
29
29
  Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
30
30
  Requires-Dist: pytest-html>=4.1.1; extra == 'dev'
31
31
  Requires-Dist: pytest==9.0.2; extra == 'dev'
@@ -35,6 +35,9 @@ Description-Content-Type: text/markdown
35
35
 
36
36
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
37
37
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
38
+ [![PyPI version](https://img.shields.io/pypi/v/rhiza.svg)](https://pypi.org/project/rhiza/)
39
+ [![Coverage](https://img.shields.io/badge/coverage-report-brightgreen.svg)](https://jebel-quant.github.io/rhiza-cli/tests/html-coverage/index.html)
40
+ [![Downloads](https://static.pepy.tech/personalized-badge/rhiza?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/rhiza)
38
41
 
39
42
  Command-line interface for managing reusable configuration templates for modern Python projects.
40
43
 
@@ -675,9 +678,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
675
678
 
676
679
  ## Links
677
680
 
681
+ - **PyPI:** https://pypi.org/project/rhiza/
678
682
  - **Repository:** https://github.com/jebel-quant/rhiza-cli
679
683
  - **Issues:** https://github.com/jebel-quant/rhiza-cli/issues
680
684
  - **Documentation:** Generated with `make docs`
685
+ - **Companion Book:** https://jebel-quant.github.io/rhiza-cli/ (includes coverage report, API docs, and notebooks)
681
686
 
682
687
  ## Architecture
683
688
 
@@ -2,6 +2,9 @@
2
2
 
3
3
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![PyPI version](https://img.shields.io/pypi/v/rhiza.svg)](https://pypi.org/project/rhiza/)
6
+ [![Coverage](https://img.shields.io/badge/coverage-report-brightgreen.svg)](https://jebel-quant.github.io/rhiza-cli/tests/html-coverage/index.html)
7
+ [![Downloads](https://static.pepy.tech/personalized-badge/rhiza?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/rhiza)
5
8
 
6
9
  Command-line interface for managing reusable configuration templates for modern Python projects.
7
10
 
@@ -642,9 +645,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
642
645
 
643
646
  ## Links
644
647
 
648
+ - **PyPI:** https://pypi.org/project/rhiza/
645
649
  - **Repository:** https://github.com/jebel-quant/rhiza-cli
646
650
  - **Issues:** https://github.com/jebel-quant/rhiza-cli/issues
647
651
  - **Documentation:** Generated with `make docs`
652
+ - **Companion Book:** https://jebel-quant.github.io/rhiza-cli/ (includes coverage report, API docs, and notebooks)
648
653
 
649
654
  ## Architecture
650
655
 
@@ -94,6 +94,36 @@ git add .
94
94
  git commit -m "chore: initialize project with rhiza templates"
95
95
  ```
96
96
 
97
+ ### Understanding the History File
98
+
99
+ After materialization, Rhiza creates a `.rhiza.history` file that tracks all files under template control:
100
+
101
+ ```bash
102
+ cat .rhiza.history
103
+ ```
104
+
105
+ You'll see:
106
+ ```
107
+ # Rhiza Template History
108
+ # This file lists all files managed by the Rhiza template.
109
+ # Template repository: jebel-quant/rhiza
110
+ # Template branch: main
111
+ #
112
+ # Files under template control:
113
+ .editorconfig
114
+ .gitignore
115
+ Makefile
116
+ .github/workflows/ci.yml
117
+ ...
118
+ ```
119
+
120
+ This file helps you:
121
+ - Track which files are managed by the template
122
+ - Understand what will be updated when you re-run `rhiza materialize`
123
+ - Identify which files to be careful with when making local modifications
124
+
125
+ **Important:** The `.rhiza.history` file is regenerated each time you run `rhiza materialize`, so you should commit it along with your other template files.
126
+
97
127
  ## Basic Workflows
98
128
 
99
129
  ### Workflow 1: Starting a New Project
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "rhiza"
7
- version = "0.5.0"
7
+ version = "0.5.2"
8
8
  description = "Reusable configuration templates for modern Python projects"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -42,7 +42,7 @@ dev = [
42
42
  "pytest-cov>=7.0.0",
43
43
  "pytest-html>=4.1.1",
44
44
  "pytest==9.0.2",
45
- "pre-commit==4.5.0",
45
+ "pre-commit==4.5.1",
46
46
  "marimo==0.18.4",
47
47
  "pdoc>=16.0.0",
48
48
  ]
@@ -4,6 +4,4 @@ This package groups small, user-facing utilities that can be invoked from
4
4
  the command line or other automation scripts.
5
5
  """
6
6
 
7
- from rhiza.models import RhizaTemplate
8
-
9
- __all__ = ["RhizaTemplate"]
7
+ __all__ = ["commands", "models"]
@@ -8,9 +8,9 @@ from pathlib import Path
8
8
 
9
9
  import typer
10
10
 
11
- from rhiza.commands.init import init as init_cmd
12
- from rhiza.commands.materialize import materialize as materialize_cmd
13
- from rhiza.commands.validate import validate as validate_cmd
11
+ from rhiza.commands import init as init_cmd
12
+ from rhiza.commands import materialize as materialize_cmd
13
+ from rhiza.commands import validate as validate_cmd
14
14
 
15
15
  app = typer.Typer(
16
16
  help="Rhiza - Manage reusable configuration templates for Python projects",
@@ -3,3 +3,7 @@
3
3
  This package contains the functions that back Typer commands exposed by
4
4
  `rhiza.cli`, such as `hello` and `inject`.
5
5
  """
6
+
7
+ from .init import init # noqa: F401
8
+ from .materialize import materialize # noqa: F401
9
+ from .validate import validate # noqa: F401
@@ -19,10 +19,8 @@ def init(target: Path):
19
19
  Creates a default .github/template.yml file if it doesn't exist,
20
20
  or validates an existing one.
21
21
 
22
- Parameters
23
- ----------
24
- target:
25
- Path to the target directory. Defaults to the current working directory.
22
+ Args:
23
+ target: Path to the target directory. Defaults to the current working directory.
26
24
  """
27
25
  # Convert to absolute path to avoid surprises
28
26
  target = target.resolve()