-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 1.28 KB
/
Makefile
File metadata and controls
80 lines (64 loc) · 1.28 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
80
#!/usr/bin/env make
# External commands
CTAGS ?= ctags
FIND ?= find
PYTHON ?= python3
RM ?= rm -f
RM_R ?= rm -fr
SH ?= sh
TOX ?= tox
BLACK ?= black
# Options
flags ?=
TESTCMD ?= $(PYTHON) -m pytest $(flags)
TOXCMD ?= $(TOX) --develop --skip-missing-interpreters
ifdef V
TESTCMD += --verbose
TOXCMD += --verbose
endif
INSTALL_ARGS =
ifndef mac_pkg
ifdef prefix
INSTALL_ARGS += --prefix=$(prefix)
endif
endif
ifdef DESTDIR
INSTALL_ARGS += --root=$(DESTDIR)
endif
# Data
ARTIFACTS := build
ARTIFACTS += dist
ARTIFACTS += tags
ARTIFACTS += *.egg-info
all:: help
help:
@echo "================"
@echo "Makefile Targets"
@echo "================"
@echo "make help - print this message"
@echo "make test - run unit tests"
@echo "make tox - run unit tests using multiple pythons via tox"
@echo "make check - run style / lint checks"
@echo "make clean - remove cruft"
@echo "make install - install modules"
.PHONY: help
check:
$(TOXCMD) -v -e flake8 $(flags)
$(BLACK) --check .
.PHONY: check
clean:
$(RM) *.py[cod]
$(RM_R) __pycache__
$(RM_R) $(ARTIFACTS)
.PHONY: clean
install:
$(PYTHON) setup.py install $(INSTALL_ARGS)
.PHONY: install
tags:
$(CTAGS) -f tags *.py
test:
$(TESTCMD) tests/psycopg2_test.py
.PHONY: test
tox:
$(TOXCMD) $(flags)
.PHONY: tox