| 1 |
|
| 2 |
.DEFAULT_GOAL := help |
| 3 |
|
| 4 |
NAME = weblogo |
| 5 |
FILES = $(NAME) tests docs/conf.py setup.py |
| 6 |
|
| 7 |
USER = -i ~/.ssh/aws_kaiju.pem ec2-user |
| 8 |
HOST = weblogo.threeplusone.com |
| 9 |
DIR = /home/ec2-user/weblogo |
| 10 |
|
| 11 |
|
| 12 |
# Kudos: Adapted from Auto-documenting default target |
| 13 |
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html |
| 14 |
.PHONY: help |
| 15 |
help: |
| 16 |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}' |
| 17 |
|
| 18 |
|
| 19 |
.PHONY: test |
| 20 |
test: ## Run unittests |
| 21 |
python -m pytest --disable-pytest-warnings |
| 22 |
|
| 23 |
.PHONY: coverage |
| 24 |
coverage: ## Report test coverage |
| 25 |
@echo |
| 26 |
python -m pytest --disable-pytest-warnings --cov-report term-missing --cov $(NAME) |
| 27 |
@echo |
| 28 |
|
| 29 |
.PHONY: lint |
| 30 |
lint: ## Lint check python source |
| 31 |
@python -m ruff check |
| 32 |
|
| 33 |
.PHONY: delint |
| 34 |
delint: |
| 35 |
@echo |
| 36 |
python -m ruff format |
| 37 |
|
| 38 |
.PHONY: typecheck |
| 39 |
typecheck: ## Static typechecking |
| 40 |
python -m mypy $(NAME) |
| 41 |
|
| 42 |
.PHONY: docs |
| 43 |
docs: ## Build documentation |
| 44 |
(cd docs; make html) |
| 45 |
|
| 46 |
.PHONY: docs-open |
| 47 |
docs-open: ## Build documentation and open in webbrowser |
| 48 |
(cd docs; make html) |
| 49 |
open docs/_build/html/index.html |
| 50 |
|
| 51 |
.PHONY: examples |
| 52 |
examples: ## Build examples |
| 53 |
cd weblogo/htdocs/examples && ./build_examples.sh |
| 54 |
|
| 55 |
.PHONY: login |
| 56 |
login: ## ssh into remote server |
| 57 |
ssh ${USER}@${HOST} |
| 58 |
|
| 59 |
.PHONY: sync |
| 60 |
sync: ## Sync remote server |
| 61 |
ssh ${USER}@${HOST} 'cd weblogo && git pull' |
| 62 |
|
| 63 |
.PHONY: reinstall |
| 64 |
reinstall: ## Reinstall weblogo on remote server |
| 65 |
# pip install needed to update versions with latest git tag |
| 66 |
ssh ${USER}@${HOST} 'cd weblogo && sudo pip3 install -e .' |
| 67 |
|
| 68 |
.PHONY: restart |
| 69 |
restart: ## Restart remote server |
| 70 |
ssh ${USER}@${HOST} 'sudo systemctl restart httpd.service' |
| 71 |
|
| 72 |
|