From 34a024596d21e03ee169e99e1a742eb43eddbfca Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 5 Jan 2023 13:48:25 -0600 Subject: [PATCH] build: add .task.mk --- .gitignore | 1 + Makefile | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3f8198e..ff3b0df 100644 --- a/.gitignore +++ b/.gitignore @@ -169,3 +169,4 @@ poetry.toml # End of https://www.toptal.com/developers/gitignore/api/python +.task.mk diff --git a/Makefile b/Makefile index 2ce71f3..f32b486 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,32 @@ VERSION ?= $(shell git describe --tags --always --dirty=-dev | sed 's/^v//g') PREFIX ?= ~/bin - +## lint | run pre-commit hooks lint: pdm run pre-commit run --all || pdm run pre-commit run --all - +## types | run mypy types: mypy src/viv +## bump-version | update version and tag commit bump-version: @echo "bumping to version => $(VERSION)" @sed -i 's/__version__ = ".*"/__version__ = "$(VERSION)"/g' src/viv/viv.py @git add src/viv/viv.py && git commit -m "chore: bump version" @git tag v$(VERSION) +## env | generate environment env: pdm install +## install | symlink to $PREFIX install: ln -sf $(shell pwd)/src/viv/viv.py $(PREFIX)/viv +## uninstall | delete $(PREFIX)/viv uninstall: - rm ~/bin/viv + rm $(PREFIX)/viv +## docs | generate usage examples docs: docs/demo.gif docs/freeze.gif docs/%.gif: docs/%.tape @@ -33,4 +38,9 @@ generate-example-vivens: for f in $(EXAMPLES); \ do python examples/$$f; done -.PHONY: env lint install uninstall bump-version types docs generate-example-vivens +.PHONY: env lint install uninstall \ + bump-version types docs generate-example-vivens + +USAGE={a.bold}==>{a.cyan} viv isn't venv{a.end}\n\ttasks: +-include .task.mk +$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v22.9.28/task.mk -o .task.mk))