This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
68 lines (58 loc) · 1.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
CD=cd
FIND=find
DEL=rm
TAR=tar
PYTHON=python
PIP=pip
COVERAGE=coverage
COVERALLS=coveralls
PYLINT=pylint
SPHINX=sphinx-build
MODULE_DIR=reputation
DOC_DIR=doc/build
OUT_DIR=ip-reputation-monitoring
DIST_NAME=$(OUT_DIR).tgz
clean: clean-doc
if [[ `$(FIND) . -name *.pyc` ]] ; \
then \
$(FIND) . -name *.pyc | xargs $(DEL) ; \
fi;
$(DEL) -f $(DIST_NAME)
clean-doc:
$(DEL) -rf $(DOC_DIR)
install-deps:
$(PIP) install -r requirements.txt
install-dev-deps:
$(PIP) install -r requirements/dev.txt
test:
cd $(MODULE_DIR) && \
$(COVERAGE) > /dev/null 2>&1 && \
$(COVERAGE) run --source='.' -m unittest discover && \
$(COVERAGE) report \
|| \
$(PYTHON) -m unittest discover
coveralls:
$(COVERAGE) erase && \
cd $(MODULE_DIR) && \
$(COVERAGE) > /dev/null 2>&1 && \
$(COVERAGE) run --source='.' -m unittest discover && \
$(COVERALLS)
lint:
cd $(MODULE_DIR) && \
$(PYLINT) --disable=W0141 --max-line-length=150 adapters/ api/ archive/ config/ default/ factory/ main.py mongo/ parsing/ reporting/ run_api.py tests/ spamhaus_monitor.py tools/ utils/
doc: clean-doc
$(SPHINX) -b html doc/source doc/build
dist: clean doc
$(DEL) -f reputation/.coverage $(DIST_NAME)
$(TAR) --transform 's/^\./$(OUT_DIR)/' -cvzf $(DIST_NAME) \
./reputation/ \
./doc/build/ \
./requirements/ \
./Makefile \
./README.md \
./LICENSE \
./CONTRIBUTING.md \
./CHANGELOG.md \
./requirements.txt \
./setup.py \
./*.sh