Skip to content

build: add make targets for install, uninstall, test, lint, clean, distclean#138

Open
trevor-vaughan wants to merge 1 commit into
LobsterTrap:mainfrom
trevor-vaughan:feat/130-make-targets
Open

build: add make targets for install, uninstall, test, lint, clean, distclean#138
trevor-vaughan wants to merge 1 commit into
LobsterTrap:mainfrom
trevor-vaughan:feat/130-make-targets

Conversation

@trevor-vaughan
Copy link
Copy Markdown
Contributor

@trevor-vaughan trevor-vaughan commented May 18, 2026

Summary

Adds the following usual make targets:

  • install: uv sync --group dev (creates or updates .venv)
  • uninstall: removes lola-ai package; graceful no-op when no .venv
  • test: uv run pytest (auto-syncs venv if missing)
  • lint: ruff check + format check + mypy
  • clean: prunes caches, build artifacts, bytecode; preserves .venv, .lola, and .git via find -prune to avoid descending into restricted subtrees
  • distclean: cascades clean + docs-clean, then removes .venv and the hatch-vcs _version.py

Related Issues

Fixes: #130

Checklist

  • Tests pass (pytest)
  • Linting passes (ruff check src tests)
  • Type checking passes (ty check)

AI Disclosure

AI Use - Claude Opus 4.7 (1M context)

Summary by CodeRabbit

  • Chores
    • Added developer-oriented commands to streamline a local development workflow: create/sync the project virtual environment and dependencies, run/uninstall the CLI, execute tests, and perform lint/format/type checks.
    • Added cleanup targets to remove build artifacts, caches, coverage outputs, bytecode, and optionally the local virtual environment.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

Adds mk/dev.mk and includes it from the root Makefile. mk/dev.mk sets UV_PROJECT_ENVIRONMENT to ./.venv and provides install, uninstall, test, run, lint, clean, and distclean Make targets for local dev workflows and cleanup.

Changes

Development Workflow Setup

Layer / File(s) Summary
Development environment and workflow integration
Makefile, mk/dev.mk
Makefile includes mk/dev.mk; UV_PROJECT_ENVIRONMENT pins uv to ./.venv; targets added for install (sync dev deps), uninstall (cond. remove lola-ai), test (pytest), run (CLI with ARGS passthrough), and lint (ruff and mypy).
Cleanup and state management
mk/dev.mk
CLEAN_PRUNE prevents traversal into .venv, .lola, and .git; clean removes build/dist, caches, coverage, test output, and Python bytecode; distclean runs clean plus docs-clean, deletes ./.venv, and removes src/lola/_version.py.

🎯 3 (Moderate) | ⏱️ ~20 minutes

A rabbit huddles by the Make,
whiskers twitch, scripts awake,
make install, make test, then run—
clean the mess, the work is done. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding make targets for install, uninstall, test, lint, clean, and distclean.
Linked Issues check ✅ Passed The pull request implements all coding requirements from issue #130: install and uninstall targets are provided, along with additional related targets (test, lint, clean, distclean) that enhance the development workflow.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #130. The addition of test, lint, clean, and distclean targets, while not explicitly requested, are standard and complementary to the core install/uninstall functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
mk/dev.mk (1)

20-20: ⚡ Quick win

Add --yes flag for non-interactive uninstall.

The uv pip uninstall command should include the --yes or -y flag to prevent prompts during automated Make target execution.

📝 Suggested enhancement
-		uv pip uninstall lola-ai; \
+		uv pip uninstall --yes lola-ai; \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mk/dev.mk` at line 20, Update the uninstall command in the Make target so it
runs non-interactively by adding the confirmation flag to the existing command
"uv pip uninstall lola-ai" (use "--yes" or "-y"); locate the occurrence of that
exact command in mk/dev.mk and change it to include the flag so automation won't
block on a prompt.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@mk/dev.mk`:
- Line 20: Update the uninstall command in the Make target so it runs
non-interactively by adding the confirmation flag to the existing command "uv
pip uninstall lola-ai" (use "--yes" or "-y"); locate the occurrence of that
exact command in mk/dev.mk and change it to include the flag so automation won't
block on a prompt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 93ed7b58-0466-41e2-96ff-3b3f64ed136e

📥 Commits

Reviewing files that changed from the base of the PR and between 2306e12 and 24f90d4.

📒 Files selected for processing (2)
  • Makefile
  • mk/dev.mk

…stclean

Adds mk/dev.mk fragment following the existing modular Makefile pattern
(alongside mk/mkdocs.mk and mk/adr.mk). All targets drive uv against the
project-local .venv via UV_PROJECT_ENVIRONMENT, so they work uniformly
regardless of any global uv configuration.

- install: uv sync --group dev (creates or updates .venv)
- uninstall: removes lola-ai package; graceful no-op when no .venv
- test: uv run pytest (auto-syncs venv if missing)
- lint: ruff check + format check + mypy
- clean: prunes caches, build artifacts, bytecode; preserves .venv,
  .lola, and .git via find -prune to avoid descending into restricted
  subtrees
- distclean: cascades clean + docs-clean, then removes .venv and the
  hatch-vcs _version.py

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Fixes: LobsterTrap#130
@trevor-vaughan trevor-vaughan force-pushed the feat/130-make-targets branch from 24f90d4 to 386109d Compare May 25, 2026 13:08
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mk/dev.mk`:
- Line 60: The rm -rf invocation in mk/dev.mk uses the UV_PROJECT_ENVIRONMENT
variable unquoted which can lead to path-splitting or globbing issues; update
the delete command to wrap the UV_PROJECT_ENVIRONMENT variable in double quotes
so the entire venv path is treated as a single argument (modify the line
containing `@rm` -rf $(UV_PROJECT_ENVIRONMENT) to quote the variable).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6f6e0ba0-a4f3-4775-9583-da20ac9174e2

📥 Commits

Reviewing files that changed from the base of the PR and between 24f90d4 and 386109d.

📒 Files selected for processing (2)
  • Makefile
  • mk/dev.mk

Comment thread mk/dev.mk

distclean: clean docs-clean ## - deep clean: also removes .venv and generated _version.py (slow to rebuild)
@echo "Removing virtual environment at $(UV_PROJECT_ENVIRONMENT)..."
@rm -rf $(UV_PROJECT_ENVIRONMENT)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Quote the venv path in destructive delete command.

Line 60 should quote $(UV_PROJECT_ENVIRONMENT) to avoid path-splitting edge cases.

Suggested patch
-	`@rm` -rf $(UV_PROJECT_ENVIRONMENT)
+	`@rm` -rf "$(UV_PROJECT_ENVIRONMENT)"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@rm -rf $(UV_PROJECT_ENVIRONMENT)
`@rm` -rf "$(UV_PROJECT_ENVIRONMENT)"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mk/dev.mk` at line 60, The rm -rf invocation in mk/dev.mk uses the
UV_PROJECT_ENVIRONMENT variable unquoted which can lead to path-splitting or
globbing issues; update the delete command to wrap the UV_PROJECT_ENVIRONMENT
variable in double quotes so the entire venv path is treated as a single
argument (modify the line containing `@rm` -rf $(UV_PROJECT_ENVIRONMENT) to quote
the variable).

@mrbrandao mrbrandao self-assigned this May 25, 2026
@mrbrandao mrbrandao added enhancement New feature or request good first issue Good for newcomers labels May 25, 2026
@mrbrandao mrbrandao self-requested a review May 25, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] - Add install and uninstall targets to Makefile

2 participants