forked from cloudflare/python-cloudflare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (54 loc) · 1.54 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
PYTHON = python
PANDOC = pandoc
PYLINT = pylint
EMAIL = "[email protected]"
NAME = "cloudflare"
all: README.rst CHANGELOG.md build
README.rst: README.md
$(PANDOC) --from=markdown --to=rst < README.md > README.rst
CHANGELOG.md: FORCE
@ tmp=/tmp/_$$$$.md ; \
( \
cp /dev/null $$tmp ; \
echo '# Change Log' ; \
echo '' ; \
git log --date=iso-local --pretty=format:' - %ci [%h](https://github.com/cloudflare/python-cloudflare/commit/%H) %s' ; \
echo '' ; \
) >> $$tmp ; \
diff $$tmp CHANGELOG.md || ( cp $$tmp CHANGELOG.md ; echo "CHANGELOG.md - updated" ) ; \
rm $$tmp
FORCE:
build: setup.py
$(PYTHON) setup.py -q build
install: build
sudo $(PYTHON) setup.py -q install
sudo rm -rf ${NAME}.egg-info
test: all
# to be done
sdist: all
make clean
make test
$(PYTHON) setup.py -q sdist
@rm -rf ${NAME}.egg-info
bdist: all
make clean
make test
$(PYTHON) setup.py -q bdist
@rm -rf ${NAME}.egg-info
upload: clean all tag upload-pypi upload-github
upload-pypi:
$(PYTHON) setup.py -q sdist upload --sign --identity="$(EMAIL)"
upload-github:
git push origin --tags
showtag: sdist
@ v=`ls -r dist | head -1 | sed -e 's/cloudflare-\([0-9.]*\)\.tar.*/\1/'` ; echo "\tDIST VERSION =" $$v ; (git tag | fgrep -q "$$v") && echo "\tGIT TAG EXISTS"
tag: sdist
@ v=`ls -r dist | head -1 | sed -e 's/cloudflare-\([0-9.]*\)\.tar.*/\1/'` ; echo "\tDIST VERSION =" $$v ; (git tag | fgrep -q "$$v") || git tag "$$v"
lint:
$(PYLINT) CloudFlare cli4
clean:
rm -rf build
rm -rf dist
mkdir build dist
$(PYTHON) setup.py -q clean
rm -rf ${NAME}.egg-info