rhiza 0.8.3__tar.gz → 0.8.5__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 (108) hide show
  1. rhiza-0.8.5/.github/ISSUE_TEMPLATE/assign_ui_implementation.md +1 -0
  2. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_book.yml +12 -10
  3. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_ci.yml +19 -11
  4. rhiza-0.8.5/.github/workflows/rhiza_codeql.yml +102 -0
  5. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_deptry.yml +7 -9
  6. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_marimo.yml +2 -1
  7. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_pre-commit.yml +2 -10
  8. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_release.yml +21 -15
  9. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_validate.yml +6 -5
  10. {rhiza-0.8.3 → rhiza-0.8.5}/.gitignore +5 -1
  11. {rhiza-0.8.3 → rhiza-0.8.5}/.pre-commit-config.yaml +1 -1
  12. rhiza-0.8.5/.python-version +1 -0
  13. rhiza-0.8.5/.rhiza/.cfg.toml +31 -0
  14. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/history +14 -7
  15. rhiza-0.8.5/.rhiza/requirements/README.md +27 -0
  16. rhiza-0.8.5/.rhiza/requirements/docs.txt +2 -0
  17. rhiza-0.8.5/.rhiza/requirements/marimo.txt +2 -0
  18. rhiza-0.8.5/.rhiza/requirements/tests.txt +4 -0
  19. rhiza-0.8.5/.rhiza/requirements/tools.txt +3 -0
  20. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/book.sh +11 -0
  21. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/bump.sh +1 -2
  22. rhiza-0.8.5/.rhiza/scripts/generate-coverage-badge.sh +79 -0
  23. rhiza-0.8.5/.rhiza/scripts/install-dev-deps.sh +25 -0
  24. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/marimushka.sh +1 -1
  25. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/template.yml +3 -3
  26. rhiza-0.8.5/.rhiza/utils/version_matrix.py +117 -0
  27. rhiza-0.8.5/.rhiza.env +11 -0
  28. {rhiza-0.8.3 → rhiza-0.8.5}/Makefile +79 -37
  29. {rhiza-0.8.3 → rhiza-0.8.5}/PKG-INFO +8 -10
  30. {rhiza-0.8.3 → rhiza-0.8.5}/README.md +7 -2
  31. {rhiza-0.8.3 → rhiza-0.8.5}/book/Makefile.book +0 -7
  32. rhiza-0.8.5/book/README.md +23 -0
  33. {rhiza-0.8.3 → rhiza-0.8.5}/pyproject.toml +11 -12
  34. rhiza-0.8.5/src/rhiza/__main__.py +32 -0
  35. rhiza-0.8.5/src/rhiza/commands/init.py +295 -0
  36. rhiza-0.8.5/src/rhiza/commands/materialize.py +483 -0
  37. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/commands/migrate.py +99 -46
  38. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/commands/uninstall.py +136 -57
  39. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/commands/validate.py +182 -71
  40. rhiza-0.8.5/src/rhiza/subprocess_utils.py +26 -0
  41. {rhiza-0.8.3 → rhiza-0.8.5}/tests/Makefile.tests +5 -6
  42. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_cli_commands.py +68 -0
  43. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_commands/test_init.py +78 -0
  44. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_commands/test_materialize.py +104 -2
  45. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_commands/test_migrate.py +28 -0
  46. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/conftest.py +12 -9
  47. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_bump_script.py +19 -14
  48. rhiza-0.8.5/tests/test_rhiza/test_coverage_badge.py +94 -0
  49. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_git_repo_fixture.py +11 -7
  50. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_makefile.py +39 -46
  51. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_marimushka_script.py +7 -3
  52. rhiza-0.8.5/tests/test_rhiza/test_notebooks.py +88 -0
  53. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_release_script.py +22 -18
  54. rhiza-0.8.5/tests/test_rhiza/test_requirements_folder.py +64 -0
  55. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_structure.py +0 -4
  56. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_updatereadme_script.py +7 -3
  57. {rhiza-0.8.3 → rhiza-0.8.5}/uv.lock +486 -308
  58. rhiza-0.8.3/.github/dependabot.yml +0 -59
  59. rhiza-0.8.3/.github/rhiza/actions/setup-project/action.yml +0 -49
  60. rhiza-0.8.3/.github/workflows/rhiza_devcontainer.yml +0 -137
  61. rhiza-0.8.3/.github/workflows/rhiza_docker.yml +0 -63
  62. rhiza-0.8.3/.rhiza/utils/version_matrix.py +0 -63
  63. rhiza-0.8.3/.rhiza/utils/version_max.py +0 -61
  64. rhiza-0.8.3/src/rhiza/__main__.py +0 -10
  65. rhiza-0.8.3/src/rhiza/commands/init.py +0 -244
  66. rhiza-0.8.3/src/rhiza/commands/materialize.py +0 -422
  67. {rhiza-0.8.3 → rhiza-0.8.5}/.editorconfig +0 -0
  68. {rhiza-0.8.3 → rhiza-0.8.5}/.github/workflows/rhiza_sync.yml +0 -0
  69. {rhiza-0.8.3/.rhiza → rhiza-0.8.5/.rhiza/docs}/CONFIG.md +0 -0
  70. {rhiza-0.8.3/.rhiza → rhiza-0.8.5/.rhiza/docs}/TOKEN_SETUP.md +0 -0
  71. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/customisations/build-extras.sh +0 -0
  72. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/customisations/post-release.sh +0 -0
  73. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/release.sh +0 -0
  74. {rhiza-0.8.3 → rhiza-0.8.5}/.rhiza/scripts/update-readme-help.sh +0 -0
  75. {rhiza-0.8.3 → rhiza-0.8.5}/CLI.md +0 -0
  76. {rhiza-0.8.3 → rhiza-0.8.5}/CODE_OF_CONDUCT.md +0 -0
  77. {rhiza-0.8.3 → rhiza-0.8.5}/CONTRIBUTING.md +0 -0
  78. {rhiza-0.8.3 → rhiza-0.8.5}/GETTING_STARTED.md +0 -0
  79. {rhiza-0.8.3 → rhiza-0.8.5}/LICENSE +0 -0
  80. {rhiza-0.8.3 → rhiza-0.8.5}/USAGE.md +0 -0
  81. {rhiza-0.8.3 → rhiza-0.8.5}/book/marimo/.gitkeep +0 -0
  82. {rhiza-0.8.3 → rhiza-0.8.5}/book/marimo/README.md +0 -0
  83. {rhiza-0.8.3 → rhiza-0.8.5}/book/marimo/rhiza.py +0 -0
  84. {rhiza-0.8.3 → rhiza-0.8.5}/book/minibook-templates/custom.html.jinja2 +0 -0
  85. {rhiza-0.8.3 → rhiza-0.8.5}/book/pdoc-templates/module.html.jinja2 +0 -0
  86. {rhiza-0.8.3 → rhiza-0.8.5}/presentation/Makefile.presentation +0 -0
  87. {rhiza-0.8.3 → rhiza-0.8.5}/presentation/README.md +0 -0
  88. {rhiza-0.8.3 → rhiza-0.8.5}/pytest.ini +0 -0
  89. {rhiza-0.8.3 → rhiza-0.8.5}/renovate.json +0 -0
  90. {rhiza-0.8.3 → rhiza-0.8.5}/ruff.toml +0 -0
  91. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/__init__.py +0 -0
  92. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/_templates/basic/__init__.py.jinja2 +0 -0
  93. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/_templates/basic/main.py.jinja2 +0 -0
  94. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/_templates/basic/pyproject.toml.jinja2 +0 -0
  95. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/cli.py +0 -0
  96. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/commands/__init__.py +0 -0
  97. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/commands/welcome.py +0 -0
  98. {rhiza-0.8.3 → rhiza-0.8.5}/src/rhiza/models.py +0 -0
  99. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_commands/test_uninstall.py +0 -0
  100. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_commands/test_validate.py +0 -0
  101. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_models.py +0 -0
  102. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_package.py +0 -0
  103. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/README.md +0 -0
  104. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/benchmarks/.gitignore +0 -0
  105. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/benchmarks/README.md +0 -0
  106. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/benchmarks/analyze_benchmarks.py +0 -0
  107. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_docstrings.py +0 -0
  108. {rhiza-0.8.3 → rhiza-0.8.5}/tests/test_rhiza/test_readme.py +0 -0
@@ -0,0 +1 @@
1
+ - [ ] Assign implementation to GitHub Copilot
@@ -40,18 +40,20 @@ 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
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v7
45
+ with:
46
+ version: "0.9.21"
47
+
48
+ - name: "Sync the virtual environment for ${{ github.repository }}"
49
+ shell: bash
46
50
  run: |
47
- echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
51
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
52
+ # will just use .python-version?
53
+ uv sync --all-extras --all-groups --frozen
48
54
 
49
- # Use the composite action to set up the project
50
- - name: Setup the project
51
- uses: ./.github/rhiza/actions/setup-project
52
- with:
53
- python-version: ${{ steps.get-python.outputs.python-version }}
54
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
55
+ - name: Install dev dependencies
56
+ run: bash .rhiza/scripts/install-dev-deps.sh
55
57
 
56
58
  - name: "Make the book"
57
59
  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:
@@ -25,10 +26,15 @@ jobs:
25
26
  steps:
26
27
  - uses: actions/checkout@v6
27
28
 
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@v7
31
+ with:
32
+ version: "0.9.21"
33
+
28
34
  - id: versions
29
35
  run: |
30
36
  # Generate Python versions JSON from the script
31
- JSON=$(python ./.rhiza/utils/version_matrix.py)
37
+ JSON=$(make -s version-matrix)
32
38
  echo "list=$JSON" >> "$GITHUB_OUTPUT"
33
39
 
34
40
  - name: Debug matrix
@@ -49,18 +55,20 @@ jobs:
49
55
  with:
50
56
  lfs: true
51
57
 
52
- - name: Setup the project
53
- uses: ./.github/rhiza/actions/setup-project
58
+ - name: Install uv
59
+ uses: astral-sh/setup-uv@v7
54
60
  with:
55
- python-version: ${{ matrix.python-version }}
56
- uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
61
+ version: "0.9.21"
57
62
 
58
- - name: Install dependencies
63
+ - name: "Sync the virtual environment for ${{ github.repository }}"
64
+ shell: bash
59
65
  run: |
60
- if [ -f "tests/requirements.txt" ]; then
61
- uv pip install -r tests/requirements.txt
62
- fi
63
- uv pip install pytest
66
+ export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
67
+ uv venv --python ${{ matrix.python-version }}
68
+ uv sync --all-extras --all-groups --frozen
69
+
70
+ - name: Install dev dependencies
71
+ run: bash .rhiza/scripts/install-dev-deps.sh
64
72
 
65
73
  - name: Run tests
66
74
  run: uv run pytest tests
@@ -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,17 +27,14 @@ 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
33
34
 
34
35
  - name: Run deptry
35
- run: |
36
- set -euo pipefail
37
- if [ -d "src" ]; then
38
- SOURCE_FOLDER="src"
39
- else
40
- SOURCE_FOLDER="."
41
- fi
42
- uvx deptry "$SOURCE_FOLDER"
36
+ run: make deptry
37
+ # NOTE: make deptry is good style because it encapsulates the folders to check
38
+ # (e.g. src and book/marimo) and keeps CI in sync with local development.
39
+ # Since we use a 'uv' container, the Makefile is optimized to use the
40
+ # pre-installed 'uv' and 'uvx' from the system PATH.
@@ -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 --all-groups --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 --all-groups --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
@@ -0,0 +1,31 @@
1
+ [tool.bumpversion]
2
+ parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[a-z]+)\\.(?P<pre_n>\\d+))?(?:\\+build\\.(?P<build_n>\\d+))?"
3
+ serialize = ["{major}.{minor}.{patch}-{release}.{pre_n}+build.{build_n}", "{major}.{minor}.{patch}+build.{build_n}", "{major}.{minor}.{patch}-{release}.{pre_n}", "{major}.{minor}.{patch}"]
4
+ search = "{current_version}"
5
+ replace = "{new_version}"
6
+ regex = false
7
+ ignore_missing_version = false
8
+ ignore_missing_files = false
9
+ tag = false
10
+ sign_tags = false
11
+ tag_name = "v{new_version}"
12
+ tag_message = "Bump version: {current_version} → {new_version}"
13
+ allow_dirty = false
14
+ commit = false
15
+ message = "Chore: bump version {current_version} → {new_version}"
16
+ commit_args = ""
17
+
18
+ [tool.bumpversion.parts.release]
19
+ optional_value = "prod"
20
+ values = [
21
+ "dev",
22
+ "alpha",
23
+ "beta",
24
+ "rc",
25
+ "prod"
26
+ ]
27
+
28
+ [[tool.bumpversion.files]]
29
+ filename = "pyproject.toml"
30
+ search = 'version = "{current_version}"'
31
+ replace = 'version = "{new_version}"'
@@ -5,13 +5,10 @@
5
5
  #
6
6
  # Files under template control:
7
7
  .editorconfig
8
- .github/dependabot.yml
9
- .github/rhiza/actions/setup-project/action.yml
10
8
  .github/workflows/rhiza_book.yml
11
9
  .github/workflows/rhiza_ci.yml
10
+ .github/workflows/rhiza_codeql.yml
12
11
  .github/workflows/rhiza_deptry.yml
13
- .github/workflows/rhiza_devcontainer.yml
14
- .github/workflows/rhiza_docker.yml
15
12
  .github/workflows/rhiza_marimo.yml
16
13
  .github/workflows/rhiza_pre-commit.yml
17
14
  .github/workflows/rhiza_release.yml
@@ -19,21 +16,28 @@
19
16
  .github/workflows/rhiza_validate.yml
20
17
  .gitignore
21
18
  .pre-commit-config.yaml
22
- .rhiza/CONFIG.md
23
- .rhiza/TOKEN_SETUP.md
19
+ .rhiza/docs/CONFIG.md
20
+ .rhiza/docs/TOKEN_SETUP.md
21
+ .rhiza/requirements/README.md
22
+ .rhiza/requirements/docs.txt
23
+ .rhiza/requirements/marimo.txt
24
+ .rhiza/requirements/tests.txt
25
+ .rhiza/requirements/tools.txt
24
26
  .rhiza/scripts/book.sh
25
27
  .rhiza/scripts/bump.sh
26
28
  .rhiza/scripts/customisations/build-extras.sh
27
29
  .rhiza/scripts/customisations/post-release.sh
30
+ .rhiza/scripts/generate-coverage-badge.sh
31
+ .rhiza/scripts/install-dev-deps.sh
28
32
  .rhiza/scripts/marimushka.sh
29
33
  .rhiza/scripts/release.sh
30
34
  .rhiza/scripts/update-readme-help.sh
31
35
  .rhiza/utils/version_matrix.py
32
- .rhiza/utils/version_max.py
33
36
  CODE_OF_CONDUCT.md
34
37
  CONTRIBUTING.md
35
38
  Makefile
36
39
  book/Makefile.book
40
+ book/README.md
37
41
  book/marimo/README.md
38
42
  book/marimo/rhiza.py
39
43
  book/minibook-templates/custom.html.jinja2
@@ -50,11 +54,14 @@ tests/test_rhiza/benchmarks/README.md
50
54
  tests/test_rhiza/benchmarks/analyze_benchmarks.py
51
55
  tests/test_rhiza/conftest.py
52
56
  tests/test_rhiza/test_bump_script.py
57
+ tests/test_rhiza/test_coverage_badge.py
53
58
  tests/test_rhiza/test_docstrings.py
54
59
  tests/test_rhiza/test_git_repo_fixture.py
55
60
  tests/test_rhiza/test_makefile.py
56
61
  tests/test_rhiza/test_marimushka_script.py
62
+ tests/test_rhiza/test_notebooks.py
57
63
  tests/test_rhiza/test_readme.py
58
64
  tests/test_rhiza/test_release_script.py
65
+ tests/test_rhiza/test_requirements_folder.py
59
66
  tests/test_rhiza/test_structure.py
60
67
  tests/test_rhiza/test_updatereadme_script.py
@@ -0,0 +1,27 @@
1
+ # Requirements Folder
2
+
3
+ This folder contains the development dependencies for the Rhiza project, organized by purpose.
4
+
5
+ ## Files
6
+
7
+ - **tests.txt** - Testing dependencies (pytest, pytest-cov, pytest-html)
8
+ - **marimo.txt** - Marimo notebook dependencies
9
+ - **docs.txt** - Documentation generation dependencies (pdoc)
10
+ - **tools.txt** - Development tools (pre-commit, python-dotenv)
11
+
12
+ ## Usage
13
+
14
+ These requirements files are automatically installed by the `make install` command.
15
+
16
+ To install specific requirement files manually:
17
+
18
+ ```bash
19
+ uv pip install -r .rhiza/requirements/tests.txt
20
+ uv pip install -r .rhiza/requirements/marimo.txt
21
+ uv pip install -r .rhiza/requirements/docs.txt
22
+ uv pip install -r .rhiza/requirements/tools.txt
23
+ ```
24
+
25
+ ## CI/CD
26
+
27
+ GitHub Actions workflows automatically install these requirements as needed.
@@ -0,0 +1,2 @@
1
+ # Documentation dependencies for rhiza
2
+ pdoc>=16.0.0
@@ -0,0 +1,2 @@
1
+ # Marimo dependencies for rhiza
2
+ marimo>=0.18.0
@@ -0,0 +1,4 @@
1
+ # Test dependencies for rhiza
2
+ pytest==9.0.2
3
+ pytest-cov>=7.0.0
4
+ pytest-html>=4.1.1
@@ -0,0 +1,3 @@
1
+ # Development tool dependencies for rhiza
2
+ pre-commit==4.5.1
3
+ python-dotenv==1.2.1
@@ -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"