-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
172 lines (132 loc) · 3.48 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
##############################################################
#
# Quantarhei package Makefile
#
# This file defines several tasks useful to Quantarhei
# developers
#
##############################################################
#
# Set this to required version or override from command line
# Default is the current development version
#
VERSION=0.0.67
TASK=
ANACONDA_BIN=anaconda3/bin
PIP=pip #${HOME}/${ANACONDA_BIN}/pip
PYTHON=python3 #${HOME}/${ANACONDA_BIN}/python
ACTIVATE=activate
REPOSITORY=https://github.com/tmancal74/quantarhei
all:
###########################
# Quantarhei installation # PAVER
###########################
install: inst
# PAVER
inst: sdist
${PYTHON} -m ${PIP} install `ls dist/quantarhei-${VERSION}*`
################
# Distribution # PAVER
################
sdist:
${PYTHON} setup.py sdist
##################
# Uninstallation #
##################
uninstall: uninst
uninst:
${PYTHON} -m ${PIP} uninstall -y quantarhei
##################
# Upload to pypi #
##################
upload: sdist
twine upload `ls dist/quantarhei-${VERSION}*`
############
# Clean-up #
############
clean:
rm -rf dist
rm -rf quantarhei.egg-info
rm -rf result_images
rm -rf qrconf.py quantarhei/qrconf.py
rm -rf coverage.xml
rm -rf env
rm -rf coverage
rm -rf htmlcov
################################
# Reinstallation with clean-up #
################################
reinst: clean uninst inst
#############################################################
# Local tests: this will reinstall Quantarhei and run tests #
#############################################################
local_tests: reinst
paver ${TASK}
####################################################
# Create a virtual environment for package testing #
####################################################
env:
( \
rm -rf env/; \
${PYTHON} -m venv env; \
${ACTIVATE}; \
${PYTHON} -m ${PIP} install --no-cache -r requirements.txt; \
${PYTHON} -m ${PIP} install --no-cache -r requirements_devel.txt; \
)
#############################################
# Test of the install version of quantarhei #
#############################################
test:
paver
testenv:
( \
${ACTIVATE} \
paver; \
)
####################
# Test of plotting #
####################
plot_tests:
paver matplotlib_tests
####################
# Update examples #
####################
update_examples:
cd examples; python admin/make_demos.py
pylint:
paver pylint
help:
@echo ""
@echo "Quantarhei Makefile Help"
@echo "========================"
@echo ""
@echo "Essential tasks: "
@echo "----------------"
@echo "inst ... install quantarhei from this source code"
@echo "reinst ... uninstall and install from this source code"
@echo "local_tests ... uninstall, install and run tests"
@echo "plot_tests ... run tests of plotting"
@echo "test ... run tests"
@echo "sdist ... create distribution"
@echo "clean ... clean the repository"
@echo "examples ... updates examples"
@echo ""
@echo "Git tasks: "
@echo "----------"
@echo "git_add_upstream, git_update_master"
@echo ""
############################################
# Helper tasks for managing pull-requests
############################################
#
# update from master branch of the quantarhei's main repository
#
git_update_master:
git fetch upstream
git checkout master
git merge upstream/master
#
# connect a forked local repository to the main quantarhei repository
#
git_add_upstream:
git remote add upstream ${REPOSITORY}