From b241aca1e34f258e993b3fcf0ac8473c3fb2f44e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:23:29 +0000 Subject: [PATCH 1/5] Initial plan From 0c69860b77fdc5347d4e553893b0e20369e8ad32 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:25:31 +0000 Subject: [PATCH 2/5] Extract and use SOURCE_FOLDER and MARIMO_FOLDER variables in deptry workflows Co-authored-by: tschm <2046079+tschm@users.noreply.github.com> --- .github/workflows/rhiza_deptry.yml | 43 +++++++++++++++++++++++++----- .gitlab/workflows/rhiza_deptry.yml | 25 ++++++++++++++++- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rhiza_deptry.yml b/.github/workflows/rhiza_deptry.yml index 30220daa..00ccf02b 100644 --- a/.github/workflows/rhiza_deptry.yml +++ b/.github/workflows/rhiza_deptry.yml @@ -37,9 +37,40 @@ jobs: with: token: ${{ secrets.GH_PAT }} - - name: Run deptry - run: make deptry - # NOTE: make deptry is good style because it encapsulates the folders to check - # (e.g. src and book/marimo) and keeps CI in sync with local development. - # Since we use a 'uv' container, the Makefile is optimised to use the - # pre-installed 'uv' and 'uvx' from the system PATH. + - name: Extract folder variables + id: folders + run: | + # Extract SOURCE_FOLDER from the project configuration (via Makefile) + # shellcheck disable=SC2016 # Single quotes intentional - Make syntax, not shell expansion + SOURCE_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(SOURCE_FOLDER),src)' print) + echo "source=$SOURCE_FOLDER" >> "$GITHUB_OUTPUT" + + # Extract MARIMO_FOLDER from the project configuration (via Makefile) + # shellcheck disable=SC2016 # Single quotes intentional - Make syntax, not shell expansion + MARIMO_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(MARIMO_FOLDER),marimo)' print) + echo "marimo=$MARIMO_FOLDER" >> "$GITHUB_OUTPUT" + + echo "Detected SOURCE_FOLDER: $SOURCE_FOLDER" + echo "Detected MARIMO_FOLDER: $MARIMO_FOLDER" + + - name: Run deptry on source folder + if: steps.folders.outputs.source != '' + run: | + if [ -d "${{ steps.folders.outputs.source }}" ]; then + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.source }} + else + echo "Source folder ${{ steps.folders.outputs.source }} does not exist, skipping" + fi + + - name: Run deptry on marimo folder + if: steps.folders.outputs.marimo != '' + run: | + if [ -d "${{ steps.folders.outputs.marimo }}" ]; then + if [ -d "${{ steps.folders.outputs.source }}" ]; then + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.marimo }} ${{ steps.folders.outputs.source }} --ignore DEP004 + else + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.marimo }} --ignore DEP004 + fi + else + echo "Marimo folder ${{ steps.folders.outputs.marimo }} does not exist, skipping" + fi diff --git a/.gitlab/workflows/rhiza_deptry.yml b/.gitlab/workflows/rhiza_deptry.yml index e2f15f18..e9908c97 100644 --- a/.gitlab/workflows/rhiza_deptry.yml +++ b/.gitlab/workflows/rhiza_deptry.yml @@ -15,7 +15,30 @@ deptry:check: needs: [] image: ghcr.io/astral-sh/uv:0.9.30-bookworm script: - - make deptry + # Extract SOURCE_FOLDER and MARIMO_FOLDER from the project configuration + - | + SOURCE_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(SOURCE_FOLDER),src)' print) + MARIMO_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(MARIMO_FOLDER),marimo)' print) + echo "Detected SOURCE_FOLDER: $SOURCE_FOLDER" + echo "Detected MARIMO_FOLDER: $MARIMO_FOLDER" + # Run deptry on source folder if it exists + - | + if [ -n "$SOURCE_FOLDER" ] && [ -d "$SOURCE_FOLDER" ]; then + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$SOURCE_FOLDER" + else + echo "Source folder $SOURCE_FOLDER does not exist, skipping" + fi + # Run deptry on marimo folder if it exists + - | + if [ -n "$MARIMO_FOLDER" ] && [ -d "$MARIMO_FOLDER" ]; then + if [ -d "$SOURCE_FOLDER" ]; then + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$MARIMO_FOLDER" "$SOURCE_FOLDER" --ignore DEP004 + else + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$MARIMO_FOLDER" --ignore DEP004 + fi + else + echo "Marimo folder $MARIMO_FOLDER does not exist, skipping" + fi rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH From 2d069b5f478bccc004257ded12aa5381cc07d944 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:26:27 +0000 Subject: [PATCH 3/5] Update documentation to reflect deptry workflow improvements Co-authored-by: tschm <2046079+tschm@users.noreply.github.com> --- .gitlab/README.md | 3 ++- .gitlab/TESTING.md | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab/README.md b/.gitlab/README.md index b0523a79..47d3d008 100644 --- a/.gitlab/README.md +++ b/.gitlab/README.md @@ -63,7 +63,8 @@ This directory contains GitLab CI/CD workflow configurations that mirror the fun - On merge requests to main/master **Key Features:** -- Automatic source folder detection +- Extracts SOURCE_FOLDER and MARIMO_FOLDER from Makefile configuration +- Automatically detects and checks all configured source folders - Identifies unused dependencies **Equivalent GitHub Action:** `.github/workflows/rhiza_deptry.yml` diff --git a/.gitlab/TESTING.md b/.gitlab/TESTING.md index 8bbcd93e..32deb7c3 100644 --- a/.gitlab/TESTING.md +++ b/.gitlab/TESTING.md @@ -98,12 +98,16 @@ This workflow is designed for repositories that use rhiza as a template, not for **Expected behavior:** - Checks for missing/obsolete dependencies -- Automatically detects source folder (`src/` or `.`) +- Automatically extracts SOURCE_FOLDER and MARIMO_FOLDER from Makefile configuration +- Runs deptry on detected folders if they exist - Reports unused dependencies **Manual test:** ```bash -# Run deptry locally +# Run deptry locally using make (recommended) +make deptry + +# Or run deptry directly uvx deptry src/ ``` From 5665e228b3080683c84372f7646dfa47347db9d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:27:35 +0000 Subject: [PATCH 4/5] Fix code review issues: quote variables and consolidate GitLab CI script blocks Co-authored-by: tschm <2046079+tschm@users.noreply.github.com> --- .github/workflows/rhiza_deptry.yml | 6 +++--- .gitlab/workflows/rhiza_deptry.yml | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rhiza_deptry.yml b/.github/workflows/rhiza_deptry.yml index 00ccf02b..ce9c8c8d 100644 --- a/.github/workflows/rhiza_deptry.yml +++ b/.github/workflows/rhiza_deptry.yml @@ -57,7 +57,7 @@ jobs: if: steps.folders.outputs.source != '' run: | if [ -d "${{ steps.folders.outputs.source }}" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.source }} + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.source }}" else echo "Source folder ${{ steps.folders.outputs.source }} does not exist, skipping" fi @@ -67,9 +67,9 @@ jobs: run: | if [ -d "${{ steps.folders.outputs.marimo }}" ]; then if [ -d "${{ steps.folders.outputs.source }}" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.marimo }} ${{ steps.folders.outputs.source }} --ignore DEP004 + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.marimo }}" "${{ steps.folders.outputs.source }}" --ignore DEP004 else - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry ${{ steps.folders.outputs.marimo }} --ignore DEP004 + uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.marimo }}" --ignore DEP004 fi else echo "Marimo folder ${{ steps.folders.outputs.marimo }} does not exist, skipping" diff --git a/.gitlab/workflows/rhiza_deptry.yml b/.gitlab/workflows/rhiza_deptry.yml index e9908c97..9580f3ff 100644 --- a/.gitlab/workflows/rhiza_deptry.yml +++ b/.gitlab/workflows/rhiza_deptry.yml @@ -16,20 +16,21 @@ deptry:check: image: ghcr.io/astral-sh/uv:0.9.30-bookworm script: # Extract SOURCE_FOLDER and MARIMO_FOLDER from the project configuration + # and run deptry on detected folders - | SOURCE_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(SOURCE_FOLDER),src)' print) MARIMO_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(MARIMO_FOLDER),marimo)' print) echo "Detected SOURCE_FOLDER: $SOURCE_FOLDER" echo "Detected MARIMO_FOLDER: $MARIMO_FOLDER" - # Run deptry on source folder if it exists - - | + + # Run deptry on source folder if it exists if [ -n "$SOURCE_FOLDER" ] && [ -d "$SOURCE_FOLDER" ]; then uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$SOURCE_FOLDER" else echo "Source folder $SOURCE_FOLDER does not exist, skipping" fi - # Run deptry on marimo folder if it exists - - | + + # Run deptry on marimo folder if it exists if [ -n "$MARIMO_FOLDER" ] && [ -d "$MARIMO_FOLDER" ]; then if [ -d "$SOURCE_FOLDER" ]; then uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$MARIMO_FOLDER" "$SOURCE_FOLDER" --ignore DEP004 From e6679a15040f1dbf42c0c535042da329d4bdec67 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 04:28:32 +0000 Subject: [PATCH 5/5] Extract Python version to variable for consistency Co-authored-by: tschm <2046079+tschm@users.noreply.github.com> --- .github/workflows/rhiza_deptry.yml | 11 ++++++++--- .gitlab/workflows/rhiza_deptry.yml | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rhiza_deptry.yml b/.github/workflows/rhiza_deptry.yml index ce9c8c8d..a81dff67 100644 --- a/.github/workflows/rhiza_deptry.yml +++ b/.github/workflows/rhiza_deptry.yml @@ -50,14 +50,19 @@ jobs: MARIMO_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(MARIMO_FOLDER),marimo)' print) echo "marimo=$MARIMO_FOLDER" >> "$GITHUB_OUTPUT" + # Extract Python version + PYTHON_VERSION=$(cat .python-version 2>/dev/null || echo "3.13") + echo "python_version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT" + echo "Detected SOURCE_FOLDER: $SOURCE_FOLDER" echo "Detected MARIMO_FOLDER: $MARIMO_FOLDER" + echo "Using Python version: $PYTHON_VERSION" - name: Run deptry on source folder if: steps.folders.outputs.source != '' run: | if [ -d "${{ steps.folders.outputs.source }}" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.source }}" + uvx -p "${{ steps.folders.outputs.python_version }}" deptry "${{ steps.folders.outputs.source }}" else echo "Source folder ${{ steps.folders.outputs.source }} does not exist, skipping" fi @@ -67,9 +72,9 @@ jobs: run: | if [ -d "${{ steps.folders.outputs.marimo }}" ]; then if [ -d "${{ steps.folders.outputs.source }}" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.marimo }}" "${{ steps.folders.outputs.source }}" --ignore DEP004 + uvx -p "${{ steps.folders.outputs.python_version }}" deptry "${{ steps.folders.outputs.marimo }}" "${{ steps.folders.outputs.source }}" --ignore DEP004 else - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "${{ steps.folders.outputs.marimo }}" --ignore DEP004 + uvx -p "${{ steps.folders.outputs.python_version }}" deptry "${{ steps.folders.outputs.marimo }}" --ignore DEP004 fi else echo "Marimo folder ${{ steps.folders.outputs.marimo }} does not exist, skipping" diff --git a/.gitlab/workflows/rhiza_deptry.yml b/.gitlab/workflows/rhiza_deptry.yml index 9580f3ff..b0c3456b 100644 --- a/.gitlab/workflows/rhiza_deptry.yml +++ b/.gitlab/workflows/rhiza_deptry.yml @@ -20,12 +20,15 @@ deptry:check: - | SOURCE_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(SOURCE_FOLDER),src)' print) MARIMO_FOLDER=$(make -s -f Makefile -f - <<< 'print: ; @echo $(or $(MARIMO_FOLDER),marimo)' print) + PYTHON_VERSION=$(cat .python-version 2>/dev/null || echo "3.13") + echo "Detected SOURCE_FOLDER: $SOURCE_FOLDER" echo "Detected MARIMO_FOLDER: $MARIMO_FOLDER" + echo "Using Python version: $PYTHON_VERSION" # Run deptry on source folder if it exists if [ -n "$SOURCE_FOLDER" ] && [ -d "$SOURCE_FOLDER" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$SOURCE_FOLDER" + uvx -p "$PYTHON_VERSION" deptry "$SOURCE_FOLDER" else echo "Source folder $SOURCE_FOLDER does not exist, skipping" fi @@ -33,9 +36,9 @@ deptry:check: # Run deptry on marimo folder if it exists if [ -n "$MARIMO_FOLDER" ] && [ -d "$MARIMO_FOLDER" ]; then if [ -d "$SOURCE_FOLDER" ]; then - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$MARIMO_FOLDER" "$SOURCE_FOLDER" --ignore DEP004 + uvx -p "$PYTHON_VERSION" deptry "$MARIMO_FOLDER" "$SOURCE_FOLDER" --ignore DEP004 else - uvx -p $(cat .python-version 2>/dev/null || echo "3.13") deptry "$MARIMO_FOLDER" --ignore DEP004 + uvx -p "$PYTHON_VERSION" deptry "$MARIMO_FOLDER" --ignore DEP004 fi else echo "Marimo folder $MARIMO_FOLDER does not exist, skipping"