-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (57 loc) · 1.78 KB
/
Makefile
File metadata and controls
79 lines (57 loc) · 1.78 KB
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
all : tests format lint
.PHONY : app
app :
@echo "Running app..."
python web/app.py
##########################################################################################################################
# Testing & Quality
##########################################################################################################################
.PHONY: tests
tests : export PYTHONPATH = .
tests :
@echo "Running all tests..."
pytest -v tests/
.PHONY: unit-tests
unit-tests : export PYTHONPATH = .
unit-tests :
@echo "Running unit tests..."
pytest -v tests/unit_tests/
.PHONY: functional-tests
functional-tests : export PYTHONPATH = .
functional-tests :
@echo "Running functional tests..."
pytest -v tests/functionnal_tests/
.PHONY: coverage
coverage : export PYTHONPATH = .
coverage :
mkdir -p tests_result
pytest -v --cov=src --cov=web --cov-config=.coveragerc \
--cov-report=term-missing \
--cov-report=xml:tests_result/coverage.xml \
--cov-report=html:tests_result/htmlcov \
--junitxml=tests_result/junit.xml \
tests/
.PHONY: lint
lint :
@echo "Running lint..."
pylint --rcfile=.pylintrc src
.PHONY : format
format :
@echo "Running format..."
black .
########################################################################################################################
# Setup the virtual environment
########################################################################################################################
.PHONY : setup
activate :
@if ! pyenv virtualenvs | grep -q minesweeper; then \
echo "Creating virtualenv..."; \
pyenv virtualenv minesweeper; \
else \
echo "Virtualenv already exists"; \
fi
pyenv local minesweeper
install : activate
@echo "Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt