rhiza 0.7.0__tar.gz → 0.8.0__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.
- {rhiza-0.7.0/.github → rhiza-0.8.0/.github/rhiza}/actions/setup-project/action.yml +2 -25
- rhiza-0.7.0/.github/workflows/book.yml → rhiza-0.8.0/.github/workflows/rhiza_book.yml +2 -2
- rhiza-0.7.0/.github/workflows/ci.yml → rhiza-0.8.0/.github/workflows/rhiza_ci.yml +2 -2
- rhiza-0.7.0/.github/workflows/deptry.yml → rhiza-0.8.0/.github/workflows/rhiza_deptry.yml +4 -8
- rhiza-0.8.0/.github/workflows/rhiza_devcontainer.yml +137 -0
- rhiza-0.8.0/.github/workflows/rhiza_docker.yml +63 -0
- rhiza-0.7.0/.github/workflows/pre-commit.yml → rhiza-0.8.0/.github/workflows/rhiza_pre-commit.yml +2 -2
- rhiza-0.7.0/.github/workflows/release.yml → rhiza-0.8.0/.github/workflows/rhiza_release.yml +2 -2
- rhiza-0.7.0/.github/workflows/sync.yml → rhiza-0.8.0/.github/workflows/rhiza_sync.yml +2 -2
- rhiza-0.7.0/.github/workflows/rhiza.yml → rhiza-0.8.0/.github/workflows/rhiza_validate.yml +5 -5
- {rhiza-0.7.0 → rhiza-0.8.0}/.gitignore +3 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/.pre-commit-config.yaml +1 -1
- rhiza-0.8.0/.rhiza/CONFIG.md +41 -0
- {rhiza-0.7.0/.github/rhiza → rhiza-0.8.0/.rhiza}/TOKEN_SETUP.md +1 -1
- rhiza-0.7.0/.rhiza.history → rhiza-0.8.0/.rhiza/history +25 -22
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/customisations/build-extras.sh +2 -2
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/customisations/post-release.sh +2 -2
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/update-readme-help.sh +1 -1
- {rhiza-0.7.0/.github/rhiza → rhiza-0.8.0/.rhiza}/template.yml +2 -0
- {rhiza-0.7.0/.github/workflows/scripts → rhiza-0.8.0/.rhiza/utils}/version_matrix.py +1 -1
- {rhiza-0.7.0/.github/workflows/scripts → rhiza-0.8.0/.rhiza/utils}/version_max.py +1 -1
- {rhiza-0.7.0 → rhiza-0.8.0}/CLI.md +33 -0
- rhiza-0.8.0/GETTING_STARTED.md +67 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/Makefile +15 -7
- {rhiza-0.7.0 → rhiza-0.8.0}/PKG-INFO +83 -1
- {rhiza-0.7.0 → rhiza-0.8.0}/README.md +81 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/presentation/README.md +1 -1
- {rhiza-0.7.0 → rhiza-0.8.0}/pyproject.toml +3 -2
- rhiza-0.8.0/src/rhiza/_templates/basic/__init__.py.jinja2 +2 -0
- rhiza-0.8.0/src/rhiza/_templates/basic/main.py.jinja2 +23 -0
- rhiza-0.8.0/src/rhiza/_templates/basic/pyproject.toml.jinja2 +32 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/cli.py +98 -10
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/commands/init.py +73 -43
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/commands/materialize.py +51 -10
- rhiza-0.8.0/src/rhiza/commands/migrate.py +128 -0
- rhiza-0.8.0/src/rhiza/commands/uninstall.py +151 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/commands/validate.py +46 -22
- rhiza-0.8.0/tests/test_commands/test_init.py +234 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_commands/test_materialize.py +137 -68
- rhiza-0.8.0/tests/test_commands/test_migrate.py +220 -0
- rhiza-0.8.0/tests/test_commands/test_uninstall.py +607 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_commands/test_validate.py +211 -25
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/README.md +2 -1
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/conftest.py +5 -5
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_bump_script.py +8 -8
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_git_repo_fixture.py +3 -3
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_makefile.py +4 -4
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_marimushka_script.py +3 -3
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_release_script.py +6 -6
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_structure.py +2 -2
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_updatereadme_script.py +3 -3
- {rhiza-0.7.0 → rhiza-0.8.0}/uv.lock +3 -1
- rhiza-0.7.0/.github/rhiza/CONFIG.md +0 -33
- rhiza-0.7.0/.github/rhiza/copilot-instructions.md +0 -349
- rhiza-0.7.0/.github/workflows/security.yml +0 -23
- rhiza-0.7.0/.github/workflows/structure.yml +0 -73
- rhiza-0.7.0/GETTING_STARTED.md +0 -492
- rhiza-0.7.0/tests/test_commands/test_init.py +0 -137
- {rhiza-0.7.0 → rhiza-0.8.0}/.editorconfig +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/.github/dependabot.yml +0 -0
- /rhiza-0.7.0/.github/workflows/marimo.yml → /rhiza-0.8.0/.github/workflows/rhiza_marimo.yml +0 -0
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/book.sh +0 -0
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/bump.sh +0 -0
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/marimushka.sh +0 -0
- {rhiza-0.7.0/.github → rhiza-0.8.0/.rhiza}/scripts/release.sh +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/CODE_OF_CONDUCT.md +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/CONTRIBUTING.md +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/LICENSE +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/USAGE.md +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/Makefile.book +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/marimo/.gitkeep +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/marimo/README.md +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/marimo/rhiza.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/minibook-templates/custom.html.jinja2 +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/book/pdoc-templates/module.html.jinja2 +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/presentation/Makefile.presentation +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/pytest.ini +0 -0
- {rhiza-0.7.0/.github → rhiza-0.8.0}/renovate.json +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/ruff.toml +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/__init__.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/__main__.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/commands/__init__.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/commands/welcome.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/src/rhiza/models.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/Makefile.tests +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_cli_commands.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_models.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_package.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/benchmarks/.gitignore +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/benchmarks/README.md +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/benchmarks/analyze_benchmarks.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_docstrings.py +0 -0
- {rhiza-0.7.0 → rhiza-0.8.0}/tests/test_rhiza/test_readme.py +0 -0
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
# Can be overridden by setting PYTHON_DEFAULT_VERSION repository variable
|
|
14
14
|
# - uv-extra-index-url: Extra index URL for uv (optional)
|
|
15
15
|
#
|
|
16
|
-
# Outputs:
|
|
17
|
-
# - pyproject_exists: "true" if pyproject.toml exists, otherwise "false"
|
|
18
|
-
#
|
|
19
16
|
# Notes:
|
|
20
|
-
# - Safe to run in repositories without pyproject.toml; dependency sync will be skipped.
|
|
21
17
|
# - Used by workflows such as CI, Book, Marimo, and Release.
|
|
22
18
|
|
|
23
19
|
name: 'Setup Project'
|
|
@@ -31,11 +27,6 @@ inputs:
|
|
|
31
27
|
description: 'Extra index URL for uv'
|
|
32
28
|
required: false
|
|
33
29
|
|
|
34
|
-
outputs:
|
|
35
|
-
pyproject_exists:
|
|
36
|
-
description: 'Flag indicating whether pyproject.toml exists'
|
|
37
|
-
value: ${{ steps.check_pyproject.outputs.exists }}
|
|
38
|
-
|
|
39
30
|
runs:
|
|
40
31
|
using: 'composite'
|
|
41
32
|
steps:
|
|
@@ -44,29 +35,15 @@ runs:
|
|
|
44
35
|
with:
|
|
45
36
|
version: "0.9.18"
|
|
46
37
|
|
|
47
|
-
- name: Check for pyproject.toml
|
|
48
|
-
id: check_pyproject
|
|
49
|
-
shell: bash
|
|
50
|
-
run: |
|
|
51
|
-
if [ -f "pyproject.toml" ]; then
|
|
52
|
-
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
53
|
-
else
|
|
54
|
-
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
38
|
- name: Build the virtual environment
|
|
58
39
|
shell: bash
|
|
59
40
|
run: uv venv --python ${{ inputs.python-version }}
|
|
60
41
|
|
|
61
|
-
- name: "Sync the virtual environment for ${{ github.repository }}
|
|
42
|
+
- name: "Sync the virtual environment for ${{ github.repository }}"
|
|
62
43
|
shell: bash
|
|
63
44
|
run: |
|
|
64
45
|
if [[ -n "${{ inputs.uv-extra-index-url }}" ]]; then
|
|
65
46
|
export UV_EXTRA_INDEX_URL="${{ inputs.uv-extra-index-url }}"
|
|
66
47
|
fi
|
|
67
48
|
|
|
68
|
-
|
|
69
|
-
uv sync --all-extras
|
|
70
|
-
else
|
|
71
|
-
echo "No pyproject.toml found, skipping package installation"
|
|
72
|
-
fi
|
|
49
|
+
uv sync --all-extras --frozen
|
|
@@ -44,11 +44,11 @@ jobs:
|
|
|
44
44
|
- name: Get Python version
|
|
45
45
|
id: get-python
|
|
46
46
|
run: |
|
|
47
|
-
echo "python-version=$(python ./.
|
|
47
|
+
echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
|
|
48
48
|
|
|
49
49
|
# Use the composite action to set up the project
|
|
50
50
|
- name: Setup the project
|
|
51
|
-
uses: ./.github/actions/setup-project
|
|
51
|
+
uses: ./.github/rhiza/actions/setup-project
|
|
52
52
|
with:
|
|
53
53
|
python-version: ${{ steps.get-python.outputs.python-version }}
|
|
54
54
|
uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
- id: versions
|
|
29
29
|
run: |
|
|
30
30
|
# Generate Python versions JSON from the script
|
|
31
|
-
JSON=$(python ./.
|
|
31
|
+
JSON=$(python ./.rhiza/utils/version_matrix.py)
|
|
32
32
|
echo "list=$JSON" >> "$GITHUB_OUTPUT"
|
|
33
33
|
|
|
34
34
|
- name: Debug matrix
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
lfs: true
|
|
51
51
|
|
|
52
52
|
- name: Setup the project
|
|
53
|
-
uses: ./.github/actions/setup-project
|
|
53
|
+
uses: ./.github/rhiza/actions/setup-project
|
|
54
54
|
with:
|
|
55
55
|
python-version: ${{ matrix.python-version }}
|
|
56
56
|
uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
|
|
@@ -34,13 +34,9 @@ jobs:
|
|
|
34
34
|
- name: Run deptry
|
|
35
35
|
run: |
|
|
36
36
|
set -euo pipefail
|
|
37
|
-
if [ -
|
|
38
|
-
|
|
39
|
-
SOURCE_FOLDER="src"
|
|
40
|
-
else
|
|
41
|
-
SOURCE_FOLDER="."
|
|
42
|
-
fi
|
|
43
|
-
uvx deptry "$SOURCE_FOLDER"
|
|
37
|
+
if [ -d "src" ]; then
|
|
38
|
+
SOURCE_FOLDER="src"
|
|
44
39
|
else
|
|
45
|
-
|
|
40
|
+
SOURCE_FOLDER="."
|
|
46
41
|
fi
|
|
42
|
+
uvx deptry "$SOURCE_FOLDER"
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# This file is part of the jebel-quant/rhiza repository
|
|
2
|
+
# (https://github.com/jebel-quant/rhiza).
|
|
3
|
+
#
|
|
4
|
+
# Devcontainer CI Workflow
|
|
5
|
+
#
|
|
6
|
+
# Purpose:
|
|
7
|
+
# Validates that the devcontainer image builds successfully when devcontainer-related
|
|
8
|
+
# files are changed. This workflow does NOT publish/push the image to any registry.
|
|
9
|
+
#
|
|
10
|
+
# Trigger Conditions:
|
|
11
|
+
# - Push to any branch when files in .devcontainer/ change
|
|
12
|
+
# - Pull requests to main/master when files in .devcontainer/ change
|
|
13
|
+
# - Changes to this workflow file itself
|
|
14
|
+
#
|
|
15
|
+
# Image Configuration:
|
|
16
|
+
# - Registry: Defaults to ghcr.io (override with DEVCONTAINER_REGISTRY variable)
|
|
17
|
+
# - Image name: {registry}/{owner}/{repository}/devcontainer
|
|
18
|
+
# - Image tag: {branch}-{commit-sha} (e.g., main-abc123def456)
|
|
19
|
+
# - Config file: Always .devcontainer/devcontainer.json
|
|
20
|
+
#
|
|
21
|
+
# Safeguards:
|
|
22
|
+
# - Checks if .devcontainer/devcontainer.json exists before building
|
|
23
|
+
# - Skips gracefully with a warning if devcontainer.json is not found
|
|
24
|
+
# - Converts repository owner to lowercase for Docker compatibility
|
|
25
|
+
#
|
|
26
|
+
# Publishing:
|
|
27
|
+
# Publishing only happens during releases via rhiza_release.yml when the
|
|
28
|
+
# PUBLISH_DEVCONTAINER repository variable is set to "true".
|
|
29
|
+
#
|
|
30
|
+
# For repos without devcontainers:
|
|
31
|
+
# This workflow won't trigger unless .devcontainer/ files exist and are modified,
|
|
32
|
+
# or this workflow file itself is changed (in which case it skips gracefully).
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
name: DEVCONTAINER
|
|
36
|
+
|
|
37
|
+
on:
|
|
38
|
+
push:
|
|
39
|
+
branches:
|
|
40
|
+
- '**'
|
|
41
|
+
paths:
|
|
42
|
+
- ".devcontainer/**"
|
|
43
|
+
- ".github/workflows/rhiza_devcontainer.yml"
|
|
44
|
+
|
|
45
|
+
pull_request:
|
|
46
|
+
branches: [ main, master ]
|
|
47
|
+
paths:
|
|
48
|
+
- ".devcontainer/**"
|
|
49
|
+
- ".github/workflows/rhiza_devcontainer.yml"
|
|
50
|
+
|
|
51
|
+
permissions:
|
|
52
|
+
contents: read
|
|
53
|
+
packages: write
|
|
54
|
+
|
|
55
|
+
jobs:
|
|
56
|
+
build:
|
|
57
|
+
name: Build Devcontainer Image
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout repository
|
|
61
|
+
uses: actions/checkout@v6
|
|
62
|
+
|
|
63
|
+
- name: Set registry
|
|
64
|
+
id: registry
|
|
65
|
+
run: |
|
|
66
|
+
REGISTRY="${{ vars.DEVCONTAINER_REGISTRY }}"
|
|
67
|
+
if [ -z "$REGISTRY" ]; then
|
|
68
|
+
REGISTRY="ghcr.io"
|
|
69
|
+
fi
|
|
70
|
+
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
|
|
71
|
+
|
|
72
|
+
- name: Login to Container Registry
|
|
73
|
+
uses: docker/login-action@v3
|
|
74
|
+
with:
|
|
75
|
+
registry: ${{ steps.registry.outputs.registry }}
|
|
76
|
+
username: ${{ github.repository_owner }}
|
|
77
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
78
|
+
|
|
79
|
+
# Additional gate to skip build if no devcontainer.json exists
|
|
80
|
+
- name: Check devcontainer exists
|
|
81
|
+
id: check
|
|
82
|
+
run: |
|
|
83
|
+
if [ ! -f ".devcontainer/devcontainer.json" ]; then
|
|
84
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
85
|
+
echo "::warning::No .devcontainer/devcontainer.json found, skipping build"
|
|
86
|
+
else
|
|
87
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
88
|
+
fi
|
|
89
|
+
# repository owner to lowercase for Docker image naming, as devcontainers/ci does not safeguard
|
|
90
|
+
- name: Get lowercase repository owner
|
|
91
|
+
id: repo_owner
|
|
92
|
+
run: echo "owner_lc=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
|
93
|
+
|
|
94
|
+
- name: Get Image Name
|
|
95
|
+
if: steps.check.outputs.exists == 'true'
|
|
96
|
+
id: image_name
|
|
97
|
+
run: |
|
|
98
|
+
# Check if custom name is provided, otherwise use default
|
|
99
|
+
if [ -z "${{ vars.DEVCONTAINER_IMAGE_NAME }}" ]; then
|
|
100
|
+
REPO_NAME_LC=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
|
|
101
|
+
# Sanitize repo name: replace invalid characters with hyphens
|
|
102
|
+
# Docker image names must match [a-z0-9]+([._-][a-z0-9]+)*
|
|
103
|
+
# Replace leading dots and multiple consecutive separators
|
|
104
|
+
REPO_NAME_SANITIZED=$(echo "$REPO_NAME_LC" | sed 's/^[._-]*//; s/[._-][._-]*/-/g')
|
|
105
|
+
IMAGE_NAME="$REPO_NAME_SANITIZED/devcontainer"
|
|
106
|
+
echo "Using default image name component: $IMAGE_NAME"
|
|
107
|
+
else
|
|
108
|
+
IMAGE_NAME="${{ vars.DEVCONTAINER_IMAGE_NAME }}"
|
|
109
|
+
echo "Using custom image name component: $IMAGE_NAME"
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
# Validate the image component matches [a-z0-9]+([._-][a-z0-9]+)* with optional / separators
|
|
113
|
+
if ! echo "$IMAGE_NAME" | grep -qE '^[a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)*$'; then
|
|
114
|
+
echo "::error::Invalid image name component: $IMAGE_NAME"
|
|
115
|
+
echo "::error::Each component must match [a-z0-9]+([._-][a-z0-9]+)* separated by /"
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
IMAGE_NAME="${{ steps.registry.outputs.registry }}/${{ steps.repo_owner.outputs.owner_lc }}/$IMAGE_NAME"
|
|
120
|
+
echo "✅ Final image name: $IMAGE_NAME"
|
|
121
|
+
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT
|
|
122
|
+
|
|
123
|
+
- name: Sanitize Image Tag
|
|
124
|
+
if: steps.check.outputs.exists == 'true'
|
|
125
|
+
id: sanitized_tag
|
|
126
|
+
run: |
|
|
127
|
+
SANITIZED_TAG=$(echo "${{ github.ref_name }}-${{ github.sha }}" | tr '/' '-')
|
|
128
|
+
echo "sanitized_tag=$SANITIZED_TAG" >> $GITHUB_OUTPUT
|
|
129
|
+
|
|
130
|
+
- name: Build Devcontainer Image
|
|
131
|
+
uses: devcontainers/ci@v0.3
|
|
132
|
+
if: steps.check.outputs.exists == 'true'
|
|
133
|
+
with:
|
|
134
|
+
configFile: .devcontainer/devcontainer.json
|
|
135
|
+
push: never
|
|
136
|
+
imageName: ${{ steps.image_name.outputs.image_name }}
|
|
137
|
+
imageTag: ${{ steps.sanitized_tag.outputs.sanitized_tag }}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# GitHub Actions workflow: Lint Dockerfile with hadolint and build the image
|
|
2
|
+
#
|
|
3
|
+
# This workflow runs on pushes and pull requests. It performs two main tasks:
|
|
4
|
+
# - Lints docker/Dockerfile using hadolint (fails the job on lint errors)
|
|
5
|
+
# - Builds the container image with Docker Buildx to ensure the Dockerfile is valid
|
|
6
|
+
#
|
|
7
|
+
# Notes:
|
|
8
|
+
# - The image is built locally for validation only; it is not pushed to any registry.
|
|
9
|
+
# - Permissions are minimized (read-only) since no repository writes occur.
|
|
10
|
+
name: DOCKER
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
pull_request:
|
|
18
|
+
branches: [ main, master ]
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
lint_and_build:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout repository
|
|
26
|
+
uses: actions/checkout@v6
|
|
27
|
+
|
|
28
|
+
- name: Detect docker/Dockerfile presence
|
|
29
|
+
id: check_dockerfile
|
|
30
|
+
run: |
|
|
31
|
+
if [ -f docker/Dockerfile ]; then
|
|
32
|
+
echo "docker_present=true" >> "$GITHUB_OUTPUT"
|
|
33
|
+
else
|
|
34
|
+
echo "docker_present=false" >> "$GITHUB_OUTPUT"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
- name: Skip notice (no docker/Dockerfile present)
|
|
38
|
+
if: ${{ steps.check_dockerfile.outputs.docker_present != 'true' }}
|
|
39
|
+
run: echo "No docker/Dockerfile found; skipping hadolint and image build."
|
|
40
|
+
|
|
41
|
+
- name: Lint Dockerfile with hadolint
|
|
42
|
+
if: ${{ steps.check_dockerfile.outputs.docker_present == 'true' }}
|
|
43
|
+
uses: hadolint/hadolint-action@v3.3.0
|
|
44
|
+
with:
|
|
45
|
+
dockerfile: docker/Dockerfile
|
|
46
|
+
# Fail on any error-level findings (default behavior). Adjust if needed:
|
|
47
|
+
# failure-threshold: error
|
|
48
|
+
|
|
49
|
+
- name: Set up Docker Buildx
|
|
50
|
+
if: ${{ steps.check_dockerfile.outputs.docker_present == 'true' }}
|
|
51
|
+
uses: docker/setup-buildx-action@v3
|
|
52
|
+
|
|
53
|
+
- name: Build container image with Docker Buildx (validation only)
|
|
54
|
+
if: ${{ steps.check_dockerfile.outputs.docker_present == 'true' }}
|
|
55
|
+
run: |
|
|
56
|
+
# Derive image tag from repository name and sanitize (remove '.' and '_')
|
|
57
|
+
REPO_NAME="${GITHUB_REPOSITORY##*/}"
|
|
58
|
+
REPO_NAME="${REPO_NAME//[._]/}"
|
|
59
|
+
docker buildx build \
|
|
60
|
+
--file docker/Dockerfile \
|
|
61
|
+
--tag "${REPO_NAME}:ci" \
|
|
62
|
+
--load \
|
|
63
|
+
.
|
rhiza-0.7.0/.github/workflows/pre-commit.yml → rhiza-0.8.0/.github/workflows/rhiza_pre-commit.yml
RENAMED
|
@@ -33,9 +33,9 @@ jobs:
|
|
|
33
33
|
- name: Get Python version
|
|
34
34
|
id: get-python
|
|
35
35
|
run: |
|
|
36
|
-
echo "python-version=$(python ./.
|
|
36
|
+
echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
|
|
37
37
|
|
|
38
|
-
- uses: ./.github/actions/setup-project
|
|
38
|
+
- uses: ./.github/rhiza/actions/setup-project
|
|
39
39
|
with:
|
|
40
40
|
python-version: ${{ steps.get-python.outputs.python-version }}
|
|
41
41
|
uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
|
|
@@ -111,7 +111,7 @@ jobs:
|
|
|
111
111
|
|
|
112
112
|
# Use the composite action to set up the project
|
|
113
113
|
- name: Setup the project
|
|
114
|
-
uses: ./.github/actions/setup-project
|
|
114
|
+
uses: ./.github/rhiza/actions/setup-project
|
|
115
115
|
with:
|
|
116
116
|
python-version: ${{ vars.PYTHON_DEFAULT_VERSION || '3.14' }}
|
|
117
117
|
uv-extra-index-url: ${{ secrets.UV_EXTRA_INDEX_URL }}
|
|
@@ -321,7 +321,7 @@ jobs:
|
|
|
321
321
|
- name: Get Python version
|
|
322
322
|
id: get-python
|
|
323
323
|
run: |
|
|
324
|
-
echo "python-version=$(python ./.
|
|
324
|
+
echo "python-version=$(python ./.rhiza/utils/version_max.py)" >> "$GITHUB_OUTPUT"
|
|
325
325
|
|
|
326
326
|
- name: Set up Python
|
|
327
327
|
uses: actions/setup-python@v6
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
name: RHIZA SYNC
|
|
2
2
|
# This workflow synchronizes the repository with its template.
|
|
3
|
-
# IMPORTANT: When workflow files (.github/workflows
|
|
3
|
+
# IMPORTANT: When workflow files (.github/workflows/rhiza_*.yml) are modified,
|
|
4
4
|
# a Personal Access Token (PAT) with 'workflow' scope is required.
|
|
5
5
|
# The PAT_TOKEN secret must be set in repository secrets.
|
|
6
|
-
# See .github/TOKEN_SETUP.md for setup instructions.
|
|
6
|
+
# See .github/rhiza/TOKEN_SETUP.md for setup instructions.
|
|
7
7
|
|
|
8
8
|
permissions:
|
|
9
9
|
contents: write
|
|
@@ -11,7 +11,7 @@ on:
|
|
|
11
11
|
jobs:
|
|
12
12
|
validation:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
|
-
# don't run this in rhiza itself. Rhiza has no template.yml file.
|
|
14
|
+
# don't run this in rhiza itself. Rhiza has no template.yml file.
|
|
15
15
|
if: ${{ github.repository != 'jebel-quant/rhiza' }}
|
|
16
16
|
container:
|
|
17
17
|
image: ghcr.io/astral-sh/uv:0.9.18-python3.12-trixie
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
- name: Checkout repository
|
|
21
21
|
uses: actions/checkout@v6
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
#- name: Validate Rhiza config
|
|
24
|
+
# shell: bash
|
|
25
|
+
# run: |
|
|
26
|
+
# uvx rhiza validate .
|
|
@@ -47,7 +47,7 @@ repos:
|
|
|
47
47
|
hooks:
|
|
48
48
|
- id: update-readme-help
|
|
49
49
|
name: Update README with Makefile help output
|
|
50
|
-
entry: /bin/sh .
|
|
50
|
+
entry: /bin/sh .rhiza/scripts/update-readme-help.sh
|
|
51
51
|
language: system
|
|
52
52
|
files: '^Makefile$'
|
|
53
53
|
pass_filenames: false
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Rhiza Configuration
|
|
2
|
+
|
|
3
|
+
This directory contains platform-agnostic scripts and utilities for the repository that can be used by GitHub Actions, GitLab CI, or other CI/CD systems.
|
|
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
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
- **scripts/** - Shell scripts for common tasks (book generation, release, etc.)
|
|
12
|
+
- **scripts/customisations/** - Repository-specific customization hooks
|
|
13
|
+
- **utils/** - Python utilities for version management
|
|
14
|
+
|
|
15
|
+
GitHub-specific composite actions are located in `.github/rhiza/actions/`.
|
|
16
|
+
|
|
17
|
+
## Workflows
|
|
18
|
+
|
|
19
|
+
The repository uses several automated workflows (located in `.github/workflows/`):
|
|
20
|
+
|
|
21
|
+
- **SYNC** (`rhiza_sync.yml`) - Synchronizes with the template repository
|
|
22
|
+
- **Requires:** `PAT_TOKEN` secret with `workflow` scope when modifying workflow files
|
|
23
|
+
- See [TOKEN_SETUP.md](TOKEN_SETUP.md) for configuration
|
|
24
|
+
- **CI** (`rhiza_ci.yml`) - Continuous integration tests
|
|
25
|
+
- **Pre-commit** (`rhiza_pre-commit.yml`) - Code quality checks
|
|
26
|
+
- **Book** (`rhiza_book.yml`) - Documentation deployment
|
|
27
|
+
- **Release** (`rhiza_release.yml`) - Package publishing
|
|
28
|
+
- **Deptry** (`rhiza_deptry.yml`) - Dependency checks
|
|
29
|
+
- **Marimo** (`rhiza_marimo.yml`) - Interactive notebooks
|
|
30
|
+
|
|
31
|
+
## Template Synchronization
|
|
32
|
+
|
|
33
|
+
This repository is synchronized with the template repository defined in `template.yml`.
|
|
34
|
+
|
|
35
|
+
The synchronization includes:
|
|
36
|
+
- GitHub workflows and actions
|
|
37
|
+
- Development tools configuration (`.editorconfig`, `ruff.toml`, etc.)
|
|
38
|
+
- Testing infrastructure
|
|
39
|
+
- Documentation templates
|
|
40
|
+
|
|
41
|
+
See `template.yml` for the complete list of synchronized files and exclusions.
|
|
@@ -4,7 +4,7 @@ This document explains how to set up a Personal Access Token (PAT) for the repos
|
|
|
4
4
|
|
|
5
5
|
## Why is PAT_TOKEN needed?
|
|
6
6
|
|
|
7
|
-
The repository uses the `SYNC` workflow (`.github/workflows/
|
|
7
|
+
The repository uses the `SYNC` workflow (`.github/workflows/rhiza_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
8
|
|
|
9
9
|
According to GitHub's security policy:
|
|
10
10
|
- The default `GITHUB_TOKEN` **cannot** create or update workflow files (`.github/workflows/*.yml`)
|
|
@@ -5,31 +5,31 @@
|
|
|
5
5
|
#
|
|
6
6
|
# Files under template control:
|
|
7
7
|
.editorconfig
|
|
8
|
-
.github/actions/setup-project/action.yml
|
|
9
8
|
.github/dependabot.yml
|
|
10
|
-
.github/
|
|
11
|
-
.github/
|
|
12
|
-
.github/
|
|
13
|
-
.github/
|
|
14
|
-
.github/
|
|
15
|
-
.github/
|
|
16
|
-
.github/
|
|
17
|
-
.github/
|
|
18
|
-
.github/
|
|
19
|
-
.github/
|
|
20
|
-
.github/workflows/
|
|
21
|
-
.github/workflows/ci.yml
|
|
22
|
-
.github/workflows/deptry.yml
|
|
23
|
-
.github/workflows/marimo.yml
|
|
24
|
-
.github/workflows/pre-commit.yml
|
|
25
|
-
.github/workflows/release.yml
|
|
26
|
-
.github/workflows/rhiza.yml
|
|
27
|
-
.github/workflows/scripts/version_matrix.py
|
|
28
|
-
.github/workflows/scripts/version_max.py
|
|
29
|
-
.github/workflows/security.yml
|
|
30
|
-
.github/workflows/sync.yml
|
|
9
|
+
.github/rhiza/actions/setup-project/action.yml
|
|
10
|
+
.github/workflows/rhiza_book.yml
|
|
11
|
+
.github/workflows/rhiza_ci.yml
|
|
12
|
+
.github/workflows/rhiza_deptry.yml
|
|
13
|
+
.github/workflows/rhiza_devcontainer.yml
|
|
14
|
+
.github/workflows/rhiza_docker.yml
|
|
15
|
+
.github/workflows/rhiza_marimo.yml
|
|
16
|
+
.github/workflows/rhiza_pre-commit.yml
|
|
17
|
+
.github/workflows/rhiza_release.yml
|
|
18
|
+
.github/workflows/rhiza_sync.yml
|
|
19
|
+
.github/workflows/rhiza_validate.yml
|
|
31
20
|
.gitignore
|
|
32
21
|
.pre-commit-config.yaml
|
|
22
|
+
.rhiza/CONFIG.md
|
|
23
|
+
.rhiza/TOKEN_SETUP.md
|
|
24
|
+
.rhiza/scripts/book.sh
|
|
25
|
+
.rhiza/scripts/bump.sh
|
|
26
|
+
.rhiza/scripts/customisations/build-extras.sh
|
|
27
|
+
.rhiza/scripts/customisations/post-release.sh
|
|
28
|
+
.rhiza/scripts/marimushka.sh
|
|
29
|
+
.rhiza/scripts/release.sh
|
|
30
|
+
.rhiza/scripts/update-readme-help.sh
|
|
31
|
+
.rhiza/utils/version_matrix.py
|
|
32
|
+
.rhiza/utils/version_max.py
|
|
33
33
|
CODE_OF_CONDUCT.md
|
|
34
34
|
CONTRIBUTING.md
|
|
35
35
|
Makefile
|
|
@@ -38,7 +38,10 @@ book/marimo/README.md
|
|
|
38
38
|
book/marimo/rhiza.py
|
|
39
39
|
book/minibook-templates/custom.html.jinja2
|
|
40
40
|
book/pdoc-templates/module.html.jinja2
|
|
41
|
+
presentation/Makefile.presentation
|
|
42
|
+
presentation/README.md
|
|
41
43
|
pytest.ini
|
|
44
|
+
renovate.json
|
|
42
45
|
ruff.toml
|
|
43
46
|
tests/Makefile.tests
|
|
44
47
|
tests/test_rhiza/README.md
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
#
|
|
16
16
|
# How to use:
|
|
17
17
|
# 1. Add your custom installation commands below
|
|
18
|
-
# 2. Make sure the script is executable: chmod +x .
|
|
18
|
+
# 2. Make sure the script is executable: chmod +x .rhiza/scripts/customisations/build-extras.sh
|
|
19
19
|
# 3. Commit to your repository
|
|
20
20
|
#
|
|
21
21
|
# Examples:
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
# Note: If you customize this file in your repository, add it to the exclude list
|
|
27
27
|
# in action.yml to prevent it from being overwritten by template updates:
|
|
28
28
|
# exclude: |
|
|
29
|
-
# .
|
|
29
|
+
# .rhiza/scripts/customisations/build-extras.sh
|
|
30
30
|
#
|
|
31
31
|
|
|
32
32
|
set -euo pipefail
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# How to use:
|
|
16
16
|
# 1. Add your custom post-release commands below
|
|
17
|
-
# 2. Make sure the script is executable: chmod +x .
|
|
17
|
+
# 2. Make sure the script is executable: chmod +x .rhiza/scripts/customisations/post-release.sh
|
|
18
18
|
# 3. Commit to your repository
|
|
19
19
|
#
|
|
20
20
|
# Examples:
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
# Note: If you customize this file in your repository, add it to the exclude list
|
|
27
27
|
# in template.yml to prevent it from being overwritten by template updates:
|
|
28
28
|
# exclude: |
|
|
29
|
-
# .
|
|
29
|
+
# .rhiza/scripts/customisations/post-release.sh
|
|
30
30
|
#
|
|
31
31
|
|
|
32
32
|
set -euo pipefail
|
|
@@ -2,6 +2,7 @@ template-repository: "jebel-quant/rhiza"
|
|
|
2
2
|
template-branch: "main"
|
|
3
3
|
include:
|
|
4
4
|
- .github
|
|
5
|
+
- .rhiza
|
|
5
6
|
- tests
|
|
6
7
|
- .editorconfig
|
|
7
8
|
- .gitignore
|
|
@@ -13,6 +14,7 @@ include:
|
|
|
13
14
|
- pytest.ini
|
|
14
15
|
- presentation
|
|
15
16
|
- book
|
|
17
|
+
- renovate.json
|
|
16
18
|
exclude:
|
|
17
19
|
- .github/workflows/docker.yml
|
|
18
20
|
- .github/workflows/devcontainer.yml
|
|
@@ -11,7 +11,7 @@ from pathlib import Path
|
|
|
11
11
|
from packaging.specifiers import SpecifierSet
|
|
12
12
|
from packaging.version import Version
|
|
13
13
|
|
|
14
|
-
PYPROJECT = Path(__file__).resolve().parents[
|
|
14
|
+
PYPROJECT = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
|
15
15
|
CANDIDATES = ["3.11", "3.12", "3.13", "3.14"] # extend as needed
|
|
16
16
|
|
|
17
17
|
|
|
@@ -11,7 +11,7 @@ from pathlib import Path
|
|
|
11
11
|
from packaging.specifiers import SpecifierSet
|
|
12
12
|
from packaging.version import Version
|
|
13
13
|
|
|
14
|
-
PYPROJECT = Path(__file__).resolve().parents[
|
|
14
|
+
PYPROJECT = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
|
15
15
|
CANDIDATES = ["3.11", "3.12", "3.13", "3.14"] # extend as needed
|
|
16
16
|
|
|
17
17
|
|
|
@@ -8,6 +8,7 @@ This document provides a quick reference for the Rhiza command-line interface.
|
|
|
8
8
|
|---------|-------------|
|
|
9
9
|
| `rhiza init` | Initialize or validate `.github/template.yml` |
|
|
10
10
|
| `rhiza materialize` | Inject templates into a target repository |
|
|
11
|
+
| `rhiza migrate` | Migrate to the new `.rhiza` folder structure |
|
|
11
12
|
| `rhiza validate` | Validate template configuration |
|
|
12
13
|
|
|
13
14
|
## Common Usage Patterns
|
|
@@ -88,6 +89,38 @@ rhiza materialize -b main -y # Short form
|
|
|
88
89
|
|
|
89
90
|
---
|
|
90
91
|
|
|
92
|
+
### rhiza migrate
|
|
93
|
+
|
|
94
|
+
**Purpose:** Migrate project to the new `.rhiza` folder structure
|
|
95
|
+
|
|
96
|
+
**Syntax:**
|
|
97
|
+
```bash
|
|
98
|
+
rhiza migrate [TARGET]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Parameters:**
|
|
102
|
+
- `TARGET` - Target repository directory (default: current directory)
|
|
103
|
+
|
|
104
|
+
**Examples:**
|
|
105
|
+
```bash
|
|
106
|
+
rhiza migrate # Migrate current directory
|
|
107
|
+
rhiza migrate /path/to/project # Migrate specific directory
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**What It Does:**
|
|
111
|
+
- Creates the `.rhiza/` directory in the project root
|
|
112
|
+
- Moves `template.yml` from `.github/rhiza/` or `.github/` to `.rhiza/template.yml`
|
|
113
|
+
- Moves `.rhiza.history` to `.rhiza/history`
|
|
114
|
+
- Provides instructions for next steps
|
|
115
|
+
- Skips files that already exist in `.rhiza/` (leaves old files in place for manual cleanup)
|
|
116
|
+
|
|
117
|
+
**When to Use:**
|
|
118
|
+
- Transitioning to the new `.rhiza/` folder structure
|
|
119
|
+
- Organizing Rhiza configuration separately from `.github/`
|
|
120
|
+
- Cleaning up project structure
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
91
124
|
### rhiza validate
|
|
92
125
|
|
|
93
126
|
**Purpose:** Validate `.github/template.yml` configuration
|