-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
84 lines (59 loc) · 1.75 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.DEFAULT_GOAL := all
NAME=$(shell basename `pwd`)
DOCS_DIR="docs"
help: ## Display help and quit
@echo Makefile for the $(NAME) package.
@echo Available commands:
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m\
%s\n", $$1, $$2}'
all: install test ## Install the package and run tests
clean_build:
rm -rf build/
clean_dist:
rm -rf dist/
clean_eggs:
rm -rf *.egg-info
clean_mypy:
rm -rf .mypy_cache/
clean_docs:
rm -rf docs/build/*
clean_tests:
rm -rf /tmp/pytest*
clean: clean_dist clean_eggs clean_build clean_mypy clean_docs ## Remove build, mypy cache, tests and docs
_install:
# python setup.py sdist
# python -m pip wheel --no-index --no-deps --wheel-dir dist dist/*.tar.gz
# python -m pip install dist/*-py3-none-any.whl --user --upgrade
python -m pip install .
install: ## Install the package
${MAKE} clean
${MAKE} _install
${MAKE} clean
docs: ## Build the documentation
${MAKE} -C $(DOCS_DIR) html
xdg-open $(DOCS_DIR)/build/html/index.html
lint:
-flake8 --count --ignore E501,F401,F841,W503,E402,E203,E266,E722 --exclude tests/ imc/
test: lint ## Run the tests
python -m pytest -m "not slow" $(NAME)/
backup_time:
echo "Last backup: " `date` >> _backup_time
chmod 700 _backup_time
_sync:
rsync --copy-links --progress -r \
. [email protected]:projects/$(NAME)
sync: _sync backup_time ## [dev] Sync data/code to SCU server
build: test
python setup.py sdist bdist_wheel
pypitest: build
twine \
upload \
-r pypitest dist/*
pypi: build
twine \
upload \
dist/*
.PHONY : clean_build clean_dist clean_eggs clean_mypy clean_docs clean_tests \
clean _install install clean_docs docs test backup_time _sync sync \
build pypitest pypi