Skip to content

fix: make Makefile use $(PYTHON) instead of hardcoded python for python3-only systems#714

Merged
dgenio merged 1 commit into
dgenio:mainfrom
corazonthedev:fix/python3-makefile-compat
Jun 19, 2026
Merged

fix: make Makefile use $(PYTHON) instead of hardcoded python for python3-only systems#714
dgenio merged 1 commit into
dgenio:mainfrom
corazonthedev:fix/python3-makefile-compat

Conversation

@corazonthedev

Copy link
Copy Markdown
Contributor

Summary

Makefile targets hardcode python on PATH, but many modern environments ship
only python3. On those machines no documented commands — make test,
make ci, make demo — run at all. This issue makes the interpreter
configurable (PYTHON ?= python3) so the documented workflow works out of the
box.

Changes

File Change
Makefile Added PYTHON ?= python3, replaced all 67 python with $(PYTHON)
CONTRIBUTING.md Added note documenting the PYTHON= override

Verification

  • grep -cP '^\\s+python\\b' Makefile0 (zero raw python on command lines)
  • grep -cP '^\\s+\$\(PYTHON\)' Makefile67 (all replaced)
  • CI unaffected (uses setup-python which provides python)
  • Only 2 files changed — no unrelated modifications

Closes

Closes #712

…on3-only systems

Systems with only `python3` on PATH (no `python`) cannot run `make ci` or any
other target. Add a `PYTHON ?= python3` variable and replace all 67 bare
`python` command invocations with `$(PYTHON)` so the Makefile works
out of the box on modern environments.

Also add a note in CONTRIBUTING.md documenting the override.

Closes dgenio#712.

@dgenio dgenio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed — APPROVE. Clean, complete fix for #712. Verified via make -n: the default resolves to python3, make … PYTHON=python3.11 overrides correctly, and the override propagates into the examplearchitectures sub-make. CI is unaffected (setup-python provides both python and python3).

Confirmed the replacement is complete — zero bare python invocations remain in the full file (checked against the head, not just the diff), and all 67 are now $(PYTHON).

Two non-blocking notes:

  • CONTRIBUTING.md's pip install -e ".[dev]" bootstrap line still assumes pip on PATH (#712 mentioned the pip assumption). It's outside the Makefile-interpreter scope and usually satisfied by an active venv — flagging only for completeness.
  • ruff/mypy/mkdocs are left as bare console scripts rather than $(PYTHON) -m …. That's the correct choice (not all of them support python -m); no change needed.

Acceptance criteria from #712 all met and behaviorally verified. Nice, well-scoped change.


Generated by Claude Code

@dgenio dgenio merged commit e89a124 into dgenio:main Jun 19, 2026
8 of 9 checks passed
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.

Makefile targets hardcode python/pip; contributors with only python3 on PATH can't run make ci (blocked a real external PR)

2 participants