-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
94 lines (73 loc) · 1.79 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
85
86
87
88
89
90
91
92
93
94
# Makefile for amitools
BUILD_DIR = build
DIST_DIR = dist
PYTHON ?= python3
PIP ?= $(PYTHON) -m pip
SHOW_CMD = open
#PYTHON = python-dbg
.PHONY: help init build test docker-tox docs show
.PHONY: clean clean_all clean_git clean_py
.PHONY: init sdist bdist upload
help:
@echo "init initialize project"
@echo "build build native extension"
@echo
@echo "format format source code with black"
@echo
@echo "test run tests"
@echo "docker-build build tox docker container"
@echo
@echo "docs generate docs"
@echo "show show docs in browser"
@echo
@echo "clean clean build"
@echo "clean_all clean dist"
@echo "clean_git clean non-git files"
@echo "clean_py remove compiled .pyc files"
@echo "clean_ext remove native extension build"
@echo
@echo "install install package"
@echo "sdist build source dist"
@echo "bdist build bin dist wheel"
@echo "upload upload sdist with twine to pypi"
init:
$(PIP) install --upgrade setuptools pip
$(PIP) install --upgrade -r requirements-dev.txt
$(PIP) install --upgrade -r requirements-test.txt
$(PIP) install --upgrade --editable .
build:
$(PYTHON) setup.py build_ext -i
format:
black .
# testing
test:
./local-tox
# doc
docs:
[ -d build/docs/html ] || mkdir -p build/docs/html
sphinx-build -b html docs build/docs/html
show:
$(SHOW_CMD) build/docs/html/index.html
# clean
clean:
rm -rf $(BUILD_DIR)
clean_all: clean clean_ext
rm -rf $(DIST_DIR)
clean_git:
git clean -fxd
clean_py:
find . -name *.pyc -exec rm {} \;
clean_ext:
$(PYTHON) setup.py clean
# install, distrib
install:
$(PIP) install --upgrade --editable .
sdist:
$(PYTHON) -m build -s
bdist:
$(PYTHON) -m build -w
upload: sdist
twine upload dist/*
# container
docker-build:
docker build -t amitools-tox .