-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile
83 lines (63 loc) · 1.76 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
VERSION=`ls dist/*.tar.gz | sed "s/dist\/CDM-\(.*\)\.tar\.gz/\1/g"`
ifdef ENVPIP
PIP = $(ENVPIP)
else
PIP = pip3
endif
ifdef ENVPYTHON
PYTHON = $(ENVPYTHON)
else
PYTHON = python3
endif
ifdef ENVPYTEST
PYTEST = $(ENVPYTEST)
else
PYTEST = pytest
endif
help:
@echo "install install CDM"
@echo "test run test"
@echo "release publish to PyPI and release in github"
@echo "release_test publish to TestPyPI"
@echo "clean remove all build, test, coverage and Python artifacts"
@echo "clean-build remove build artifacts"
@echo "clean-pyc remove Python file artifacts"
@echo "clean-test remove test and coverage artifacts"
.PHONY: install, test, build, release, release_test, version, .test, .build, clean
install:
@echo "install CDM"
$(PIP) install -e . --user
test:
@echo "run test"
$(PYTEST)
build: test, clean
$(PYTHON) setup.py bdist_wheel sdist
.test:
$(PYTEST) > /dev/null
.build: clean
$(PYTHON) setup.py bdist_wheel sdist > /dev/null
version: .build
@echo $(VERSION)
release: test, build
@echo "publish to pypi and release in github"
@echo "version $(VERSION)"
-@twine upload dist/* && git tag "v$(VERSION)"
git push && git push --tags
release_test: test, build
@echo "publish to test pypi"
@echo "version $(VERSION)"
-@twine upload --repository test dist/*
clean: clean-build clean-pyc clean-test
clean-build:
rm -rf build/*
rm -rf dist/*
rm -rf .eggs/*
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
clean-test:
rm -f .coverage