From 24d77a198c03fa6a06758576f6be7ba7d8cb992f Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 22 Jan 2023 14:40:13 -0600 Subject: [PATCH] build: upgrade task.mk --- .task.cfg.mk | 3 +++ Makefile | 31 ++++++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-) create mode 100644 .task.cfg.mk diff --git a/.task.cfg.mk b/.task.cfg.mk new file mode 100644 index 0000000..9fa4976 --- /dev/null +++ b/.task.cfg.mk @@ -0,0 +1,3 @@ +USAGE={a.bold}{a.cyan} viv isn't venv{a.end}\n\n\ttasks:\n +PHONIFY=1 +HELP_SEP={a.b_blue}>>>{a.end} diff --git a/Makefile b/Makefile index f32b486..ca23c98 100644 --- a/Makefile +++ b/Makefile @@ -1,46 +1,35 @@ VERSION ?= $(shell git describe --tags --always --dirty=-dev | sed 's/^v//g') PREFIX ?= ~/bin -## lint | run pre-commit hooks -lint: +lint: ## run pre-commit hooks pdm run pre-commit run --all || pdm run pre-commit run --all -## types | run mypy -types: +types: ## run mypy mypy src/viv -## bump-version | update version and tag commit -bump-version: +bump-version: ## update version and tag commit @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: +env: ## generate environment pdm install -## install | symlink to $PREFIX -install: +install: ## symlink to $PREFIX ln -sf $(shell pwd)/src/viv/viv.py $(PREFIX)/viv -## uninstall | delete $(PREFIX)/viv -uninstall: +uninstall: ## delete $(PREFIX)/viv rm $(PREFIX)/viv -## docs | generate usage examples -docs: docs/demo.gif docs/freeze.gif +docs: docs/demo.gif docs/freeze.gif ## generate usage examples docs/%.gif: docs/%.tape viv rm $$(viv l -q) vhs < $< EXAMPLES = cli.py sys_path.py exe_specific.py frozen_import.py named_env.py scrape.py -generate-example-vivens: +generate-example-vivens: ## for f in $(EXAMPLES); \ do python examples/$$f; done -.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)) +-include .task.cfg.mk .task.mk +$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.1/task.mk -o .task.mk))