Skip to content

Add Makefile mirroring CI workflows + ruff dev-dep - #34

Merged
tommyjcarpenter merged 4 commits into
mainfrom
makefile
May 29, 2026
Merged

Add Makefile mirroring CI workflows + ruff dev-dep#34
tommyjcarpenter merged 4 commits into
mainfrom
makefile

Conversation

@tommyjcarpenter

Copy link
Copy Markdown
Owner

Add a Makefile that mirrors the three CI workflows so a clean make ci locally means the GitHub run will also pass, and add the ruff dev-dep that poetry install was leaving out.

CI installs its tools with bare pip install ruff==... / pip install jsonschema, never via Poetry, so poetry install on a fresh clone gives you the runtime deps but no ruff; make lint would then fail with "No module named ruff" before doing anything useful.

Changes:

  • pyproject.toml: add [tool.poetry.group.dev.dependencies] with ruff = "0.15.12", pinned to the same version .github/workflows/lint.yml installs. Bump in lockstep with the workflow.
  • Makefile (new): targets test, lint, schema, ci, install-dev, help. Each CI-equivalent target mirrors its workflow file exactly:
    • test -> python -m unittest discover -v tests (same as test.yml)
    • lint -> ruff check bootstrap/ + ruff format --check bootstrap/ (same as lint.yml)
    • schema -> loads sample_config.json and runs it through bootstrap.schema.config_validate (same as schema.yml's heredoc step)
    • ci -> lint test schema
  • PY := .venv/Scripts/python with a .venv/bin/python fallback for Linux/macOS, so the same Makefile works on every dev machine.

Test plan

  • make test -> 12 tests pass
  • make lint -> ruff check + format check pass on clean tree
  • make schema -> sample_config.json validates
  • make ci -> runs all three in sequence

…that `poetry install` was leaving out.

The CI jobs install their tools with bare `pip install ruff==...` / `pip install jsonschema`, never via Poetry, so `poetry install` on a fresh clone gives you the runtime deps but no ruff — `make lint` would then fail with "No module named ruff" before doing anything useful.

Changes:
- **`pyproject.toml`**: add `[tool.poetry.group.dev.dependencies]` with `ruff = "0.15.12"`, pinned to the same version `.github/workflows/lint.yml` installs. Bump in lockstep with the workflow.
- **`Makefile`** (new): targets `test`, `lint`, `schema`, `ci`, `install-dev`, `help`. Each CI-equivalent target mirrors its workflow file exactly:
  - `test` -> `python -m unittest discover -v tests` (same as test.yml)
  - `lint` -> `ruff check bootstrap/` + `ruff format --check bootstrap/` (same as lint.yml)
  - `schema` -> loads sample_config.json and runs it through `bootstrap.schema.config_validate` (same as schema.yml's heredoc step)
  - `ci` -> `lint test schema`
- `PY := .venv/Scripts/python` with a `.venv/bin/python` fallback for Linux/macOS, so the same Makefile works on every dev machine.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds local Make targets intended to mirror CI checks and introduces Ruff as a Poetry dev dependency so contributors can run linting locally.

Changes:

  • Adds a new Makefile with test, lint, schema, ci, install-dev, and help targets.
  • Adds Ruff to Poetry dev dependencies, intended to match the CI-pinned Ruff version.

Reviewed changes

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

File Description
pyproject.toml Adds Ruff as a dev dependency for local linting.
Makefile Adds local commands that run the same test, lint, and schema validation checks as CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread Makefile
…env.

Two fresh-clone failures Copilot caught:

1. `pyproject.toml` got a new `ruff` dev dep but `poetry.lock` was not regenerated, so `poetry install --with dev` would either reject the lock as out-of-sync or install without ruff and then `make lint` would crash on import. Regenerated; ruff 0.15.12 is now resolved in the lock.

2. The Makefile hard-codes `.venv/bin/python` / `.venv/Scripts/python`, but Poetry's default venv location is a cached path elsewhere on disk, so `make install-dev` followed by `make lint` on a fresh clone would fail with "No such file or directory". Added `poetry.toml` pinning `virtualenvs.in-project = true` so Poetry always materializes the venv at `.venv/` inside the project, matching what $(PY) expects.

Also expanded the install-dev comment in the Makefile to explain why poetry.toml is committed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Comment thread Makefile Outdated
Comment thread poetry.toml
- **Makefile**: `ifeq ($(OS),)` was treating *any* non-empty `OS` value as Windows, so shells exporting `OS=Linux` or `OS=Darwin` would resolve `.venv/Scripts/python` and fail. Flipped to the explicit `ifeq ($(OS),Windows_NT)` form with the Unix path in `else`.
- **`.gitignore`**: existing `venv*` glob doesn't match `.venv` (leading dot is significant). Now that `poetry.toml` forces `virtualenvs.in-project = true`, every fresh clone would leave a large untracked `.venv/` in the working tree. Added `.venv/` explicitly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

Comment thread Makefile
Copilot caught that `[tool.poetry.group.dev.dependencies]` is non-optional by default, so plain `poetry install` already pulls in ruff and the install-dev comment claiming otherwise was wrong. Two ways to reconcile: drop `--with dev` and update the comment, or make the group optional and keep `--with dev`. Picked optional: ruff is a contributor-only tool, separated from runtime by intent, and `make install-dev` stays the documented entry point for setting up to lint.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated no new comments.

@tommyjcarpenter
tommyjcarpenter merged commit 4aeaf09 into main May 29, 2026
6 checks passed
@tommyjcarpenter
tommyjcarpenter deleted the makefile branch May 29, 2026 13:14
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.

2 participants