forked from legacy-roboime/pyroboime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (49 loc) · 1.38 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
# Some useful common actions
#
# Settings
# --------
PROJECT := pyroboime
# virtualenv config
VIRTUALENV := .virtualenv
# flake8 config
FLAKE8_EXCLUDES := \*_pb2.py
FLAKE8_OPTS := --exclude=$(FLAKE8_EXCLUDES) --ignore=E501 --format=pylint --statistics
FLAKE8_STRICT_OPTS := --exclude=$(FLAKE8_EXCLUDES) --format=pylint
# Targets
# -------
.PHONY: all
all: deps
# target to create the virtualenv, based on the presence
# of the activation script
.PHONY: virtualenv
VIRTUALENV_ACTIVATE := $(VIRTUALENV)/bin/activate
virtualenv: $(VIRTUALENV_ACTIVATE)
$(VIRTUALENV_ACTIVATE):
@which virtualenv || (echo "virtualenv not found" && exit 1)
@virtualenv --prompt=[$(PROJECT)] $(VIRTUALENV)
# install dependencies inside the virutalenv, naturally will
# require the virtualenv
.PHONY: deps
deps: virtualenv
@. $(VIRTUALENV_ACTIVATE) && $(MAKE) pip-deps
# install dependencies specified on requirements.txt taking
# into account vialink's pip repository
.PHONY: pip-deps
pip-deps:
@pip install -r requirements.txt
# wipe out the created virtualenv
.PHONY: clean
clean:
@rm -rf $(VIRTUALENV)
# check PEP8 compliancy without max column limit
.PHONY: pep8
pep8:
@flake8 $(FLAKE8_OPTS) roboime
# check PEP8 compliancy more strictly
.PHONY: pep8-strict
pep8-strict:
@flake8 $(FLAKE8_STRICT_OPTS) roboime
# count the number of lines
.PHONY: count
count:
@find roboime -type f -exec cat {} \; | wc -l