Add Makefile mirroring CI workflows + ruff dev-dep - #34
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
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
Makefilewithtest,lint,schema,ci,install-dev, andhelptargets. - 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.
…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.
- **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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a Makefile that mirrors the three CI workflows so a clean
make cilocally means the GitHub run will also pass, and add the ruff dev-dep thatpoetry installwas leaving out.CI installs its tools with bare
pip install ruff==.../pip install jsonschema, never via Poetry, sopoetry installon a fresh clone gives you the runtime deps but no ruff;make lintwould then fail with "No module named ruff" before doing anything useful.Changes:
pyproject.toml: add[tool.poetry.group.dev.dependencies]withruff = "0.15.12", pinned to the same version.github/workflows/lint.ymlinstalls. Bump in lockstep with the workflow.Makefile(new): targetstest,lint,schema,ci,install-dev,help. Each CI-equivalent target mirrors its workflow file exactly:test->python -m unittest discover -v tests(same astest.yml)lint->ruff check bootstrap/+ruff format --check bootstrap/(same aslint.yml)schema-> loadssample_config.jsonand runs it throughbootstrap.schema.config_validate(same asschema.yml's heredoc step)ci->lint test schemaPY := .venv/Scripts/pythonwith a.venv/bin/pythonfallback for Linux/macOS, so the same Makefile works on every dev machine.Test plan
make test-> 12 tests passmake lint-> ruff check + format check pass on clean treemake schema-> sample_config.json validatesmake ci-> runs all three in sequence