-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.02 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
PYTHON = python3
VENV = .venv
ACTIVATE = . ./${VENV}/bin/activate
TARGET = testpypi
.PHONY: usage
usage:
@echo 'Usage: ${MAKE} TARGET'
@echo ''
@echo 'Targets:'
@echo ' init init directory for develop'
@echo ' test run test script'
@echo ' build build wheel package'
@echo ' upload upload ${TARGET}'
@echo ' TARGET=pypi'
@echo ' clean remove cache file'
.PHONY: init
init:
${MAKE} ${VENV}
${VENV}:
${PYTHON} -m venv ${VENV}
${ACTIVATE} && pip install --upgrade pip setuptools wheel
${ACTIVATE} && pip install -r requirements.txt
.PHONY: test
test: ${VENV}
${ACTIVATE} && ./test.sh
.PHONY: build
build:
rm -rf dist build *.egg-info
${MAKE} init
${ACTIVATE} && python setup.py bdist_wheel sdist --format=gztar,zip
${ACTIVATE} && twine check dist/*
.PHONY: upload
upload:
${MAKE} build
${ACTIVATE} && twine upload --repository ${TARGET} dist/*.tar.gz dist/*.whl dist/*.zip
.PHONY: clean
clean:
rm -rf ${VENV}
rm -f log output.csv
rm -rf build dist akerun_sum.egg-info