-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
43 lines (36 loc) · 1.26 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# https://madewithml.com/courses/mlops/makefile
SHELL = /usr/bin/env bash
VERSION = $(shell python -c "import ipyoverlay as ui; print(ui.__version__)")
.PHONY: help
help: ## display all the make commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: pre-commit
pre-commit: ## run all of the pre-commit checks.
@pre-commit run --all-files
.PHONY: publish
publish: ## build the package and push to pypi
@python -m build
@twine check dist/*
@twine upload dist/* --skip-existing
.PHONY: apply-docs
apply-docs: ## copy current built sphinx documentation into version-specific docs/folder
-@unlink docs/stable
@echo "Copying documentation to docs/$(VERSION)"
-@rm -rf docs/$(VERSION)
@cp -r sphinx/build/html docs/$(VERSION)
@echo "Linking to docs/stable"
@ln -s $(VERSION)/ docs/stable
.PHONY: style
style: ## run autofixers and linters
black .
flake8
isort .
.PHONY: clean
clean: ## remove auto-generated cruft files
find . -type f -name "*.DS_Store" -ls -delete
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
find . | grep -E ".pytest_cache" | xargs rm -rf
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
.PHONY: test
test: ## run unit tests
pytest