-
Notifications
You must be signed in to change notification settings - Fork 9
/
makefile
134 lines (104 loc) · 4.15 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
.PHONY:
VERSION=$(shell head -1 VERSION)
# _ _ ____
# | | | | _____ _____ _ __| _ \ _ _
# | |_| |/ _ \ \ / / _ \ '__| |_) | | | |
# | _ | (_) \ V / __/ | | __/| |_| |
# |_| |_|\___/ \_/ \___|_| |_| \__, |
# |___/
# Commands from most to least significant
all:
python setup.py build
# ┬─┐┌─┐┬ ┌─┐┌─┐┌─┐┌─┐ ┌─┐┌─┐┌┬┐┌─┐┬ ┬ ┌┬┐┌─┐┌─┐┌┬┐ ┬ ┬┌─┐┬─┐┌─┐┬┌─┐┌┐┌
# ├┬┘├┤ │ ├┤ ├─┤└─┐├┤ ├─┘├─┤ │ │ ├─┤ │ ├┤ └─┐ │ └┐┌┘├┤ ├┬┘└─┐││ ││││
# ┴└─└─┘┴─┘└─┘┴ ┴└─┘└─┘ ┴ ┴ ┴ ┴ └─┘┴ ┴ ┴ └─┘└─┘ ┴ └┘ └─┘┴└─└─┘┴└─┘┘└┘
release_test_patch: clean semver_patch tag commit push reg_and_upload_to_test_pypi clean
release_test: clean tag commit push reg_and_upload_to_test_pypi clean
release_patch: clean semver_patch tag commit push reg_and_upload_to_pypi clean
release_minor: clean semver_minor tag commit push reg_and_upload_to_pypi clean
release: clean tag commit push reg_and_upload_to_pypi clean
reg_and_upload_to_test_pypi: register_test upload_test
reg_and_upload_to_pypi: register upload
tag: do_tag push_tags
test_install_from_pip:
rm -rf /tmp/hover*
rm -rf /tmp/lib
cd /tmp/ && pip install --install-option="--prefix=/tmp/" -i https://testpypi.python.org/pypi hoverpy
cd /tmp/ && echo "import hoverpy;hoverpy.quick_test()" | PYTHONPATH=/tmp/lib/python2.7/site-packages python
rm -rf /tmp/hover*
rm -rf /tmp/lib
test_local_tmp_install_python_2:
rm -rf /tmp/hover*
rm -rf /tmp/lib
mkdir -p /tmp/lib/python2.7/site-packages/
cd /tmp/ && PYTHONPATH=/tmp/lib/python2.7/site-packages python setup.py install --prefix=/tmp
cd /tmp/ && echo "import hoverpy;hoverpy.quick_test()" | PYTHONPATH=/tmp/lib/python2.7/site-packages python
rm -rf /tmp/hover*
rm -rf /tmp/lib
test_local_tmp_install_python_3:
rm -rf /tmp/hover*
rm -rf /tmp/lib
mkdir -p /tmp/lib/python3/site-packages/
PYTHONPATH=/tmp/lib/python3/site-packages python3 setup.py install --prefix=/tmp
cd /tmp/ && echo "import hoverpy;hoverpy.quick_test()" | PYTHONPATH=/tmp/lib/python3/site-packages python
rm -rf /tmp/hover*
rm -rf /tmp/lib
test:
python setup.py test
python3.6 setup.py test
docs: .PHONY
cd docs; make html;
# cd docs/source/mermaid/intro; mermaid *;
### -------------------------------------------------------------------------------
## You'll need to save this into your ~/.pypirc if you'd like to push this to pypi
# [distutils]
# index-servers =
# pypi
# pypitest
# [pypi]
# repository=https://pypi.python.org/pypi
# username=
# password=
# [pypitest]
# repository=https://testpypi.python.org/pypi
# username=
# password=
### ------------------------------------
### ------------------------------------
## Probably nothing interesting below
register_test:
python setup.py register -r pypitest
register:
python setup.py register -r pypi
upload_test:
python setup.py sdist upload -r pypitest
upload:
python setup.py sdist upload -r pypi
do_tag:
git tag $(VERSION) -m "Adds a tag so that we can put this on PyPI."
push_tags:
git push --tags origin
commit:
git add .
git commit -am "updated"
push:
git push
semver_patch:
semver `head -1 VERSION` -i patch > VERSION
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ setup.py
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ hoverpy/config.py
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ docs/conf.py
rm -f `find . -name '*.bak'`
semver_minor:
semver `head -1 VERSION` -i minor > VERSION
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ setup.py
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ hoverpy/config.py
sed -i .bak s/$(VERSION)/`head -1 VERSION`/ docs/conf.py
rm -f `find . -name '*.bak'`
clean:
rm -rf build dist hoverpy.egg-info /tmp/hover* /tmp/lib .eggs hoverpy/__pycache__
rm -f `find . -name "hoverfly.log"`
rm -f `find . -name "middleware.log"`
rm -f `find . -name "*.pyc"`
rm -rf `find . -name '__pycache__'`
cd docs; make clean