-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
52 lines (43 loc) · 1.07 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
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
MODULE_NAME := $(notdir $(patsubst %/,%,$(ROOT_DIR)))
SHELL := /bin/bash
all:
@echo 'Available make targets:'
@grep '^[^#[:space:]].*:' Makefile
install:
# Installs as egg
python setup.py install
# Installs via pip
pip install .
build:
python setup.py build
python-venv: venv
venv:
$(shell [ -d venv ] || python3 -m venv venv)
echo "# Run this in your shell to activate:"
echo "source venv/bin/activate"
.install-test:
pip install .[test]
touch $@
watch-test:
# Watches for changes and re-test automatically
# we use this wrapper because our test target allows for more tests
# than ptw's builting pytest, notably flake8 tests
ptw --runner "make test"
test: tests
tests: .install-test
PATH=$(PATH):$(shell npm bin) \
python setup.py test
flake8 setup.py
flake8 tests/*.py
flake8 $(MODULE_NAME)/*.py
clean:
rm -rf venv
rm -rf __pycache__
rm -rf *.egg-info
rm -rf .eggs
rm -rf build
rm -rf dist
rm -rf .install-test
rm -rf node_modules
.PHONY: test tests clean all install