-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (52 loc) · 2.01 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
PYTHON = python3.9
PIP = pip3.9
GIT = git
TWEEPY_HASH = 1a5ba74
# .PHONY defines parts of the makefile that are not dependant on any specific file
# This is most often used to store functions
.PHONY = help requirements dev-requirements requirements-conda dev-requirements-conda test test-twitter test-reddit test-graph test-score test-tweepy test-model run # clean
# Defines the default target that `make` will to try to make, or in the case of a phony target, execute the specified commands
# This target is executed whenever we just type `make`
.DEFAULT_GOAL = help
# The @ makes sure that the command itself isn't echoed in the terminal
help:
@echo "---------------HELP-----------------"
@echo "To install dependencies type make requirements"
@echo "To install dev dependencies type make dev-requirements"
@echo "To test the project type make test"
@echo "To run the project type make run"
@echo "------------------------------------"
requirements:
${PIP} install -r requirements.txt
# install custom tweepy version
${GIT} clone https://github.com/tweepy/tweepy || true
cd tweepy && ${GIT} checkout 1a5ba74 && ${PIP} install .
dev-requirements: requirements
${PIP} install pytest
requirements-conda:
conda install -y -c conda-forge --file requirements.txt
# install custom tweepy version
${GIT} clone https://github.com/tweepy/tweepy || true
cd tweepy && ${GIT} checkout 1a5ba74 && ${PYTHON} setup.py install
dev-requirements-conda: requirements-conda
conda install -y -c conda-forge pytest
test:
${PYTHON} -m pytest
test-twitter:
${PYTHON} -m pytest tests/test_twitter_collector.py
test-reddit:
${PYTHON} -m pytest tests/test_reddit_collector.py
test-graph:
${PYTHON} -m pytest tests/test_graph.py
test-tweepy:
${PYTHON} -m pytest tests/test_tweepy.py
test-score:
${PYTHON} -m pytest tests/test_score.py
test-model:
PYTHONPATH=`pwd`
${PYTHON} tests/test_synthetic.py
run:
${PYTHON} main.py
# In this context, the *.project pattern means "anything that has the .project extension"
# clean:
# rm -r *.project