File: Makefile

package info (click to toggle)
justbackoff 0.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 108 kB
  • sloc: python: 117; makefile: 40; sh: 5
file content (41 lines) | stat: -rw-r--r-- 926 bytes parent folder | download
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
.PHONY: help build clean update test lint

VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3

.DEFAULT: help
help:
	@echo "make build"
	@echo "       prepare development environment, use only once"
	@echo "make clean"
	@echo "       delete development environment"
	@echo "make update"
	@echo "       update dependencies"
	@echo "make test"
	@echo "       run tests"
	@echo "make lint"
	@echo "       run black"

build:
	make venv

venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate:
	test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
	${PYTHON} -m pip install -U pip
	${PYTHON} -m pip install -r dev_requirements.txt
	$(VENV_NAME)/bin/pre-commit install
	touch $(VENV_NAME)/bin/activate

clean:
	rm -rf venv

update:
	${PYTHON} -m pip install -r dev_requirements.txt

test: venv
	${PYTHON} -m pytest

lint: venv
	$(VENV_NAME)/bin/black -t py37 --exclude $(VENV_NAME) .