-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (45 loc) · 1.39 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
VIRTUAL_ENV ?= env
PACKAGE ?= http_router
all: $(VIRTUAL_ENV)
$(VIRTUAL_ENV): pyproject.toml
@[ -d $(VIRTUAL_ENV) ] || python -m venv env
@$(VIRTUAL_ENV)/bin/pip install -e .[tests,dev]
@$(VIRTUAL_ENV)/bin/pip install pre-commit
@$(VIRTUAL_ENV)/bin/pre-commit install --hook-type pre-push
@touch $(VIRTUAL_ENV)
VERSION ?= minor
.PHONY: version
version: $(VIRTUAL_ENV)
bump2version $(VERSION)
git checkout master
git pull
git merge develop
git checkout develop
git push origin develop master
git push --tags
.PHONY: minor
minor:
make version VERSION=minor
.PHONY: patch
patch:
make version VERSION=patch
.PHONY: major
major:
make version VERSION=major
.PHONY: clean
# target: clean - Display callable targets
clean:
rm -rf build/ dist/ docs/_build *.egg-info $(PACKAGE)/*.c $(PACKAGE)/*.so $(PACKAGE)/*.html
find $(CURDIR) -name "*.py[co]" -delete
find $(CURDIR) -name "*.orig" -delete
find $(CURDIR)/$(MODULE) -name "__pycache__" | xargs rm -rf
LATEST_BENCHMARK = $(shell ls -t .benchmarks/* | head -1 | head -c4)
test t: $(VIRTUAL_ENV)
$(VIRTUAL_ENV)/bin/pytest tests.py --benchmark-autosave --benchmark-compare=$(LATEST_BENCHMARK)
mypy: $(VIRTUAL_ENV)
$(VIRTUAL_ENV)/bin/mypy $(PACKAGE)
$(PACKAGE)/%.c: $(PACKAGE)/%.pyx $(PACKAGE)/%.pxd
$(VIRTUAL_ENV)/bin/cython -a $<
cyt: $(PACKAGE)/router.c $(PACKAGE)/routes.c
compile: cyt
$(VIRTUAL_ENV)/bin/python setup.py build_ext --inplace