-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (49 loc) · 1.81 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
# ----------------------------------
# INSTALL & TEST
# ----------------------------------
install:
@pip install -e . -q
@mv -f ./flatfindr/logins-template.py ./flatfindr/logins.py
@echo 'flatfindr successfully installed'
test:
@coverage run -m pytest tests/*.py
@coverage report -m --omit="${VIRTUAL_ENV}/lib/python*"
@rm -f raw_data/test_db.json
clean:
@rm -f */version.txt
@rm -f .coverage
@rm -fr */__pycache__ */*.pyc __pycache__
@rm -fr build dist
@rm -fr flatfindr-*.dist-info
@rm -fr flatfindr.egg-info
UNAME := $(shell uname)
logins:
@read -p "What is your facebook id (email or phone number) ? " ID \
&& read -p "What is your facebook password ? " PWD \
&& if [ "$(UNAME)" = "Darwin" ]; then sed -i '' -e "s/<ID>/$${ID}/g" -e "s/<PWD>/$${PWD}/g" ./flatfindr/logins.py \
; else sed -i -e "s/<ID>/$${ID}/g" -e "s/<PWD>/$${PWD}/g" ./flatfindr/logins.py; fi
token:
@read -p "What is your bot Access Token ? " TOKEN \
&& if [ "$(UNAME)" = "Darwin" ]; then sed -i '' -e "s/<TOKEN>/$${TOKEN}/g" ./flatfindr/logins.py \
; else sed -i -e "s/<TOKEN>/$${TOKEN}/g" ./flatfindr/logins.py; fi
all: clean install test
count_lines:
@find ./ -name '*.py' -exec wc -l {} \; | sort -n| awk \
'{printf "%4s %s\n", $$1, $$2}{s+=$$0}END{print s}'
@echo ''
@find ./scripts -name '*-*' -exec wc -l {} \; | sort -n| awk \
'{printf "%4s %s\n", $$1, $$2}{s+=$$0}END{print s}'
@echo ''
@find ./tests -name '*.py' -exec wc -l {} \; | sort -n| awk \
'{printf "%4s %s\n", $$1, $$2}{s+=$$0}END{print s}'
@echo ''
# ----------------------------------
# UPLOAD PACKAGE TO PYPI
# ----------------------------------
PYPI_USERNAME=<AUTHOR>
build:
@python setup.py sdist bdist_wheel
pypi_test:
@twine upload -r testpypi dist/* -u $(PYPI_USERNAME)
pypi:
@twine upload dist/* -u $(PYPI_USERNAME)