viv/Makefile

57 lines
1.3 KiB
Makefile
Raw Normal View History

2022-12-19 23:15:56 -06:00
VERSION ?= $(shell git describe --tags --always --dirty=-dev | sed 's/^v//g')
2022-12-20 10:21:42 -06:00
PREFIX ?= ~/bin
2023-03-02 23:01:44 -06:00
2023-01-22 14:40:13 -06:00
lint: ## run pre-commit hooks
pdm run pre-commit run --all || pdm run pre-commit run --all
2023-03-02 23:01:44 -06:00
2023-01-22 14:40:13 -06:00
types: ## run mypy
2023-08-08 09:02:49 -05:00
pdm run mypy src/viv
2022-12-19 23:11:12 -06:00
2023-05-29 12:51:55 -05:00
bump: ## update version and tag commit
2022-12-19 23:11:12 -06:00
@echo "bumping to version => $(VERSION)"
2022-12-20 14:38:17 -06:00
@sed -i 's/__version__ = ".*"/__version__ = "$(VERSION)"/g' src/viv/viv.py
2023-05-28 17:39:33 -05:00
@git add src/viv/viv.py && git commit -m "chore: bump version" --no-verify
2022-12-20 14:38:17 -06:00
@git tag v$(VERSION)
2023-05-28 17:39:33 -05:00
@git tag -d latest || true
@git tag latest
2023-03-02 23:01:44 -06:00
venv: ## generate environment
pdm install
2022-12-19 23:11:12 -06:00
2023-08-21 10:01:09 -05:00
assets/viv-help.svg:
FORCE_COLOR=1 viv --help | yartsu -t 'viv --help' -w 70 -o $@
.PHONY: dev-install
dev-install:
ln -sf $(PWD)/src/viv/viv.py ~/.local/share/viv/viv.py
2023-06-01 00:04:02 -05:00
docs: docs/index.md docs/viv.py ## build docs
2023-08-08 09:02:49 -05:00
pdm run mkdocs build
2023-06-01 00:04:02 -05:00
2023-08-10 11:08:26 -05:00
svgs: ## build svgs for docs
pdm run python ./scripts/generate-svgs.py
2023-06-01 00:04:02 -05:00
docs/viv.py: src/viv/viv.py
cp $< $@
docs/index.md: README.md
2023-08-21 15:16:18 -05:00
printf -- '---\nhide: [navigation]\n---\n\n' > $@
cat $< >> $@
2023-06-01 00:04:02 -05:00
examples/black: .FORCE
rm -f $@
2023-06-02 17:10:28 -05:00
viv shim black -y -s -f -o $@
2023-03-07 13:00:48 -06:00
clean: ## remove build artifacts
rm -rf {build,dist}
EXAMPLES = cli.py sys_path.py exe_specific.py frozen_import.py named_env.py scrape.py
2023-01-22 14:40:13 -06:00
generate-example-vivens: ##
for f in $(EXAMPLES); \
do python examples/$$f; done
.FORCE:
.PHONY: .FORCE
2023-02-13 13:50:51 -06:00
-include .task.cfg.mk