Ship the two maintainer workflow helpers as installable Python CLIs so
any fork-based OSS project can reuse them without vendoring shell
scripts:
* git-setup-remotes configures origin/fork/main-tracking/pushDefault
for a fork-based clone. URLs are parameterized (--canonical / --fork
or CANONICAL_URL / FORK_URL) so the same binary bootstraps any
maintainer's repo. Idempotent.
* git-sign-push GPG-signs every unpushed commit on the current branch
and pushes, resolving the target remote from remote.pushDefault
(falling back to origin) for branches without upstream.
Both refuse to run when CLAUDE_CODE/CLAUDECODE is set, since the Claude
sandbox blocks .git/config writes and access to ~/.gnupg: failing fast
beats failing late.
Other additions:
* Makefile: install / install-dev / test / lint / clean targets.
* .github/workflows/test.yml: pytest + ruff matrix for py 3.10/11/12.
* MIRRORS: github, git.veen.world:2201, code.infinito.nexus:2201, pypi.
* LICENSE switched to MIT; README records the extraction origin
(s.infinito.nexus/code) and adds author + license sections.
* Tests cover sandbox-refusal guards and the fork-URL resolution
preference order (CLI arg > env var > existing fork remote > origin
when not canonical).
30 lines
730 B
Makefile
30 lines
730 B
Makefile
.PHONY: help install install-dev test lint clean
|
|
|
|
PYTHON ?= python3
|
|
|
|
help:
|
|
@echo "Targets:"
|
|
@echo " install Install the package (editable, runtime deps only)"
|
|
@echo " install-dev Install the package with dev extras (pytest, ruff)"
|
|
@echo " test Run the pytest test suite"
|
|
@echo " lint Run ruff against the source tree"
|
|
@echo " clean Remove build artefacts and test/lint caches"
|
|
|
|
install:
|
|
$(PYTHON) -m pip install -e .
|
|
|
|
install-dev:
|
|
$(PYTHON) -m pip install -e '.[dev]'
|
|
|
|
test:
|
|
PYTHONPATH=src $(PYTHON) -m pytest tests/ -v
|
|
|
|
lint:
|
|
$(PYTHON) -m ruff check --no-cache src/ tests/
|
|
|
|
clean:
|
|
rm -rf build dist *.egg-info src/*.egg-info \
|
|
.pytest_cache .ruff_cache \
|
|
.venv \
|
|
**/__pycache__
|