-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
72 lines (52 loc) · 1.62 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.DEFAULT_GOAL := help
NAME = weblogo
FILES = $(NAME) tests docs/conf.py setup.py
USER = -i ~/.ssh/aws_kaiju.pem ec2-user
HOST = weblogo.threeplusone.com
DIR = /home/ec2-user/weblogo
# Kudos: Adapted from Auto-documenting default target
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}'
.PHONY: test
test: ## Run unittests
python -m pytest --disable-pytest-warnings
.PHONY: coverage
coverage: ## Report test coverage
@echo
python -m pytest --disable-pytest-warnings --cov-report term-missing --cov $(NAME)
@echo
.PHONY: lint
lint: ## Lint check python source
@python -m ruff check
.PHONY: delint
delint:
@echo
python -m ruff format
.PHONY: typecheck
typecheck: ## Static typechecking
python -m mypy $(NAME)
.PHONY: docs
docs: ## Build documentation
(cd docs; make html)
.PHONY: docs-open
docs-open: ## Build documentation and open in webbrowser
(cd docs; make html)
open docs/_build/html/index.html
.PHONY: examples
examples: ## Build examples
cd weblogo/htdocs/examples && ./build_examples.sh
.PHONY: login
login: ## ssh into remote server
ssh ${USER}@${HOST}
.PHONY: sync
sync: ## Sync remote server
ssh ${USER}@${HOST} 'cd weblogo && git pull'
.PHONY: reinstall
reinstall: ## Reinstall weblogo on remote server
# pip install needed to update versions with latest git tag
ssh ${USER}@${HOST} 'cd weblogo && sudo pip3 install -e .'
.PHONY: restart
restart: ## Restart remote server
ssh ${USER}@${HOST} 'sudo systemctl restart httpd.service'