-
Notifications
You must be signed in to change notification settings - Fork 0
Add Makefile mirroring CI workflows + ruff dev-dep #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b5b0c29
Add Makefile mirroring the three CI workflows, plus the ruff dev-dep …
tommyjcarpenter cf55699
Address Copilot review: regenerate poetry.lock and force in-project v…
tommyjcarpenter 1446f37
Address second Copilot pass: explicit Windows_NT check and .venv ignore.
tommyjcarpenter c2dc2f4
Mark dev group optional so the Makefile comment is accurate.
tommyjcarpenter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ credentials/* | |
| coverage.xml | ||
| .tox/ | ||
| venv* | ||
| .venv/ | ||
| *.pyc | ||
| .idea/ | ||
| .python-version | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| .PHONY: help install-dev test lint schema ci | ||
|
|
||
| # Python interpreter inside the project venv. Works on Windows GNU Make | ||
| # (forward slashes are fine) and on Linux/Mac. Check $(OS) == Windows_NT | ||
| # explicitly — testing for "non-empty" would mis-route Linux/Darwin shells | ||
| # that happen to export OS=Linux / OS=Darwin to the Windows path. | ||
| ifeq ($(OS),Windows_NT) | ||
| PY := .venv/Scripts/python | ||
| else | ||
| PY := .venv/bin/python | ||
| endif | ||
|
|
||
| # ---- Default: show targets ---- | ||
| help: | ||
| @echo "Common targets:" | ||
| @echo " make test Run the same unittest command CI runs (.github/workflows/test.yml)" | ||
| @echo " make lint Run the same ruff checks CI runs (.github/workflows/lint.yml)" | ||
| @echo " make schema Validate sample_config.json (.github/workflows/schema.yml)" | ||
| @echo " make ci Full pre-push verification: lint + test + schema" | ||
| @echo " make install-dev Install runtime + dev deps (adds ruff) via Poetry" | ||
|
|
||
| # `poetry install` alone leaves out the dev group, so `make lint` would fail | ||
| # on a fresh clone. `--with dev` pulls in ruff at the CI-pinned version. | ||
|
tommyjcarpenter marked this conversation as resolved.
|
||
| # The committed poetry.toml pins virtualenvs.in-project = true so Poetry | ||
| # creates the venv at .venv/ inside the project, which is where the $(PY) | ||
| # above looks for it; without that, Poetry would cache the venv elsewhere | ||
| # and the subsequent test/lint/schema targets would not find Python. | ||
| install-dev: | ||
| poetry install --with dev | ||
|
|
||
| # ============================================================================= | ||
| # CI-equivalent targets. These mirror .github/workflows/*.yml exactly so a | ||
| # clean run locally means the GitHub run will also pass. | ||
| # ============================================================================= | ||
|
|
||
| # Mirrors .github/workflows/test.yml — discovers and runs every unittest | ||
| # under tests/. The package itself imports cleanly on any OS (only the | ||
| # inner functions shell out to OS-specific tools), so the same command | ||
| # passes on the Linux/macOS/Windows runners CI matrixes over. | ||
| test: | ||
| $(PY) -m unittest discover -v tests | ||
|
|
||
| # Mirrors .github/workflows/lint.yml — ruff check + ruff format --check. | ||
| lint: | ||
| $(PY) -m ruff check bootstrap/ | ||
| $(PY) -m ruff format --check bootstrap/ | ||
|
|
||
| # Mirrors .github/workflows/schema.yml — loads sample_config.json and runs | ||
| # it through bootstrap.schema.config_validate. Catches regressions where a | ||
| # schema change makes the documented sample config invalid. | ||
| schema: | ||
| $(PY) -c "import json; from bootstrap.schema import config_validate; config_validate(json.load(open('sample_config.json'))); print('sample_config.json is valid')" | ||
|
|
||
| # Full pre-push verification: everything CI runs, in one shot. | ||
| ci: lint test schema | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [virtualenvs] | ||
| in-project = true | ||
|
tommyjcarpenter marked this conversation as resolved.
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.