rhiza 0.8.3__tar.gz → 0.8.4__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 (99) hide show
  1. rhiza-0.8.4/.github/ISSUE_TEMPLATE/assign_ui_implementation.md +1 -0
  2. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_book.yml +10 -11
  3. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_ci.yml +12 -5
  4. rhiza-0.8.4/.github/workflows/rhiza_codeql.yml +102 -0
  5. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_deptry.yml +2 -1
  6. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_marimo.yml +2 -1
  7. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_pre-commit.yml +2 -10
  8. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_release.yml +21 -15
  9. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_validate.yml +6 -5
  10. {rhiza-0.8.3 → rhiza-0.8.4}/.gitignore +5 -1
  11. {rhiza-0.8.3 → rhiza-0.8.4}/.pre-commit-config.yaml +1 -1
  12. rhiza-0.8.4/.python-version +1 -0
  13. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/history +7 -3
  14. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/book.sh +11 -0
  15. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/bump.sh +1 -2
  16. rhiza-0.8.4/.rhiza/scripts/generate-coverage-badge.sh +79 -0
  17. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/marimushka.sh +1 -1
  18. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/template.yml +3 -3
  19. rhiza-0.8.4/.rhiza.env +11 -0
  20. {rhiza-0.8.3 → rhiza-0.8.4}/Makefile +45 -25
  21. {rhiza-0.8.3 → rhiza-0.8.4}/PKG-INFO +11 -3
  22. {rhiza-0.8.3 → rhiza-0.8.4}/README.md +7 -2
  23. {rhiza-0.8.3 → rhiza-0.8.4}/book/Makefile.book +0 -7
  24. rhiza-0.8.4/book/README.md +23 -0
  25. {rhiza-0.8.3 → rhiza-0.8.4}/pyproject.toml +7 -1
  26. rhiza-0.8.4/src/rhiza/__main__.py +32 -0
  27. rhiza-0.8.4/src/rhiza/commands/init.py +295 -0
  28. rhiza-0.8.4/src/rhiza/commands/materialize.py +483 -0
  29. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/commands/migrate.py +99 -46
  30. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/commands/uninstall.py +136 -57
  31. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/commands/validate.py +182 -71
  32. rhiza-0.8.4/src/rhiza/subprocess_utils.py +26 -0
  33. {rhiza-0.8.3 → rhiza-0.8.4}/tests/Makefile.tests +3 -4
  34. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_cli_commands.py +68 -0
  35. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_commands/test_init.py +78 -0
  36. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_commands/test_materialize.py +104 -2
  37. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_commands/test_migrate.py +28 -0
  38. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/conftest.py +12 -9
  39. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_bump_script.py +19 -14
  40. rhiza-0.8.4/tests/test_rhiza/test_coverage_badge.py +94 -0
  41. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_git_repo_fixture.py +11 -7
  42. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_makefile.py +35 -3
  43. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_marimushka_script.py +7 -3
  44. rhiza-0.8.4/tests/test_rhiza/test_notebooks.py +88 -0
  45. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_release_script.py +23 -18
  46. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_structure.py +0 -4
  47. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_updatereadme_script.py +7 -3
  48. {rhiza-0.8.3 → rhiza-0.8.4}/uv.lock +148 -119
  49. rhiza-0.8.3/.github/dependabot.yml +0 -59
  50. rhiza-0.8.3/.github/rhiza/actions/setup-project/action.yml +0 -49
  51. rhiza-0.8.3/.github/workflows/rhiza_devcontainer.yml +0 -137
  52. rhiza-0.8.3/.github/workflows/rhiza_docker.yml +0 -63
  53. rhiza-0.8.3/src/rhiza/__main__.py +0 -10
  54. rhiza-0.8.3/src/rhiza/commands/init.py +0 -244
  55. rhiza-0.8.3/src/rhiza/commands/materialize.py +0 -422
  56. {rhiza-0.8.3 → rhiza-0.8.4}/.editorconfig +0 -0
  57. {rhiza-0.8.3 → rhiza-0.8.4}/.github/workflows/rhiza_sync.yml +0 -0
  58. {rhiza-0.8.3/.rhiza → rhiza-0.8.4/.rhiza/docs}/CONFIG.md +0 -0
  59. {rhiza-0.8.3/.rhiza → rhiza-0.8.4/.rhiza/docs}/TOKEN_SETUP.md +0 -0
  60. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/customisations/build-extras.sh +0 -0
  61. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/customisations/post-release.sh +0 -0
  62. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/release.sh +0 -0
  63. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/scripts/update-readme-help.sh +0 -0
  64. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/utils/version_matrix.py +0 -0
  65. {rhiza-0.8.3 → rhiza-0.8.4}/.rhiza/utils/version_max.py +0 -0
  66. {rhiza-0.8.3 → rhiza-0.8.4}/CLI.md +0 -0
  67. {rhiza-0.8.3 → rhiza-0.8.4}/CODE_OF_CONDUCT.md +0 -0
  68. {rhiza-0.8.3 → rhiza-0.8.4}/CONTRIBUTING.md +0 -0
  69. {rhiza-0.8.3 → rhiza-0.8.4}/GETTING_STARTED.md +0 -0
  70. {rhiza-0.8.3 → rhiza-0.8.4}/LICENSE +0 -0
  71. {rhiza-0.8.3 → rhiza-0.8.4}/USAGE.md +0 -0
  72. {rhiza-0.8.3 → rhiza-0.8.4}/book/marimo/.gitkeep +0 -0
  73. {rhiza-0.8.3 → rhiza-0.8.4}/book/marimo/README.md +0 -0
  74. {rhiza-0.8.3 → rhiza-0.8.4}/book/marimo/rhiza.py +0 -0
  75. {rhiza-0.8.3 → rhiza-0.8.4}/book/minibook-templates/custom.html.jinja2 +0 -0
  76. {rhiza-0.8.3 → rhiza-0.8.4}/book/pdoc-templates/module.html.jinja2 +0 -0
  77. {rhiza-0.8.3 → rhiza-0.8.4}/presentation/Makefile.presentation +0 -0
  78. {rhiza-0.8.3 → rhiza-0.8.4}/presentation/README.md +0 -0
  79. {rhiza-0.8.3 → rhiza-0.8.4}/pytest.ini +0 -0
  80. {rhiza-0.8.3 → rhiza-0.8.4}/renovate.json +0 -0
  81. {rhiza-0.8.3 → rhiza-0.8.4}/ruff.toml +0 -0
  82. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/__init__.py +0 -0
  83. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/_templates/basic/__init__.py.jinja2 +0 -0
  84. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/_templates/basic/main.py.jinja2 +0 -0
  85. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/_templates/basic/pyproject.toml.jinja2 +0 -0
  86. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/cli.py +0 -0
  87. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/commands/__init__.py +0 -0
  88. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/commands/welcome.py +0 -0
  89. {rhiza-0.8.3 → rhiza-0.8.4}/src/rhiza/models.py +0 -0
  90. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_commands/test_uninstall.py +0 -0
  91. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_commands/test_validate.py +0 -0
  92. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_models.py +0 -0
  93. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_package.py +0 -0
  94. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/README.md +0 -0
  95. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/benchmarks/.gitignore +0 -0
  96. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/benchmarks/README.md +0 -0
  97. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/benchmarks/analyze_benchmarks.py +0 -0
  98. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_docstrings.py +0 -0
  99. {rhiza-0.8.3 → rhiza-0.8.4}/tests/test_rhiza/test_readme.py +0 -0
@@ -0,0 +1 @@
1
+ - [ ] Assign implementation to GitHub Copilot
@@ -40,18 +40,17 @@ jobs:
40
40
  with:
41
41
  lfs: true
42
42
 
43
- # Determine the Python version to use
44
- - name: Get Python version
45
- id: get-python
46
- run: |
47
- echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
48
-
49
- # Use the composite action to set up the project
50
- - name: Setup the project
51
- uses: ./.github/rhiza/actions/setup-project
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v7
52
45
  with:
53
- python-version: ${{ steps.get-python.outputs.python-version }}
54
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
46
+ version: "0.9.21"
47
+
48
+ - name: "Sync the virtual environment for ${{ github.repository }}"
49
+ shell: bash
50
+ run: |
51
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
52
+ # will just use .python-version?
53
+ uv sync --all-extras --frozen
55
54
 
56
55
  - name: "Make the book"
57
56
  run: |
@@ -14,8 +14,9 @@ permissions:
14
14
 
15
15
  on:
16
16
  push:
17
+ branches: [ main, master ]
17
18
  pull_request:
18
- branches: [main, master]
19
+ branches: [ main, master ]
19
20
 
20
21
  jobs:
21
22
  generate-matrix:
@@ -49,11 +50,17 @@ jobs:
49
50
  with:
50
51
  lfs: true
51
52
 
52
- - name: Setup the project
53
- uses: ./.github/rhiza/actions/setup-project
53
+ - name: Install uv
54
+ uses: astral-sh/setup-uv@v7
54
55
  with:
55
- python-version: ${{ matrix.python-version }}
56
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
56
+ version: "0.9.21"
57
+
58
+ - name: "Sync the virtual environment for ${{ github.repository }}"
59
+ shell: bash
60
+ run: |
61
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
62
+ uv venv --python ${{ matrix.python-version }}
63
+ uv sync --all-extras --frozen
57
64
 
58
65
  - name: Install dependencies
59
66
  run: |
@@ -0,0 +1,102 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main", "master" ]
17
+ pull_request:
18
+ branches: [ "main", "master" ]
19
+ schedule:
20
+ - cron: '27 1 * * 1'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ if: ${{ !github.event.repository.private }}
32
+ permissions:
33
+ # required for all workflows
34
+ security-events: write
35
+
36
+ # required to fetch internal or private CodeQL packs
37
+ packages: read
38
+
39
+ # only required for workflows in private repositories
40
+ actions: read
41
+ contents: read
42
+
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ include:
47
+ - language: actions
48
+ build-mode: none
49
+ - language: python
50
+ build-mode: none
51
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
52
+ # Use `c-cpp` to analyze code written in C, C++ or both
53
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
54
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
55
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
56
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
57
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
58
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
59
+ steps:
60
+ - name: Checkout repository
61
+ uses: actions/checkout@v6
62
+
63
+ # Add any setup steps before running the `github/codeql-action/init` action.
64
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
65
+ # or others). This is typically only required for manual builds.
66
+ # - name: Setup runtime (example)
67
+ # uses: actions/setup-example@v1
68
+
69
+ # Initializes the CodeQL tools for scanning.
70
+ - name: Initialize CodeQL
71
+ uses: github/codeql-action/init@v4
72
+ with:
73
+ languages: ${{ matrix.language }}
74
+ build-mode: ${{ matrix.build-mode }}
75
+ # If you wish to specify custom queries, you can do so here or in a config file.
76
+ # By default, queries listed here will override any specified in a config file.
77
+ # Prefix the list here with "+" to use these queries and those in the config file.
78
+
79
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
80
+ # queries: security-extended,security-and-quality
81
+
82
+ # If the analyze step fails for one of the languages you are analyzing with
83
+ # "We were unable to automatically build your code", modify the matrix above
84
+ # to set the build mode to "manual" for that language. Then modify this step
85
+ # to build your code.
86
+ # ℹ️ Command-line programs to run using the OS shell.
87
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88
+ - name: Run manual build steps
89
+ if: matrix.build-mode == 'manual'
90
+ shell: bash
91
+ run: |
92
+ echo 'If you are using a "manual" build mode for one or more of the' \
93
+ 'languages you are analyzing, replace this with the commands to build' \
94
+ 'your code, for example:'
95
+ echo ' make bootstrap'
96
+ echo ' make release'
97
+ exit 1
98
+
99
+ - name: Perform CodeQL Analysis
100
+ uses: github/codeql-action/analyze@v4
101
+ with:
102
+ category: "/language:${{matrix.language}}"
@@ -18,6 +18,7 @@ permissions:
18
18
 
19
19
  on:
20
20
  push:
21
+ branches: [ main, master ]
21
22
  pull_request:
22
23
  branches: [ main, master ]
23
24
 
@@ -26,7 +27,7 @@ jobs:
26
27
  name: Check dependencies with deptry
27
28
  runs-on: ubuntu-latest
28
29
  container:
29
- image: ghcr.io/astral-sh/uv:0.9.18-python3.12-trixie
30
+ image: ghcr.io/astral-sh/uv:0.9.21-python3.12-trixie
30
31
 
31
32
  steps:
32
33
  - uses: actions/checkout@v6
@@ -22,6 +22,7 @@ permissions:
22
22
 
23
23
  on:
24
24
  push:
25
+ branches: [ main, master ]
25
26
  pull_request:
26
27
  branches: [ main, master ]
27
28
 
@@ -79,7 +80,7 @@ jobs:
79
80
  - name: Install uv
80
81
  uses: astral-sh/setup-uv@v7
81
82
  with:
82
- version: "0.9.18"
83
+ version: "0.9.21"
83
84
 
84
85
  # Execute the notebook with the appropriate runner based on its content
85
86
  - name: Run notebook
@@ -20,6 +20,7 @@ permissions:
20
20
 
21
21
  on:
22
22
  push:
23
+ branches: [ main, master ]
23
24
  pull_request:
24
25
  branches: [ main, master ]
25
26
 
@@ -30,14 +31,5 @@ jobs:
30
31
  steps:
31
32
  - uses: actions/checkout@v6
32
33
 
33
- - name: Get Python version
34
- id: get-python
35
- run: |
36
- echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
37
-
38
- - uses: ./.github/rhiza/actions/setup-project
39
- with:
40
- python-version: ${{ steps.get-python.outputs.python-version }}
41
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
42
-
43
34
  - uses: pre-commit/action@v3.0.1
35
+
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # 📋 Pipeline Phases:
9
9
  # 1. 🔍 Validate Tag - Check tag format and ensure release doesn't already exist
10
- # 2. 🏗️ Build - Build Python package with Hatch (if [build-system] is defined in pyproject.toml
10
+ # 2. 🏗️ Build - Build Python package with Hatch (if [build-system] is defined in pyproject.toml
11
11
  # 3. 📝 Draft Release - Create draft GitHub release with build artifacts
12
12
  # 4. 🚀 Publish to PyPI - Publish package using OIDC or custom feed
13
13
  # 5. 🐳 Publish Devcontainer - Build and publish devcontainer image (conditional)
@@ -107,14 +107,18 @@ jobs:
107
107
  uses: actions/checkout@v6
108
108
  with:
109
109
  fetch-depth: 0
110
- ref: ${{ github.ref }}
111
110
 
112
- # Use the composite action to set up the project
113
- - name: Setup the project
114
- uses: ./.github/rhiza/actions/setup-project
111
+ - name: Install uv
112
+ uses: astral-sh/setup-uv@v7
115
113
  with:
116
- python-version: ${{ vars.PYTHON_DEFAULT_VERSION || '3.14' }}
117
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
114
+ version: "0.9.21"
115
+
116
+ - name: "Sync the virtual environment for ${{ github.repository }}"
117
+ shell: bash
118
+ run: |
119
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
120
+ # will just use .python-version?
121
+ uv sync --all-extras --frozen
118
122
 
119
123
  - name: Verify version matches tag
120
124
  if: hashFiles('pyproject.toml') != ''
@@ -181,7 +185,6 @@ jobs:
181
185
  uses: actions/checkout@v6
182
186
  with:
183
187
  fetch-depth: 0
184
- #ref: ${{ github.ref }}
185
188
 
186
189
  - name: Download dist artifact
187
190
  uses: actions/download-artifact@v7
@@ -230,7 +233,6 @@ jobs:
230
233
  uses: actions/checkout@v6
231
234
  with:
232
235
  fetch-depth: 0
233
- ref: ${{ github.ref }}
234
236
 
235
237
  - name: Check if devcontainer should be published
236
238
  id: check_publish
@@ -316,17 +318,21 @@ jobs:
316
318
  uses: actions/checkout@v6
317
319
  with:
318
320
  fetch-depth: 0
319
- ref: ${{ github.ref }}
320
321
 
321
- - name: Get Python version
322
- id: get-python
322
+ - name: Install uv
323
+ uses: astral-sh/setup-uv@v7
324
+ with:
325
+ version: "0.9.21"
326
+
327
+ - name: "Sync the virtual environment for ${{ github.repository }}"
328
+ shell: bash
323
329
  run: |
324
- echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
330
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
331
+ # will just use .python-version?
332
+ uv sync --all-extras --frozen
325
333
 
326
334
  - name: Set up Python
327
335
  uses: actions/setup-python@v6
328
- with:
329
- python-version: ${{ fromJSON(steps.get-python.outputs.python-version) }}
330
336
 
331
337
  - name: Generate Devcontainer Link
332
338
  id: devcontainer_link
@@ -5,6 +5,7 @@ permissions:
5
5
 
6
6
  on:
7
7
  push:
8
+ branches: [ main, master ]
8
9
  pull_request:
9
10
  branches: [ main, master ]
10
11
 
@@ -14,13 +15,13 @@ jobs:
14
15
  # don't run this in rhiza itself. Rhiza has no template.yml file.
15
16
  if: ${{ github.repository != 'jebel-quant/rhiza' }}
16
17
  container:
17
- image: ghcr.io/astral-sh/uv:0.9.18-python3.12-trixie
18
+ image: ghcr.io/astral-sh/uv:0.9.21-python3.12-trixie
18
19
 
19
20
  steps:
20
21
  - name: Checkout repository
21
22
  uses: actions/checkout@v6
22
23
 
23
- #- name: Validate Rhiza config
24
- # shell: bash
25
- # run: |
26
- # uvx rhiza validate .
24
+ - name: Validate Rhiza config
25
+ shell: bash
26
+ run: |
27
+ uvx "rhiza>=0.8.0" validate .
@@ -3,6 +3,9 @@
3
3
  .venv
4
4
  .ruff_cache
5
5
 
6
+ ### Don't expose API keys, etc.
7
+ .env
8
+
6
9
  __marimo__
7
10
 
8
11
  _tests
@@ -29,7 +32,7 @@ presentation.pdf
29
32
  # C extensions
30
33
  *.so
31
34
 
32
- # .DS_Store
35
+ # .DS_Store
33
36
  .DS_Store
34
37
 
35
38
  # Distribution / packaging
@@ -65,6 +68,7 @@ htmlcov/
65
68
  .cache
66
69
  nosetests.xml
67
70
  coverage.xml
71
+ coverage.json
68
72
  *.cover
69
73
  *.py,cover
70
74
  .hypothesis/
@@ -33,7 +33,7 @@ repos:
33
33
  args: ["--verbose"]
34
34
 
35
35
  - repo: https://github.com/rhysd/actionlint
36
- rev: v1.7.9
36
+ rev: v1.7.10
37
37
  hooks:
38
38
  - id: actionlint
39
39
  args: [ -ignore, SC ]
@@ -0,0 +1 @@
1
+ 3.12
@@ -6,9 +6,9 @@
6
6
  # Files under template control:
7
7
  .editorconfig
8
8
  .github/dependabot.yml
9
- .github/rhiza/actions/setup-project/action.yml
10
9
  .github/workflows/rhiza_book.yml
11
10
  .github/workflows/rhiza_ci.yml
11
+ .github/workflows/rhiza_codeql.yml
12
12
  .github/workflows/rhiza_deptry.yml
13
13
  .github/workflows/rhiza_devcontainer.yml
14
14
  .github/workflows/rhiza_docker.yml
@@ -19,12 +19,13 @@
19
19
  .github/workflows/rhiza_validate.yml
20
20
  .gitignore
21
21
  .pre-commit-config.yaml
22
- .rhiza/CONFIG.md
23
- .rhiza/TOKEN_SETUP.md
22
+ .rhiza/docs/CONFIG.md
23
+ .rhiza/docs/TOKEN_SETUP.md
24
24
  .rhiza/scripts/book.sh
25
25
  .rhiza/scripts/bump.sh
26
26
  .rhiza/scripts/customisations/build-extras.sh
27
27
  .rhiza/scripts/customisations/post-release.sh
28
+ .rhiza/scripts/generate-coverage-badge.sh
28
29
  .rhiza/scripts/marimushka.sh
29
30
  .rhiza/scripts/release.sh
30
31
  .rhiza/scripts/update-readme-help.sh
@@ -34,6 +35,7 @@ CODE_OF_CONDUCT.md
34
35
  CONTRIBUTING.md
35
36
  Makefile
36
37
  book/Makefile.book
38
+ book/README.md
37
39
  book/marimo/README.md
38
40
  book/marimo/rhiza.py
39
41
  book/minibook-templates/custom.html.jinja2
@@ -50,10 +52,12 @@ tests/test_rhiza/benchmarks/README.md
50
52
  tests/test_rhiza/benchmarks/analyze_benchmarks.py
51
53
  tests/test_rhiza/conftest.py
52
54
  tests/test_rhiza/test_bump_script.py
55
+ tests/test_rhiza/test_coverage_badge.py
53
56
  tests/test_rhiza/test_docstrings.py
54
57
  tests/test_rhiza/test_git_repo_fixture.py
55
58
  tests/test_rhiza/test_makefile.py
56
59
  tests/test_rhiza/test_marimushka_script.py
60
+ tests/test_rhiza/test_notebooks.py
57
61
  tests/test_rhiza/test_readme.py
58
62
  tests/test_rhiza/test_release_script.py
59
63
  tests/test_rhiza/test_structure.py
@@ -8,6 +8,11 @@
8
8
 
9
9
  set -e
10
10
 
11
+ # Determine SCRIPTS_FOLDER if not set
12
+ if [ -z "${SCRIPTS_FOLDER}" ]; then
13
+ SCRIPTS_FOLDER="$(cd "$(dirname "$0")" && pwd)"
14
+ fi
15
+
11
16
  BLUE="\033[36m"
12
17
  YELLOW="\033[33m"
13
18
  RESET="\033[0m"
@@ -43,6 +48,12 @@ if [ -f _tests/html-coverage/index.html ]; then
43
48
  else
44
49
  LINKS_ENTRIES='"Coverage": "./tests/html-coverage/index.html"'
45
50
  fi
51
+
52
+ # Generate coverage badge JSON if coverage.json exists
53
+ if [ -f _tests/coverage.json ]; then
54
+ printf "%b[INFO] Generating coverage badge...%b\n" "$BLUE" "$RESET"
55
+ /bin/sh "${SCRIPTS_FOLDER}/generate-coverage-badge.sh"
56
+ fi
46
57
  else
47
58
  printf "%b[WARN] No coverage report found or directory is empty%b\n" "$YELLOW" "$RESET"
48
59
  fi
@@ -131,8 +131,7 @@ do_bump() {
131
131
  if [ -n "$TYPE" ]; then
132
132
  # For bump types (patch/minor/major), calculate what the new version will be
133
133
  printf "%b[INFO] Bumping version using: %s%b\n" "$BLUE" "$TYPE" "$RESET"
134
- NEW_VERSION=$("$UV_BIN" version --bump "$TYPE" --dry-run --short 2>/dev/null)
135
- if [ $? -ne 0 ] || [ -z "$NEW_VERSION" ]; then
134
+ if ! NEW_VERSION=$("$UV_BIN" version --bump "$TYPE" --dry-run --short 2>/dev/null) || [ -z "$NEW_VERSION" ]; then
136
135
  printf "%b[ERROR] Failed to calculate new version with type: %s%b\n" "$RED" "$TYPE" "$RESET"
137
136
  exit 1
138
137
  fi
@@ -0,0 +1,79 @@
1
+ #!/bin/sh
2
+ # Generate a coverage badge endpoint JSON for shields.io
3
+ # This script reads _tests/coverage.json and creates a shields.io endpoint JSON file
4
+
5
+ set -e
6
+
7
+ BLUE="\033[36m"
8
+ YELLOW="\033[33m"
9
+ RESET="\033[0m"
10
+
11
+ COVERAGE_JSON="_tests/coverage.json"
12
+ OUTPUT_DIR="_book/tests"
13
+ BADGE_JSON="${OUTPUT_DIR}/coverage-badge.json"
14
+
15
+ if [ ! -f "${COVERAGE_JSON}" ]; then
16
+ printf "%b[WARN] Coverage JSON file not found at ${COVERAGE_JSON}, skipping badge generation%b\n" "$YELLOW" "$RESET"
17
+ exit 0
18
+ fi
19
+
20
+ printf "%b[INFO] Generating coverage badge from ${COVERAGE_JSON}...%b\n" "$BLUE" "$RESET"
21
+
22
+ # Extract coverage percentage and round it
23
+ if ! COVERAGE=$(COVERAGE_JSON="${COVERAGE_JSON}" python3 << 'PYTHON_SCRIPT'
24
+ import json
25
+ import sys
26
+ import os
27
+
28
+ coverage_json = os.environ['COVERAGE_JSON']
29
+
30
+ try:
31
+ with open(coverage_json, 'r') as f:
32
+ data = json.load(f)
33
+ percent = data['totals']['percent_covered']
34
+ print(f'{percent:.0f}')
35
+ except Exception as e:
36
+ print(f'Error extracting coverage: {e}', file=sys.stderr)
37
+ sys.exit(1)
38
+ PYTHON_SCRIPT
39
+ ); then
40
+ printf "%b[ERROR] Failed to extract coverage percentage%b\n" "$YELLOW" "$RESET"
41
+ exit 1
42
+ fi
43
+
44
+ if [ -z "${COVERAGE}" ]; then
45
+ printf "%b[ERROR] Coverage percentage is empty%b\n" "$YELLOW" "$RESET"
46
+ exit 1
47
+ fi
48
+
49
+ printf "%b[INFO] Coverage: ${COVERAGE}%%%b\n" "$BLUE" "$RESET"
50
+
51
+ # Determine badge color based on coverage percentage
52
+ if [ "${COVERAGE}" -ge 90 ]; then
53
+ COLOR="brightgreen"
54
+ elif [ "${COVERAGE}" -ge 80 ]; then
55
+ COLOR="green"
56
+ elif [ "${COVERAGE}" -ge 70 ]; then
57
+ COLOR="yellowgreen"
58
+ elif [ "${COVERAGE}" -ge 60 ]; then
59
+ COLOR="yellow"
60
+ elif [ "${COVERAGE}" -ge 50 ]; then
61
+ COLOR="orange"
62
+ else
63
+ COLOR="red"
64
+ fi
65
+
66
+ # Create output directory if it doesn't exist
67
+ mkdir -p "${OUTPUT_DIR}"
68
+
69
+ # Generate shields.io endpoint JSON
70
+ cat > "${BADGE_JSON}" << EOF
71
+ {
72
+ "schemaVersion": 1,
73
+ "label": "coverage",
74
+ "message": "${COVERAGE}%",
75
+ "color": "${COLOR}"
76
+ }
77
+ EOF
78
+
79
+ printf "%b[INFO] Coverage badge JSON generated at ${BADGE_JSON}%b\n" "$BLUE" "$RESET"
@@ -74,4 +74,4 @@ cd "$MARIMO_FOLDER"
74
74
  # Ensure GitHub Pages does not process with Jekyll
75
75
  # The : command is a no-op that creates an empty file
76
76
  # .nojekyll tells GitHub Pages to serve files as-is without Jekyll processing
77
- : > "$OUTPUT_DIR/.nojekyll"
77
+ : > "$OUTPUT_DIR/.nojekyll"
@@ -1,7 +1,7 @@
1
1
  template-repository: "jebel-quant/rhiza"
2
2
  template-branch: "main"
3
3
  include:
4
- - .github
4
+ - .github/workflows
5
5
  - .rhiza
6
6
  - tests
7
7
  - .editorconfig
@@ -16,5 +16,5 @@ include:
16
16
  - book
17
17
  - renovate.json
18
18
  exclude:
19
- - .github/workflows/docker.yml
20
- - .github/workflows/devcontainer.yml
19
+ - .github/workflows/rhiza_docker.yml
20
+ - .github/workflows/rhiza_devcontainer.yml
rhiza-0.8.4/.rhiza.env ADDED
@@ -0,0 +1,11 @@
1
+ MARIMO_FOLDER=book/marimo
2
+ SOURCE_FOLDER=src
3
+ SCRIPTS_FOLDER=.rhiza/scripts
4
+ CUSTOM_SCRIPTS_FOLDER=.rhiza/scripts/customisations
5
+
6
+ # Book-specific variables
7
+ BOOK_TITLE=RHIZA
8
+ BOOK_SUBTITLE=Generated by minibook
9
+ PDOC_TEMPLATE_DIR=book/pdoc-templates
10
+ BOOK_TEMPLATE=book/minibook-templates/custom.html.jinja2
11
+ DOCFORMAT=google