-
Notifications
You must be signed in to change notification settings - Fork 41
/
Makefile
42 lines (30 loc) · 1.11 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
# In this file all dunder methods are private.
# They are ignored by most of the autocomplete shell plugins, which is highly desirable.
# Cleaning before(!) build and upload will prevent any possible kind of localhost mess.
# About the rest will care .gitignore
clean:
rm -r ./dist || true;
rm -r ./build || true;
rm -r ./src/x11pygrid.egg-info || true;
__build: clean
python setup.py sdist bdist_wheel;
# It's not bulletproof, though should be enough.
__confirm:
echo -e "\n---------------------------------------" && \
echo -e "You are going to upload to the PRODUCTION!" && \
echo -e "Are you sure? [yes/N]" && \
read answer && \
if [ $${answer:-N} = "yes" ]; \
then \
echo "Confirmation accepted."; \
else \
echo "Action prevented!"; \
echo "You have to type complete word 'yes' to upload to the production!"; \
exit 1; \
fi;
# This one should stay without confirmation. It's just preventing bad habits.
upload_testing: __build
python -m twine upload --repository testpypi dist/* --verbose;
upload_production: __confirm __build
python -m twine upload --repository pypi dist/* --verbose;
.ONESHELL: