-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (40 loc) · 1.12 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
PYTHON_VERSION=3
PACKAGE=ocr
SHELL=/bin/bash
VENV=.venv
PIP=$(VENV)/bin/pip3
bold := $(shell tput bold)
sgr0 := $(shell tput sgr0)
.PHONY: bootstrap
bootstrap: venv develop
.PHONY: clean
clean:
@echo "$(boid)Clean up old virtualenv and cache$(sgr0)"
rm -rf $(VENV) $(PACKAGE).egg-info .pytest_cache
.PHONY: venv
venv: clean
@echo "$(bold)Create virtualenv$(sgr0)"
virtualenv -p /usr/bin/python$(PYTHON_VERSION) $(VENV)
$(PIP) install --upgrade pip setuptools
.PHONY: develop
develop:
@echo "$(bold)Install and update develop requirements$(sgr0)"
$(PIP) install --upgrade .[develop]
$(PIP) install --upgrade .[testing]
$(PIP) install --upgrade .[demo]
$(PIP) install -e .
.PHONY: datashader
datashader:
# Not working on python 3.9 (see https://github.com/numba/numba/issues/6345)
@echo "$(bold)Add support for datashader plugin$(sgr0)"
$(PIP) install --upgrade --prefer-binary .[datashader]
.PHONY: demo
demo:
@$(VENV)/bin/panel serve --dev --show demo
.PHONY: test
test:
$(VENV)/bin/python -m pytest -p no:warnings
.PHONY: requirements.txt
requirements.txt:
@echo "$(bold)Freeze dependencies$(sgr0)"
$(PIP) freeze > $@