-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
57 lines (42 loc) · 959 Bytes
/
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
#
# == Paths & Directories ==
#
VENV_DIR := .virtualenv
PYTHON3 := $(shell command -v python3 2> /dev/null)
PYTHON_REQUIREMENTS := requirements.txt
PYTHON_FROZEN_REQUIREMENTS := requirements.frozen.txt
#
# == Configuration ==
#
UNAME := $(shell uname)
#
# == Commands ==
#
PIP := $(VENV_DIR)/bin/pip
PYTEST := $(VENV_DIR)/bin/pytest
FLAKE8 := $(VENV_DIR)/bin/flake8
MYPY := $(VENV_DIR)/bin/mypy
#
# == Targets ==
#
default: dependencies
freeze:
$(PIP) freeze > $(PYTHON_FROZEN_REQUIREMENTS)
dependencies: $(VENV_DIR)
$(PIP) install wheel
ifdef UNFREEZE
$(PIP) install -r $(PYTHON_REQUIREMENTS)
else
$(PIP) install -r $(PYTHON_FROZEN_REQUIREMENTS)
endif
$(VENV_DIR):
$(PYTHON3) -m venv --prompt='hashwars' $(VENV_DIR)
lint:
-$(FLAKE8) hashwars
-$(MYPY) hashwars/
clean:
find hashwars test -name '*.pyc' -delete
find hashwars test -name '__pycache__' -delete
test:
$(PYTEST)
.PHONY: test