forked from CleanCut/green
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (39 loc) · 1.66 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
VERSION=$(shell cat green/VERSION)
clean:
@echo "Cleaning generated files and directories."
@find . -name '*.pyc' -exec rm \{\} \;
@rm -rf .coverage _trial_temp build dist green.egg-info
test: clean
@echo "\n== CHECKING PYTHON 2.7 (SINGLE) =="
./g 2.7 -r -s 1 green
@echo "\n== CHECKING PYTHON 2.7 (MULTI) =="
./g 2.7 -r -s 0 green
@echo "\n== CHECKING PYTHON 3.4 (SINGLE) =="
./g 3.4 -r -s 1 green
@echo "\n== CHECKING PYTHON 3.4 (MULTI) =="
./g 3.4 -r -s 1 green
testinstalled: clean
python setup.py sdist
ls -lR
tar zxvf dist/green-$(VERSION).tar.gz
bash -c "cd green-$(VERSION) && python setup.py install"
bash -c "cd && green -vvv green"
bash -c "cd && green -s 0 -vvv green"
sanity-checks:
@if git show-ref --verify --quiet refs/tags/$(VERSION) ; then printf "\nVersion $(VERSION) has already been tagged.\nIf the make process died after tagging, but before actually releasing, you can try 'make release-unsafe'\n\n" ; exit 1 ; fi
@if [[ $(shell git rev-parse --abbrev-ref HEAD) != "master" ]] ; then echo "\nYou need to be on the master branch to release.\n" && exit 1 ; fi
@printf "\n== SANITY CHECK: GIT STATUS ==\n"
@git status
@printf "\nIs everything committed? (Ctrl-C if not!) "
@read
release-test: test sanity-checks
@echo "\n== CHECKING PyPi-Test =="
python3 setup.py sdist upload -r pypi-test
if [ "`git diff MANIFEST`" != "" ] ; then git add MANIFEST && git commit -m "Added the updated MANIFEST file." ; fi
release-tag:
git tag $(VERSION) -m "Tagging a release version"
git push --tags origin HEAD
release-unsafe:
@echo "\n== Releasing Version $(VERSION) =="
python3 setup.py sdist upload -r pypi
release: release-test release-tag release-unsafe