forked from markokr/rarfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (53 loc) · 1.55 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
prefix = /usr/local
REPO = https://github.com/markokr/rarfile
NEWS = doc/news.rst
PACKAGE = $(shell python3 setup.py --name)
VERSION = $(shell python3 setup.py --version)
RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g')
TAG = v$(VERSION)
TGZ = dist/$(PACKAGE)-$(VERSION).tar.gz
URL = $(REPO)/releases/download/v$(VERSION)/$(PACKAGE)-$(VERSION).tar.gz
all:
pyflakes3 rarfile.py
tox -e lint
tox -e py38-cryptography -- -n auto
install:
python setup.py install --prefix=$(prefix)
clean:
rm -rf __pycache__ build dist .tox
rm -f *.pyc MANIFEST *.orig *.rej *.html *.class test/*.pyc
rm -rf doc/_build doc/_static doc/_templates doc/html
rm -rf .coverage cover*
rm -rf *.egg-info
rm -f test/files/*.rar.[pjt]* *.diffs
toxclean: clean
rm -rf .tox
ack:
for fn in test/files/*.py38-cryptography; do \
cp $$fn `echo $$fn | sed 's/[.]py.*/.exp/'` || exit 1; \
done
prepare:
@echo "Checking version - $(VERSION)"
@grep -qE '^\w+ $(RXVERSION)\b' $(NEWS) \
|| { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; }
@echo "Checking git repo"
@git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; }
release: prepare
git tag $(TAG)
git push github $(TAG):$(TAG)
upload:
mkdir -p dist && rm -f dist/*
cd dist && wget -q $(URL)
tar tvf $(TGZ)
twine upload $(TGZ)
shownote:
awk -v VER="$(VERSION)" -f doc/note.awk $(NEWS) \
| pandoc -f rst -t gfm --wrap=none
unrelease:
git push github :$(TAG)
git tag -d $(TAG)
dist-test:
python3 setup.py sdist
rm -rf $(PACKAGE)-$(VERSION)
tar xf $(TGZ)
cd $(PACKAGE)-$(VERSION) && tox