Skip to content

Conversation

@tschm
Copy link
Member

@tschm tschm commented Jan 28, 2026

Summary

This PR introduces src/src.mk to consolidate source code targets and improves the modularity of the Makefile system.

Key changes:

  • Create new src/src.mk containing targets for source code: mypy, docs, typecheck, security, and docs-coverage
  • Move targets from their previous locations:
    • mypy moved from rhiza.mk
    • docs moved from book.mk
    • typecheck, security, docs-coverage moved from tests.mk
  • Simplify deptry target using distributed DEPTRY_FOLDERS variable that each .mk file can contribute to
  • Add file existence checks to typecheck and docs-coverage targets to gracefully skip when no Python files exist
  • Add no-op fallback targets in book.mk for test, docs, and marimushka when their respective .mk files aren't included
  • Add typecheck jobs to CI workflows
  • Add COVERAGE_FAIL_UNDER configuration to .env

Benefits:

  • Better separation of concerns: source-related targets live alongside source code
  • More modular: each component declares its own deptry folders
  • Graceful degradation when optional components are missing

tschm and others added 8 commits January 28, 2026 08:10
Add no-op fallbacks for `test`, `docs`, and `marimushka` in `book.mk`
so the `book` target works even when their respective .mk files are
not included.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tection.

- Complete header description
- Add `security` target (pip-audit and bandit)
- Remove duplicate `typecheck` target (kept `mypy` with --strict)
- Detect packages by finding `__init__.py` files instead of listing subdirs
- Consistent quoting and dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
If src/src.mk is included, the source folder exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tschm tschm linked an issue Jan 28, 2026 that may be closed by this pull request
tschm and others added 5 commits January 28, 2026 11:21
The src.mk file uses `mypy "src"` (with quotes) but the test expected
`mypy src` (without quotes), causing the assertion to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reduced the expected .PHONY targets in the test from {"book", "docs", "marimushka"} to {"book"}.
@tschm
Copy link
Member Author

tschm commented Jan 28, 2026

@HarryCampion I think .rhiza/.env should be under special protection and we should not be able to overwrite it

@tschm tschm changed the title 434 srcmk for src 434 src.mk for src Jan 28, 2026
tschm and others added 5 commits January 28, 2026 12:56
…ual .mk files

Each .mk file now declares its contribution to DEPTRY_FOLDERS, and the main
deptry target runs once with all folders combined. marimo.mk also sets
DEPTRY_IGNORE for the --ignore DEP004 flag when notebooks are involved.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Also adds Python file existence check to skip gracefully when no source files are present.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Makefile structure by creating a dedicated src/src.mk module for source code-related targets. The refactoring moves type checking, documentation, and security scanning targets from their previous locations into a modular structure aligned with the rhiza framework's pattern of organizing targets by directory.

Changes:

  • Created src/src.mk with targets for mypy, typecheck, docs, docs-coverage, and security analysis
  • Removed corresponding targets from tests/tests.mk and book/book.mk
  • Updated .rhiza/rhiza.mk to use a more modular approach for deptry with DEPTRY_FOLDERS contributions
  • Added CI/CD jobs for docs-coverage and typecheck to GitHub and GitLab workflows
  • Deleted example src/hello module
  • Set COVERAGE_FAIL_UNDER=0 in .rhiza/.env (likely temporary for development)

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/src.mk New module containing source code targets (mypy, typecheck, docs, docs-coverage, security) previously scattered across other makefiles
tests/tests.mk Removed typecheck, security, mutate, and docs-coverage targets; simplified test target to use double-colon syntax
.rhiza/rhiza.mk Refactored deptry target to use DEPTRY_FOLDERS variable contributed by modules; removed mypy target and includes src/src.mk
book/book.mk Removed docs target and MARIMUSHKA_OUTPUT/LOGO_FILE definitions; added no-op fallback targets for modularity
book/marimo/marimo.mk Added DEPTRY_FOLDERS contribution and DEPTRY_IGNORE setting
tests/test_rhiza/test_makefile.py Updated mypy test assertions to match new src.mk implementation; commented out setup code
tests/test_rhiza/test_book.py Updated test expectations for book.mk phony targets
.rhiza/.env Set COVERAGE_FAIL_UNDER to 0
.github/workflows/*.yml Added docs-coverage and typecheck jobs to CI workflows
.gitlab/workflows/rhiza_ci.yml Added docs-coverage job
src/hello/* Deleted example hello module files

Copy link
Contributor

Copilot AI commented Jan 28, 2026

@tschm I've opened a new pull request, #437, to work on those changes. Once the pull request is ready, I'll request review from you.

tschm and others added 2 commits January 28, 2026 14:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
Copy link
Contributor

Copilot AI commented Jan 28, 2026

@tschm I've opened a new pull request, #438, to work on those changes. Once the pull request is ready, I'll request review from you.

tschm and others added 3 commits January 28, 2026 15:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
* Initial plan

* Make quoting around "src" consistent in src.mk

Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>

---------

Signed-off-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Co-authored-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
* Initial plan

* Remove commented-out code from test_mypy_target_dry_run

Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Co-authored-by: Thomas Schmelzer <thomas.schmelzer@gmail.com>
@tschm tschm requested a review from HarryCampion January 28, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

src.mk for src?

2 participants